Pergunta de entrevista da empresa Paycom

polymorphism, encapsulation, made me write a code on how to find duplicates in an array and how to find number with 2 consecutive numbers