Miro interview question

DS questions. Time complexity, Space complexity.