← ALL NOTES
Array

3069. Distribute Elements Into Two Arrays I

Every decision depends only on the current tail of each array, so I keep both as plain vectors and compare their back() values on each step, appending straight to them and concatenating at the end.

Loading…