> After crunching through many leetcode problems I see the problems they give have really poor APIs
This. The real-world best solution to many leetcode problems is to implement an iterator over their broken interface so that <algorithm> can solve it.
Because of how they constrain you, what you end up doing is just sloppily reimplementing portions of the standard library. That's something that you should never want to do in the real world. It completely selects for the wrong thing.
This. The real-world best solution to many leetcode problems is to implement an iterator over their broken interface so that <algorithm> can solve it.
Because of how they constrain you, what you end up doing is just sloppily reimplementing portions of the standard library. That's something that you should never want to do in the real world. It completely selects for the wrong thing.