[Java Fundamentals] Problem 10. Group by Group
Здравейте,
имам проблем с тази задача :
Create a class Person. It should consists of properties : name and group (String, Integer). Write a program that extracts all persons (students), grouped by GroupName and then prints them on the console. Print all group names along with the students in each group. Use the group by Stream operations. You will be given an input on the console.
Output format : {group} - {name1}, {name2}, {name3}, ...
Примерен вход:
Ivaylo Petrov 10
Stanimir Svilianov 3
Indje Kromidov 3
Irina Balabanova 4
END
Изход:
3 - Stanimir Svilianov, Indje Kromidov
4 - Irina Balabanova
10 - Ivaylo Petrov
Решението ми минава само нулевия тест: https://pastebin.com/1A0TBN8E,
judge -> https://judge.softuni.bg/Contests/Practice/Index/693#9
(Пробвах да го сортирам по ключ, ама май не е от това :)).
Мерси предварително
Веднага го оправих, благодаря :)