leetcode09-机器人能否返回原点

题目链接:

https://leetcode.cn/problems/robot-return-to-origin/?envType=study-plan-v2&envId=programming-skills

思路:

循环遍历,模拟即可

代码:
 

class Solution {
    public boolean judgeCircle(String moves) {
        int n = moves.length();
        if(n%2==1) return false;
        int x=0,y = 0;
        for(int i = 0;i

你可能感兴趣的:(leetcode刷题日记,算法,leetcode)