LG Soft India interview question

Array to find triplets in c++