Pregunta de entrevista de FirstBank (TN)

Ask you solve and explain DSA logic