Cisco interview question

space complexity for a given task