Counter game

  • + 0 comments

    Python

    def counterGame(n):
        pop_count = bin(n).count('1')
        zero_count = (n & -n).bit_length() - 1
        if (pop_count + zero_count) % 2 == 0:
            return "Louise"  
        else:
            return "Richard"