Showcase Name Roll
Inside the riverfront performance hall, the stage manager collects performer cards as each ensemble arrives. The tablet logs the names exactly as they appear on the badge, preserving punctuation and spacing, but the list grows in the hectic order of arrival. The manager needs a helper routine that reads this raw roster and returns a single string where every name is arranged alphabetically and separated by a comma followed by a space. The original list must remain untouched for contract audits, so the returned string should simply present a calm, alphabetical roll call that hosts can project in the wings, use for quick attendance, and share with front-of-house staff without rewriting anything by hand.
Matinees with guest duets may repeat the same name multiple times, and promotional sets occasionally include lowercase accent stylings or leading articles. The helper therefore has to keep every entry exactly as written while sorting them into ascending name order and joining them in the requested comma-separated format. When the incoming list already happens to be alphabetical, the resulting string should match the badges word-for-word. A completely empty check-in should yield an empty string so the assistant can instantly confirm no one has signed in. This dependable presentation keeps rehearsals on schedule and prevents late edits to printed programs.
Example 1:
Input: names = ["Cello Trio","Aurora","Aurora","Brassline"]
Output: "Aurora, Aurora, Brassline, Cello Trio"
Explanation: Every badge stays present while the names appear alphabetically with comma-and-space separators.
Example 2:
Input: names = ["Indigo"]
Output: "Indigo"
Explanation: A single entry already meets the requested order, so the string mirrors the input.
Example 3:
Input: names = ["Echo","alto","Drumline"]
Output: "Drumline, Echo, alto"
Explanation: Names keep their original casing while the sequence follows alphabetical ordering.
Related Problems
No related problems found
Comments (0)
Join the Discussion
Share your thoughts, ask questions, or help others with this problem.
