The tutorial has used bit operators /bitmask to solve this ,but I am not able to understand it ,Can Someone help …