Flipkart Interview Question
SDE1sCountry: India
Interview Type: Written Test
This solution doesn't work for this case:
char input_array [5][5] = {{'.','.','B','.','.'},
{'.','.','G','R','R'},
{'.','.','B','.','.'},
{'B','.','.','.','.'},
{'B','.','.','.','G'}};
Because this 2 will miss:
1 horizontal strip from (4,4) to (4,4)
1 vertical strip from (4,4) to (4,4)
so total — 5
Here is a sample solution for above input, can be easily converted for dynamic input:
- atul June 20, 2015