LeetCode 答案(Easy)(601-700)
生活随笔
收集整理的這篇文章主要介紹了
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.
一開始,機器人位于(0,0)。輸入一串移動次序命令,判斷機器人是否走了一個圈,也就是說它是否回到了原點。
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.
移動順序是一串字符串。每一步移動命令都是一個字符。有效的移動命令包括 R(向右) ,L(向左),U(向上)以及D(向下)。最終的輸出是true或者false,同來表示機器人是否走了一個圈。
- 答案
總結
以上是生活随笔為你收集整理的LeetCode 答案(Easy)(601-700)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 815. Bus Routes
- 下一篇: string类的实现(构造函数,析构函数