class Solution {
public:
bool judgeCircle(string moves)
{
int len = moves.size();
int x = 0;
int y = 0;
for(int i = 0; i < len; ++i)
{
if(moves[i] == 'U')
{
x++;
}
else if(moves[i] == 'D')
{
x--;
}
else if(moves[i] == 'L')
{
y++;
}
else if(moves[i] == 'R')
{
y--;
}
}
if( (x==0) && (y==0))
{
return true;
}
return false;
}
};