Whenever you're ready, walk me through how you'd approach this.
What are the time and space complexities of the algorithms you implemented?