Miro Interview Question

DS questions. Time complexity, Space complexity.