Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cb82764

Browse files
a
1 parent fc7f5c0 commit cb82764

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/KnightProbabilityInChessboard.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ public boolean equals(Object o) {
6565
public int hashCode() {
6666
return 31 * row + column;
6767
}
68+
69+
@Override
70+
public String toString() {
71+
return "Position{" +
72+
"row=" + row +
73+
", column=" + column +
74+
'}';
75+
}
6876
}
6977

7078
private record State(int n, int k, Position position) { }
@@ -85,6 +93,7 @@ private enum Movement {
8593

8694
public double knightProbability(int n, int k, int row, int column) {
8795
computeValidMovements(n);
96+
System.out.println(allowedMovements);
8897
return getKnightProbability(n, k, new Position(row, column, n));
8998
}
9099

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /