Pregunta de entrevista de Ashika

Mathematical analysis and a coding question