BudiBadu Logo
00:00

Arrange Guest Check-ins

Sorting Algorithms Easy 1 views

Every morning the concierge team logs how many guests arrive during each thirty minute window. Your task is to take their list of visit counts and reorganize it so the records appear from the smallest number of arrivals to the largest. The staff relies on this sorted view to plan extra help when heavier waves appear. You do not modify the counts themselves; only their order matters, and the output must include every provided value exactly once.

The concierge leads particularly care about moments when identical counts repeat. In those cases, the duplicates should stay grouped together sequentially after sorting so the team instantly spots steady periods. Negative numbers may appear when a scheduled group cancels at the last minute; those represent net departures and must be placed at the beginning once you reorder the list. Empty lists are possible if the hotel shuts the lobby for maintenance, and your function should handle that scenario gracefully.

You should return a fresh collection arranged in ascending order, leaving the original data untouched. Do not trim the list, insert new values, or annotate the entries. Imagine you are preparing a clipboard that simply lists the counts from calmest to busiest. The operations behind the scenes can involve any approach you choose, but the final arrangement must be consistent with the rules above for every dataset the concierge might provide.

Example 1:

Input: arrivals = [12, 3, 18, 3, 6]
Output: [3, 3, 6, 12, 18]
Explanation: The sorted view places the smallest arrival counts first so the desk schedules staff accordingly.

Example 2:

Input: arrivals = [-2, -2, 7, 4, 0]
Output: [-2, -2, 0, 4, 7]
Explanation: Negative values appear first because they reflect cancellations before growth later in the day.

Example 3:

Input: arrivals = []
Output: []
Explanation: An empty clipboard stays empty after sorting because there are no counts to reorder.

Related Problems

No related problems found

Comments (0)

Join the Discussion

Share your thoughts, ask questions, or help others with this problem.

BudiBadu Logo

Arrange Guest Check-ins

Sorting Algorithms Easy 1 views

Every morning the concierge team logs how many guests arrive during each thirty minute window. Your task is to take their list of visit counts and reorganize it so the records appear from the smallest number of arrivals to the largest. The staff relies on this sorted view to plan extra help when heavier waves appear. You do not modify the counts themselves; only their order matters, and the output must include every provided value exactly once.

The concierge leads particularly care about moments when identical counts repeat. In those cases, the duplicates should stay grouped together sequentially after sorting so the team instantly spots steady periods. Negative numbers may appear when a scheduled group cancels at the last minute; those represent net departures and must be placed at the beginning once you reorder the list. Empty lists are possible if the hotel shuts the lobby for maintenance, and your function should handle that scenario gracefully.

You should return a fresh collection arranged in ascending order, leaving the original data untouched. Do not trim the list, insert new values, or annotate the entries. Imagine you are preparing a clipboard that simply lists the counts from calmest to busiest. The operations behind the scenes can involve any approach you choose, but the final arrangement must be consistent with the rules above for every dataset the concierge might provide.

Example 1:

Input: arrivals = [12, 3, 18, 3, 6]
Output: [3, 3, 6, 12, 18]
Explanation: The sorted view places the smallest arrival counts first so the desk schedules staff accordingly.

Example 2:

Input: arrivals = [-2, -2, 7, 4, 0]
Output: [-2, -2, 0, 4, 7]
Explanation: Negative values appear first because they reflect cancellations before growth later in the day.

Example 3:

Input: arrivals = []
Output: []
Explanation: An empty clipboard stays empty after sorting because there are no counts to reorder.

00:00
Loading editor...
Test Results

Run your code to see test results

Click the Submit button to execute your solution

Related Problems

No related problems found

Comments (0)

Join the Discussion

Share your thoughts, ask questions, or help others with this problem.