LeetCode 答案(Easy)(601-700)
657-Judge Route Circle (判斷 圈形路線)
Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place.
一開始,機(jī)器人位于(0,0)。輸入一串移動(dòng)次序命令,判斷機(jī)器人是否走了一個(gè)圈,也就是說它是否回到了原點(diǎn)。
The move sequence is represented by a string. And each move is represent by a character. The valid robot moves are R (Right), L (Left), U (Up) and D (down). The output should be true or false representing whether the robot makes a circle.
移動(dòng)順序是一串字符串。每一步移動(dòng)命令都是一個(gè)字符。有效的移動(dòng)命令包括 R(向右) ,L(向左),U(向上)以及D(向下)。最終的輸出是true或者false,同來表示機(jī)器人是否走了一個(gè)圈。
- 答案
總結(jié)
以上是生活随笔為你收集整理的LeetCode 答案(Easy)(601-700)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 815. Bus Routes
- 下一篇: string类的实现(构造函数,析构函数