← Back to Difficulty Selection

Code Review (Easy): Log Cleanup Protocol

Story

Lena was tidying up the user activity logs for the team’s internal dashboard because certain IDs were repeating so often they were cluttering the display. Mark noted that while seeing an ID twice helps show recent interaction, any further repetitions should be tucked away to keep the list concise. Lena realized she could just shuffle the relevant entries to the front of the list, ensuring no single ID appeared more than twice in a row. For example, if a log contained three entries for User A and one for User B, she would adjust it so only two instances of User A and one instance of User B remained at the start.

Your Task

Read the story and code, then decide if the code is ready for production or needs improvement.

Hints

What would block an approval? Give me a hint.

Next

Check out Next Topic: Tidying the Event Logs

Cookies help us track your progress - nothing extra.