Pregunta de entrevista de Amazon Robotics

some basic problem about recursion