Problem link: https://www.codechef.com/problems/ANDMIN
I made two submissions which does the same thing but in a different way. Basically, I have to check if the bit is set at position i in variable val. I did this in the following two ways:
$(1 << i) & val$
$(val >> i) & 1$
The first approach is giving TLE but the second one passed.
Submission Link:
- https://www.codechef.com/viewplaintext/17192142 [AC Code]
- https://www.codechef.com/viewplaintext/17192093 [TLE Code]
Any ideas why does this happen?




