static int wing=[]()
{
std::ios::sync_with_stdio(false);
cin.tie(NULL);
return ;
}(); class Solution
{
public:
bool judgeCircle(string moves)
{
int count1=,count2=;
for(char c:moves)
{
if(c=='U')
count1++;
else if(c=='D')
count1--;
else if(c=='L')
count2++;
else
count2--;
}
return count1==&&count2==;
}
};
很简单