Greatest Combination
CodeChefOpen on judge ↗
You are given N Numbers and you have to find the combination of K numbers whose sum is largest among all the combinations possible of K elements from N Numbers. Input First line contains T, No of test cases. Next T line contains following respectively:- First line consists of N and K Next line contains N space seperated numbers. Output Output the largest sum. Constraints 36 Example Input:
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start