6 kyu
Triple Sorting - Sort & Stringify a list by 3 attributes
457 of 775pojo
Description:
Tale University is a bit messy, and can't maintain an ordered list of their student. Tale's dean wants to print a sortet list of his students by the gpa, last name and age and post it on the walls so everybody can be impressed of his great students.
Given a list of students, sort them by (from most important to least important):
- GPA (descending)
- First letter of last name (ascending)
- Age (ascending)
And the class Student:
class Student {
...
int getGpa()
int getAge();
String getFullName();
}
Return the sorted result as full names string, comma separated.
For Example, given the list (name, age, gpa):
- David Goodman, 23, 88
- Mark Rose, 25, 82
- Jane Doe, 22, 90
- Jane Dane, 25, 90
sort(students) should return "Jane Doe,Jane Dane,David Goodman,Mark Rose"
Streams
Strings
Algorithms
Arrays
Sorting
Similar Kata:
Stats:
Created | Nov 14, 2016 |
Published | Nov 14, 2016 |
Warriors Trained | 1703 |
Total Skips | 60 |
Total Code Submissions | 5433 |
Total Times Completed | 775 |
Java Completions | 457 |
JavaScript Completions | 325 |
Total Stars | 42 |
% of votes with a positive feedback rating | 90% of 137 |
Total "Very Satisfied" Votes | 112 |
Total "Somewhat Satisfied" Votes | 22 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |