BackmediumStrings Adobe

Galactic Transmission Reconstructor Solution

Problem Statement

Reconstruct the original transmission by arranging the given phrases lexicographically to form the smallest possible string, removing spaces between phrases.

Example 1
Input
['codeeatforstoetoe', 'tac', 'toe']
Output
codeeatforstoetoe tac toe

Explanation: Step-by-step: 1. Sort the phrases lexicographically: ['codeeatforstoetoe', 'tac', 'toe']. 2. Remove spaces between phrases: 'codeeatforstoetoe tac toe'.

Example 2
Input
["abc","world","xyz"]
Output
abc world xyz

Explanation: Step-by-step: 1. Sort the phrases lexicographically: ['abc', 'world', 'xyz']. 2. Remove spaces between phrases: 'abc world xyz'.

Constraints

  • Each phrase is at most 50 characters long.
  • The total number of phrases does not exceed 200.
Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free