iRobot interview question

Time complexity and space complexity