File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/main/java/com/thealgorithms/others Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 3
3
import java .util .LinkedList ;
4
4
import java .util .Queue ;
5
5
import java .util .Scanner ;
6
-
6
+ // Java program to find minimum number of dice
7
+ // throws required to reach last cell from first
8
+ // cell of a given snake and ladder board
7
9
public class SnakeAndLadder {
8
10
public static class QueueEntry {
9
11
//cell number
@@ -59,7 +61,7 @@ public static void main(String args[]) {
59
61
60
62
//Representation of the board as graph
61
63
//If there are no snakes or ladders starting from a cell, we mark it as -1
62
- //If there is a snake or ladder, we assign the ending position of the snake and ladder
64
+ //If there is a snake or ladder, we will assign the ending position of the snake and ladder
63
65
int [] graph = new int [numberOfCells ];
64
66
for (int i = 0 ; i < numberOfCells ; i ++) {
65
67
graph [i ] = -1 ;
You can’t perform that action at this time.
0 commit comments