HackerRank solutions - Compare the Triplets