Compare The Triplets Hackerrank Solution Python