Pergunta de entrevista da empresa athenahealth

Find all triplets whose sum is k in an array