GUVI
Back

ACCEPT THE CHALLENGE || #WinACourseWednesday

Created 2 years ago
261 Views
4 Comments
TEAMCS
@TEAMCS
TEAMCS
@TEAMCSProfile is locked. Login

You are given a spreadsheet that contains a list of N athletes and their details (such as age, height, weight and so on). You are required to sort the data based on the Kth attribute and print the final resulting table. Follow the example given below for a better understanding.

Rank

Age

Height(in cm)

1

32

190

2

35

175

3

41

188

4

26

195

5

24

176

 

Sorting based on K=1 i.e(age)

Rank

Age

Height

5

24

176

4

26

195

1

32

190

2

35

175

3

41

188

 

Note that K is indexed from 0 to M-1, where M is the number of attributes.

Constrain: If two attributes are the same for different rows, for example, if two athletes are of the same age, print the row that appeared first in the input.

Kindly comment the code for the above problem statement and
GUVIan who comments first with the correct code would win a Premium course of their choice.

Results will be declared by next week!!

Hurry up!!


Comments (4)
Please login to comment.
 
Powered by habitate.io Habitate