C++ solution


  • 0
    J

    '''
    bool judgeCircle(string moves) {
    map<char, int> count;
    for(char ch : moves)
    count[ch] ++;
    return ((count['L'] == count['R']) && (count['U'] == count['D']));
    }
    '''


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.