solving srm 207 div 2 problem 3 using bfs
solving srm 207 div 2 problem 3 using bfs