Phone screen:
Onsite:
Round 1:
Round 2:
bfs(grid, I, j):
Start bfs from i,j point for all directions. Start updating distance like 1 , 2 etc after skipping ‘X’. if any already calculated distance is less then do not go further.
For i in len(grid):
For j in len(grid):
If grod[i][j] == ‘C’:
bfs(grid, I, j)Round 3:
Round 4:
Round 5: