11518 - Dominos 2
Solution Description : Simple BFS or DFS problem Run BFS single time for all domino's which are knocked over by hand. If you run BFS l time then you got time limit exit. First push all z to queue then run bfs one time and calculate total number of domino's fall down. |
||||||||||