This problem can be solved using a Greedy approach

programming
Tags: #<Tag:0x00007f2428e16510>

#1

I can not see any reason to use DP.


#2

This section is titled “greedy or DP” and is meant to help users pick between the two