Pergunta de entrevista da empresa Amazon

coding question related to data structure