구준희3 21] Leetcode 657. Robot Return to Origin Robot Return to Origin - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 주어진 문자열대로 이동했을때 원래 위치로 돌아올 수 있는지 묻는 문제. class Solution { public: bool judgeCircle(string moves) { int upDown = 0; int leftRight =0; for(int i = 0;i 2020. 7. 1. 12] Leetcode 1486. XOR Operation in an Array 배타적 논리합, XOR 연산에 관한 문제다. XOR Operation in an Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 초기값만 start로 해주고 나머지는 이어서 고대로 해주면 된다. class Solution { public: int xorOperation(int n, int start) { int ans = start; for(int i = 1;i 2020. 6. 24. 1] Leetcode 1480. Running Sum of 1d Array Running Sum of 1d Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 처음은 그대로 해주고 다음 값부터는 앞에 값 더 해주면 된다. class Solution { public: vector runningSum(vector& nums) { for(int i=1;i 2020. 6. 16. 이전 1 다음