Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A class has 'n' students and each student appears for exactly 'k' exams. The class teacher has the list of marks scored by all the

image text in transcribed
image text in transcribed
image text in transcribed
A class has 'n' students and each student appears for exactly 'k' exams. The class teacher has the list of marks scored by all the students and needs to identify the student with the nth Rank. Rank is the position in the sorted list of total marks, from high to low. If two students have equal total marks, their original order is maintained while sorting. Given the initial order of the marks and the required rank of the student, output the index of the chosen student by the teacher. For example, given the data for n = 3 student as performance = [[79, 89, 15], [85, 89, 92], [71, 96, 88]] and the required position be rank = 2, the student with index 2 is the answer. The total marks for each student in class are [183, 266, 255] respectively and the student with total score of 255 has a rank of 2. Function Description Function Description Complete the function findTheRank in the editor below. The function must return an integer, the index of the student at the required rank. find TheRank has the following parameter(s): performance[performance[0],...performance[n-1] [k-1]]: a 2D array of integers that denote the performance (marks) of n students in k exams rank: The required rank Constraints 1sns 10 1 sks 10 1 s rank sn Os performance[iljl s 100 (where 0 si<>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions

Question

1. Organize and support your main points

Answered: 1 week ago

Question

3. Move smoothly from point to point

Answered: 1 week ago

Question

5. Develop a strong introduction, a crucial part of all speeches

Answered: 1 week ago