Read the question, write TypeScript on the right, then Run or Check.
QuestionHint and solution stay closed until you open them
Two words; yes if anagrams ignore case.
Examples
Input
listen silent
Output
yes
Hint
- sort letters
Show correct code
Peek only after you have tried. You can still Check your own version.
const [a, b] = readLine().trim().split(/\s+/);
const norm = (s: string) => [...s.toLowerCase()].sort().join('');
console.log(norm(a) === norm(b) ? 'yes' : 'no');
main.tstsc · readLine() · Ctrl + Enter
ResultIdle
Run to see output. Check grades the tests.