Bit Array Hackerrank Solution For List