Pergunta de entrevista da empresa RevComm (Japan)

Online coding challenge, 2 questions about Algorithm and Data structure. The level for those questions is Medium with 55 minutes time limit.