Beautiful Triplets Hackerrank Solution In C