Array Manipulation Python Hackerrank Questions