#351 Finding Step Count Champions
At Avito, we enjoy holding competitions. Recently, we organized a step-count championship, and now it is time to determine the results!
Find the userIds of the participants who walked the greatest total number of steps over all days without missing a single competition day.
# Example 1
# input
statistics = [
[{ userId: 1, steps: 1000 }, { userId: 2, steps: 1500 }],
[{ userId: 2, steps: 1000 }]
]
# output
champions = { userIds: [2], steps: 2500 }
# Example 2
# input
statistics = [
[{ userId: 1, steps: 2000 }, { userId: 2, steps: 1500 }],
[{ userId: 2, steps: 4000 }, { userId: 1, steps: 3500 }]
]
# output
champions = { userIds: [1, 2], steps: 5500 }
Question review
Sign in to start the dialogue
The mentor keeps the context of the current question and your previous messages.
Sign in
Available with Premium
This is just one of the solutions available with Premium. And more:
- 250+ advanced lectures
- 1300+ practice exercises
- 500+ solutions to problems from real interviews
- Personalized Java Hub certificates
- Expanded access to the AI mentor