class Solution(object):
    def hasAlternatingBits(self, n):
        """
        :type n: int
        :rtype: bool
        """
        power_2 = (n ^ (n >> 1)) + 1
        return (power_2 & -power_2) == power_2

Add py solution for 693. Binary Number with Alternating Bits
Add py solution for 693. Binary Number with Alternating Bits

693. Binary Number with Alternating Bits: https://leetcode.com/problems/binary-number-with-alternating-bits/
