Regarding bitmask

in line 27 how left shift operator is working
i < (1<<n) …can we not take direct n=8…as we know 1<<n= pow(2,n).
can any help me
code link-https://ide.codingblocks.com/s/220597

@hunt
1<<n will give you the same result as pow(2,n) , no doubt but it would much faster.
Do not hardcode to n=8 , as that would be assuming you are always getting a string of length 3 as input which may not be the case.
Rest of the code is fine.