Pergunta de entrevista da empresa Amazon

Given 3 arrays, return all duplicate elements. Follow up question: What if we extended the input to n arrays instead?