BudiBadu Logo
00:00

Artisan Label String

Sorting Algorithms Easy 0 views

In the boutique fragrance workshop, the finishing desk receives scent labels in the exact order bottles are corked, so the production tablet captures an energetic jumble of names. The creative director wants a helper routine that reads this raw stack and produces a single string where each label appears on its own line, arranged alphabetically from the first scent to the last. The original list stays untouched for compliance tracking, so the returned string should simply offer a calm, line-by-line roster that brand stylists can paste into proof sheets, print on tasting cards, and share with social teams without manually retyping the lineup.

Limited releases sometimes repeat a scent name for matching duo bottles, and custom orders introduce lowercase experiments or symbols inside the label text. The helper must keep every entry exactly as written while sorting them into alphabetical order and inserting newline characters between each one. When the incoming list already reads alphabetically, the output should match the source labels character for character. If the workshop has not corked anything yet, the function should return an empty string so the desk instantly sees the queue is clear. This polished presentation keeps inventory audits smooth and prevents last-minute edits before the evening reveal.

Example 1:

Input: labels = ["Silver Lace","Aurora Bloom","Aurora Bloom","Cedar Mist"]
Output: "Aurora Bloom Aurora Bloom Cedar Mist Silver Lace"
Explanation: Each label stays intact while the string lists them alphabetically on separate lines.

Example 2:

Input: labels = ["Indigo Fern"]
Output: "Indigo Fern"
Explanation: A single label comes back unchanged because it already satisfies the order.

Example 3:

Input: labels = ["amber","Citrus Rise","Bluff"]
Output: "Bluff Citrus Rise amber"
Explanation: Labels keep their original casing while the ordering follows alphabetical comparison.

Related Problems

No related problems found

Comments (0)

Join the Discussion

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

BudiBadu Logo

Artisan Label String

Sorting Algorithms Easy 0 views

In the boutique fragrance workshop, the finishing desk receives scent labels in the exact order bottles are corked, so the production tablet captures an energetic jumble of names. The creative director wants a helper routine that reads this raw stack and produces a single string where each label appears on its own line, arranged alphabetically from the first scent to the last. The original list stays untouched for compliance tracking, so the returned string should simply offer a calm, line-by-line roster that brand stylists can paste into proof sheets, print on tasting cards, and share with social teams without manually retyping the lineup.

Limited releases sometimes repeat a scent name for matching duo bottles, and custom orders introduce lowercase experiments or symbols inside the label text. The helper must keep every entry exactly as written while sorting them into alphabetical order and inserting newline characters between each one. When the incoming list already reads alphabetically, the output should match the source labels character for character. If the workshop has not corked anything yet, the function should return an empty string so the desk instantly sees the queue is clear. This polished presentation keeps inventory audits smooth and prevents last-minute edits before the evening reveal.

Example 1:

Input: labels = ["Silver Lace","Aurora Bloom","Aurora Bloom","Cedar Mist"]
Output: "Aurora Bloom Aurora Bloom Cedar Mist Silver Lace"
Explanation: Each label stays intact while the string lists them alphabetically on separate lines.

Example 2:

Input: labels = ["Indigo Fern"]
Output: "Indigo Fern"
Explanation: A single label comes back unchanged because it already satisfies the order.

Example 3:

Input: labels = ["amber","Citrus Rise","Bluff"]
Output: "Bluff Citrus Rise amber"
Explanation: Labels keep their original casing while the ordering follows alphabetical comparison.

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.