GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing leetcode.cn — 657. 机器人能否返回原点 - 力扣(LeetCode) 题目描述 题目描述 题解 题解 提交记录 提交记录 简单 在二维平面上,有一个机器人从原点 移动顺序由字符串 如果机器人在完成所有动作后返回原点,则返回 注意:机器人“面朝”的方向无关紧要。
示例 1: 输入: moves = "UD" 输出: true 解释:机器人向上移动一次,然后向下移动一次。所有动作都具有相同的幅度,因此它最终回到它开始的原点。因此,我们返回 true。 示例 2: 输入: moves = "LL" 输出: false 解释:机器人向左移动两次。它最终位于原点的左侧,距原点有两次 “移动” 的距离。我们返回 false,因为它在移动结束时没有返回原点。
提示:
代码 代码 测试用例 测试用例 测试结果 测试结果 |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |