Pergunta de entrevista da empresa Google

2 questions in each phone call, leetcode hard and medium difficulty