Calculating maximum sum of any random k elements in an array Recursively ( without any constraints)

前端 未结 0 1497
野性不改
野性不改 2021-02-12 15:46

What would be the fastest way to find the maximum of n elements within an array. (They don\'t need to be consecutive)

Eg a={1 ,3, 2, 5, 0, 10}

maximum sum when n=2

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