Skip to content

Commit dd4ca49

Browse files
committed
update
1 parent 27bbda5 commit dd4ca49

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: algorithms/robot-return-to-origin.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ var judgeCircle = function (moves) {
1212
for (let char of moves) {
1313
o[char] = (o[char] || 0) + 1;
1414
}
15-
if (o["L"] === o["R"] && o["U"] === o["D"]) {
16-
return true;
17-
} else {
18-
return false;
19-
}
15+
16+
return o["L"] === o["R"] && o["U"] === o["D"];
2017

2118
// 思路:
2219
// 将物体的前后左右移动看成是在 xy 坐标轴上的移动

0 commit comments

Comments
 (0)