Counter game

  • + 0 comments

    c++

    string counterGame(long n) {
    
     std::bitset<sizeof(long) * 8> bits = n-1;
     
     if(bits.count() % 2 == 0){
        return "Richard";
     }
     return "Louise";
    }