Computer Science, asked by mrarkapravo, 1 month ago

N number of people participated in a coding marathon where they were asked to solve some problems. Each problem carried 1 mark and at the end of the marathon, the total marks that each person achieved was calculated. As an organizer, you have the list of the total marks that each person achieved. You have to calculate the sum of the marks of top K scorers from the list. Input Specification: input1: N, Total number of participants input2: Top scorers input3: An array of length N with the scores of all N participants Output Specification: Return S, sum of the marks of top K scorers from the list. Example 1: input1: 4 input2: 2 input3: {4, 1, 2, 5} Output: 9 Explanation: Top 2 scores are 5 and 4. Sum = 5+4=9. Example 2: input1: 4 input2: 3 input3: {4, 3, 6, 1} Output: 13 Explanation: Top 3 scores are 6, 4 and 3. Sum = 6+4+3=13.

Can anyone explain me what will be the program in Java ?

Answers

Answered by Anonymous
1

Answer:

language used phythagorus thearum

Similar questions