Otherwise case:-1

what is the condition when triplet does not exists??

You have to simply print -1, if the triplet doesnt exist. For more explanation, you can refer to the online video hint given in the lecture.