Given an array and an integer K, what is the maximum possible sum that can be achieved from the array elements such that sum is not greater than K?

后端 未结 0 1134
礼貌的吻别
礼貌的吻别 2020-12-03 02:29

I tried using the greedy approach but the approach is wrong. The only way I got is using all the array elements less than K and trying all possible combinations.

Is t

相关标签:
回答
  • 消灭零回复
提交回复
热议问题