athenahealth interview question

Find all triplets whose sum is k in an array