Pergunta de entrevista da empresa Skyscanner

Two medium difficulty DSA questions