Pergunta de entrevista da empresa IBM

i was unable to crack the the coding round