JAVA_Robot Return to Origin_LeetCode 657


JAVA_Robot Return to Origin_LeetCode 657

JAVA_Robot Return to Origin_LeetCode 657 풀이 class Solution { public boolean judgeCircle(String moves) { int[] ch = new int[86]; for (char d : moves.toCharArray()) { ch[d]++; } return ch[68] == ch[85] && ch[76] == ch[82]; } } * 출처 Robot Return to Origin - LeetCode Robot Return to Origin - There is a robot starting at the position (0, 0), the origin, on a 2D plane. Given a sequence of its moves, judge if this robot ends up at (0, 0) after it completes its moves. You are given a string moves that r...


#JAVA #JAVA_LeetCode657 #JAVA_RobotReturntoOrigin #JAVA_RobotReturntoOrigin_LeetCode657 #RobotReturntoOrigin_LeetCode657

원문링크 : JAVA_Robot Return to Origin_LeetCode 657