according to https://cses.fi/problemset/task/1085
the simplest method to partition the array is to start from left to right and as long as if you can add the current number to the subset and it's not surpass the maximum value ( find this value by binary search it ) then add it to the current subset. otherwise just start a new subset and do the same thing all over again
Ex. 2 , 4 , 7 , 3 ,5 and the maximum value is 8 using the method above you will have [2,4] , [7] , [3,5]
i understand that this greedy method works. but the question is how can you prove this approach mathemetically ??
and if i find some greedy related problem like this again should i try to prove it or it doesn't need to prove every single greedy problem ?
PS. sorry for confusing language. i hope you understand what i was trying to convey.