by mymemesarespiciest
Last Updated September 11, 2019 02:05 AM - source

I'm practicing problems and found this weird one. I can't figure out the best way to solve it.

You are given a 2D matrix size n*n with only 1's and 0's, you have to find the longest sequence of 1's either column-wise or row-wise.

I'm pretty stuck on this problem. I was trying to use a divide and conquer technique to split up the array into 4 n/2 * n/2 arrays, but the step where I merge together is still so slow because I have to check every adjacent row/column. Any advice on a fast solution would be great. I've spent way too much time staring at this.

- Serverfault Help
- Superuser Help
- Ubuntu Help
- Webapps Help
- Webmasters Help
- Programmers Help
- Dba Help
- Drupal Help
- Wordpress Help
- Magento Help
- Joomla Help
- Android Help
- Apple Help
- Game Help
- Gaming Help
- Blender Help
- Ux Help
- Cooking Help
- Photo Help
- Stats Help
- Math Help
- Diy Help
- Gis Help
- Tex Help
- Meta Help
- Electronics Help
- Stackoverflow Help
- Bitcoin Help
- Ethereum Help