Read the question, write TypeScript on the right, then Run or Check.
QuestionHint and solution stay closed until you open them
Unique values ascending.
Examples
Input
3 1 3 2 1
Output
1 2 3
Hint
- [...new Set].sort
Show correct code
Peek only after you have tried. You can still Check your own version.
const nums: number[] = readLine().trim().split(/\s+/).map(Number);
console.log([...new Set(nums)].sort((a, b) => a - b).join(' '));
main.tstsc · readLine() · Ctrl + Enter
ResultIdle
Run to see output. Check grades the tests.