class Solution {
public:
bool judgeCircle(string moves) {
int RL=0;
int UD=0;
string::iterator itr;
for(itr=moves.begin(); itr!=moves.end(); itr++)
{
switch(*itr)
{
case 'R':
RL++;
break;
case 'L':
RL--;
break;
case 'U':
UD++;
break;
case 'D':
UD--;
break;
default:
;
}
}
if(RL==0 && UD==0)
return true;
else
return false;
}
};