gouravkrosx's blog

By gouravkrosx, history, 3 years ago, In English

A matrix of 0’s and 1’s is given, you have to find largest adjacent string of 1’s, you cannot traverse a cell more than once. A pair of 1’s is adjacent if they are in immediate up, down, right or left cells.

Ex:

0 0 0 0 0
0 0 1 0 0 
1 1 1 0 0 
0 0 1 1 0

ans-5
(not 6 as they are not asking size of largest block!) (2,0 -> 2,1 -> 2,2-> 3,2 -> 3,3)

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it