Pergunta de entrevista da empresa LINE

2 difficult problems that took me 30 minutes just to read