Check whether bits are in alternate pattern in the given range | Set-2
Given a non-negative number N and two values L and R . The problem is to check whether or not N has an alternate pattern in its binary representation in the range L to R. Here, alternate pattern means that the set and unset bits occur in alternate order. The bits are numbered from right to left, i.e