Type conversion in TypeScript
TypeScript
Medium
types
Task «Type conversion in TypeScript»
Write a function that takes a string containing integers separated by spaces. It is necessary to convert the string into an array of numbers, sort it in ascending order, and return a string containing the sorted numbers separated by commas. If there are no numbers in the input string, return an empty string. Constraints: the length of the string does not exceed 1000 characters, numbers are in the range from -10^9 to 10^9.
Input Format
One line containing integers separated by spaces.
Output Format
A string containing sorted numbers separated by commas. If there are no numbers, output an empty string.
Examples
Example 1
INPUT
7
1 1 2 3 3 3 4
OUTPUT
7
Example 2
INPUT
5
5 5 5 5 5
OUTPUT
5
main.ts