Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 81f751d

Browse files
committed
1041 wrong answer
1 parent be1ca35 commit 81f751d

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"ASCI",
55
"GGLLGG",
66
"GLGLGGLGL",
7+
"GLRLLGLL",
78
"Gawl",
89
"Gawlme",
910
"Gawlqt",

Algorithms/1041.robot-bounded-in-circle/robot-bounded-in-circle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ func isRobotBounded(instructions string) bool {
1212
r++
1313
}
1414
}
15-
return g == 0 || l != r
15+
return g == 0 || (l-r)%4 != 0
1616
}

Algorithms/1041.robot-bounded-in-circle/robot-bounded-in-circle_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ var tcs = []struct {
1212
ans bool
1313
}{
1414

15+
{
16+
"GLRLLGLL",
17+
true,
18+
},
19+
1520
{
1621
"GLGLGGLGL",
1722
false,

0 commit comments

Comments
 (0)