Amazon Interview Question
Software Engineer / DevelopersTeam: payments team
Country: India
Interview Type: In-Person
Question here is to print all the entities which are bounded by 0`s and centered with 1.
Like below.
0 1 2 3 4 5
________________
0 | 0 0 0 1 0 0 |
1 | 0 [1] 0 [1] 0 1 |
2 | 0 0 0 0 0 0 |
3 | 0 1 0 [1] 0 1 |
4 |_ 0 1 1 0 1 1_|
in above matrix... [1] are the required entities...
flyod fill algorithm will give u the no of such entities.
- Anonymous November 04, 2012