Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 773. Sliding Puzzle
Given a 2x3 sliding puzzle with tiles 1–5 and a blank (0), find the minimum number of swaps of 0 with its 4-directional neighbors to reach the target [[1,2,3],[4,5,0]] (or return -1 if impossible). This is a shortest-path search in the permutation state graph (solvable via BFS/heuristic search due to the small state space).
Asked at:
Amazon
Microsoft
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late October, 2025
Microsoft
Mid-level
Late April, 2025
Amazon
Mid-level
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.