Pregunta de entrevista de Pape-Dawson

solve leetcode question 234 using arrays