Doubt in unique no 3

my code is showing wrong answer if i am taking long long and iterating till 63
but it shows right answer if i take int and iterate till 31

where i am wrong
my code