Hi, I'm trying to solve this problem. The brute force approach is factorial so it evidently won't work. I've got a feeling that there must be a greedy strategy to solve it, but I haven't been able to figure it out just yet. Any help will be appreciated.
Thank you very much!