[C] Clean code


  • 0
    P

    bool judgeCircle(char* moves) {
    char map[256];
    char *ptr = moves;

    memset(map, 0, sizeof(map));
    while(*ptr)
    {
    	map[*ptr]++;
        ++ptr;
    }
    return !(map['R'] + map['U'] - map['L'] - map['D']);
    

    }


Log in to reply
 

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