Element appearing only once in an array containing triplets