Challenge: Finding the Top 3 Hardest-Working Employees
Opgave
Swipe to start coding
Several employees work at the factory, and we need to identify the three hardest-working employees based on the number of hours worked.
- Sort the list of
workers
in ascending order by the number ofhoursWorked
using thecomparingInt()
method. - Reverse the list of
workers
to make it descending by the number ofhoursWorked
using thereversed()
method. - Select the top three workers with the highest
hoursWorked
using thelimit()
method. - Print each of these three workers to the console.
Løsning
solution.java
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 10
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Awesome!
Completion rate improved to 2.33Awesome!
Completion rate improved to 2.33
Challenge: Finding the Top 3 Hardest-Working Employees
Opgave
Swipe to start coding
Several employees work at the factory, and we need to identify the three hardest-working employees based on the number of hours worked.
- Sort the list of
workers
in ascending order by the number ofhoursWorked
using thecomparingInt()
method. - Reverse the list of
workers
to make it descending by the number ofhoursWorked
using thereversed()
method. - Select the top three workers with the highest
hoursWorked
using thelimit()
method. - Print each of these three workers to the console.
Løsning
solution.java
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 10
single
Awesome!
Completion rate improved to 2.33
Challenge: Finding the Top 3 Hardest-Working Employees
Stryg for at vise menuen
Opgave
Swipe to start coding
Several employees work at the factory, and we need to identify the three hardest-working employees based on the number of hours worked.
- Sort the list of
workers
in ascending order by the number ofhoursWorked
using thecomparingInt()
method. - Reverse the list of
workers
to make it descending by the number ofhoursWorked
using thereversed()
method. - Select the top three workers with the highest
hoursWorked
using thelimit()
method. - Print each of these three workers to the console.
Løsning
solution.java
Var alt klart?
Tak for dine kommentarer!