Compare Triplets Hackerrank Solution