773 Sliding Puzzle
773. Sliding Puzzle
1. Question
Input: board = [[1,2,3],[4,0,5]]
Output: 1
Explanation: Swap the 0 and the 5 in one move.Input: board = [[1,2,3],[5,4,0]]
Output: -1
Explanation: No number of moves will make the board solved.2. Implementation
3. Time & Space Complexity
Last updated