Solutions for Sparse or Not

    • @GarretVam
    • @mason, submitted in Python 2, achived 100% score
    def solve(n): 
    
        # n is not sparse if there is set 
        # in AND of n and n/2 
        if (n & (n>>1)): 
            return "FALSE"
    
        return "TRUE"
    
    • @GarretVam
    • @mason, submitted in Python 3, achived 100% score
    def solve(n): 
    
        # n is not sparse if there is set 
        # in AND of n and n/2 
        if (n & (n>>1)): 
            return "FALSE"
    
        return "TRUE"