BudiBadu Logo

Atrium Tour Sorter

Sorting Easy 0 views
Like15

Imagine you’re a docent at a world-class atrium, and your job is to organize hundreds of tour visitors based on their badge numbers. That’s the mission of Atrium Tour Sorter! You’re given a jumbled roster of integers representing tour badges, and your task is to arrange them into an ascending sequence to help manage meeting points and ensure a smooth flow of people through the galleries.

The "secret sauce" here is maintaining Numerical Integrity. Whether you’re dealing with family groups (duplicate badge numbers) or gallery closures (negative placeholders), every single entry must be preserved while moving from smallest to largest value. An empty roster should be handled gracefully, and even a single-visitor tour must be processed correctly. This gives you a reliable data structure for staging tours and meeting strict compliance reporting standards.

This challenge turns a simple sorting exercise into a practical scenario where order and data accuracy are key to a great visitor experience. It’s a must-master skill for anyone building logistical or scheduling software!

Examples

Example 1
Input
nums = [18,4,9,4]
Output
[4,4,9,18]
Explanation

Duplicate family badges remain while the list climbs from lowest to highest.

Example 2
Input
nums = []
Output
[]
Explanation

An empty signup produces an empty roster for the guides.

Example 3
Input
nums = [0,-3,7]
Output
[-3,0,7]
Explanation

Negative placeholders and positive badges appear together in ascending order.

Algorithm Flow

Recommendation Algorithm Flow for Atrium Tour Sorter - Budibadu
Recommendation Algorithm Flow for Atrium Tour Sorter - Budibadu

Best Answers

java
import java.util.*;

class Solution {
    public int[] sort_atrium_badges(int[] nums) {
        int[] sortedArr = nums.clone();
        Arrays.sort(sortedArr);
        return sortedArr;
    }
}