Monday, December 24, 2012

Count maximum number of "connected 1" in given matrix

you have a matrix of N x N filled with 1 or 0. you can move only 1 step either right or 1 step down. you need to count maximum number of "connected 1" in given matrix. for example
0 0 1 1
1 1 1 0
1 0 1 0
0 1 0 1

[Start from top left] maximum no. of 1 is 4
[1,0][1,1][1,2][2,2]


Source -: Commented by a user "rakesh"

1 comment :

Unknown said...

I was really in search of this topic and i found that this is the best website related to this topic, thanks to you for sharing this information.

AAV Advisories - company law, company formation law, accounting management, agricultural management, project consultancy consultant