Pregunta de entrevista de Navan

similar to pascal triangle with recursion and optimization