Pergunta de entrevista da empresa ARI Simulation

Logic based question on Programming language.