Sherlock And Array Hackerrank Solution In Python