Pergunta de entrevista da empresa IBM

Coding challenge consisted of 3 questions, mainly on data structures and algorithms