




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use dynamic programming to find the optimal solution by saving the previous best like-time coefficient and its corresponding element sum.
If adding the current element to the previous best like-time coefficient and its corresponding element sum would increase the best like-time coefficient, then go ahead and add it. Otherwise, keep the previous best like-time coefficient.