Python 1 liner, O(1) solution


  • 0
    return num in set([4**0, 4**1, 4**2, 4**3, 4**4, 4**5, 4**6, 4**7, 4**8, 4**9, 4**10, 4**11, 4**12, 4**13, 4**14, 4**15])
    

Log in to reply
 

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