Twins Hackerrank Solution In Python