Skip to content

909. Snakes and Ladders #1750

Answered by mah-shamim
mah-shamim asked this question in Q&A
May 31, 2025 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

We need to find the minimum number of dice rolls required to reach the last square (n²) in a Snakes and Ladders game. The board is labeled in a Boustrophedon style, meaning the labeling alternates direction each row starting from the bottom left. The solution involves simulating the game using Breadth-First Search (BFS) to explore all possible paths level by level, ensuring the shortest path is found efficiently.

Approach

  1. Problem Analysis: The game involves moving from square 1 to square n² on an n x n board. Each move consists of rolling a 6-sided die, moving to one of the next 6 squares (if available), and following any snake or ladder encountered. The challenge is to compute the leas…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@basharul-siddike
Comment options

@mah-shamim
Comment options

mah-shamim May 31, 2025
Maintainer Author

Answer selected by basharul-siddike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants