Find mode or minimum with time-space tradeoffs | Meta Interview Question