Compare The Triplets Hackerrank Solution Java