Bit Array Hackerrank Solution For Python 3