Get Mystery Box with random crypto!

#N657. Robot Return to Origin problem link #solution class So | Leetcode in Java && MySQL

#N657. Robot Return to Origin
problem link

#solution
class Solution {
public boolean judgeCircle(String moves) {
int[] count = new int[4];

for(char ch: moves.toCharArray()){
if(ch == 'R') count[0]++;
else if(ch == 'L') count[1]++;
else if(ch == 'U') count[2]++;
else count[3]++;
}

return count[0] - count[1] == 0 && count[2] - count[3] == 0;
}
}