Java Sort Hackerrank Solution For Python