> For the complete documentation index, see [llms.txt](https://851958789.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://851958789.gitbook.io/notes/0561_array_partition_i/slt.md).

# Solution1 Sort

`min(a, b)` will get min of a and b. So if a and b diff is large, e.g. b >> a, then b is wasted.

So what we do is make sure a and b is as close as possible. The right way to do it is sort `nums` first.
