BF
- starting from (0,0) swap vertically and horizontaly
- check local max score
- return global max score
DFS, Graph
- at first tried storing input in 2d array and DFSed from 1.
- got time-out.
- implemented graph to store input.
Graph, Topological Sort
Floyd-Warshall Algorithm Took long time to satify the conditions.
- Never assume something that's not in the problem.
- A problem can be quite dirty.