BudiBadu Logo
00:00

Festival Stall Order

Sorting Algorithms Easy 0 views

At the downtown night festival, stall identifiers stream into the scheduling tablet in the jolted order trucks squeeze through barricades, leaving the operations report mismatched with the serene flow guests see on printed maps. The event director needs a helper routine that reads the raw stall identifiers and returns a fresh list where every value rises steadily from the smallest stall number to the largest. Because the tablet record remains locked for permits and inspections, the routine must build a separate list that keeps every identifier untouched while presenting the confident order the director uses to arrange signage, lighting cues, and cash-drop checkpoints throughout the midway.

Vendor collectives sometimes share the same stall identifier, and safety marshals mark inaccessible lanes with negative placeholders, so the returned list must keep each entry while only repositioning them into ascending order. When the data already arrives in sequence, the helper should echo the original list so the director knows no additional reshuffling is required. Before gates open, compliance compares the helper's output with a trusted reference grid and halts wristband scanning if even one stall drifts out of place. Produce a response that mirrors that reference exactly, including the quiet case where no stalls are registered and an empty list signals the midway is resting for the night.

Example 1:

Input: nums = [21,8,21,4]
Output: [4,8,21,21]
Explanation: Shared stalls keep both entries while the list climbs from smallest to largest.

Example 2:

Input: nums = [5,-1,5,2]
Output: [-1,2,5,5]
Explanation: Negative placeholders and duplicates remain visible in ascending order.

Example 3:

Input: nums = [13]
Output: [13]
Explanation: A single stall stays unchanged because the identifiers were already ordered.

Related Problems

No related problems found

Comments (0)

Join the Discussion

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

BudiBadu Logo

Festival Stall Order

Sorting Algorithms Easy 0 views

At the downtown night festival, stall identifiers stream into the scheduling tablet in the jolted order trucks squeeze through barricades, leaving the operations report mismatched with the serene flow guests see on printed maps. The event director needs a helper routine that reads the raw stall identifiers and returns a fresh list where every value rises steadily from the smallest stall number to the largest. Because the tablet record remains locked for permits and inspections, the routine must build a separate list that keeps every identifier untouched while presenting the confident order the director uses to arrange signage, lighting cues, and cash-drop checkpoints throughout the midway.

Vendor collectives sometimes share the same stall identifier, and safety marshals mark inaccessible lanes with negative placeholders, so the returned list must keep each entry while only repositioning them into ascending order. When the data already arrives in sequence, the helper should echo the original list so the director knows no additional reshuffling is required. Before gates open, compliance compares the helper's output with a trusted reference grid and halts wristband scanning if even one stall drifts out of place. Produce a response that mirrors that reference exactly, including the quiet case where no stalls are registered and an empty list signals the midway is resting for the night.

Example 1:

Input: nums = [21,8,21,4]
Output: [4,8,21,21]
Explanation: Shared stalls keep both entries while the list climbs from smallest to largest.

Example 2:

Input: nums = [5,-1,5,2]
Output: [-1,2,5,5]
Explanation: Negative placeholders and duplicates remain visible in ascending order.

Example 3:

Input: nums = [13]
Output: [13]
Explanation: A single stall stays unchanged because the identifiers were already ordered.

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.