This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Is It Over Now? (Taylor Taylor Swift | |
"Slut!" (Taylor's Versi Taylor Swift | |
Now That We Don't Talk Taylor Swift | |
Say Don't Go (Taylor's Taylor Swift | |
I know it won't work Gracie Abrams | |
Out Of The Blue Jake Scott | |
Suburban Legends (Taylo Taylor Swift | |
Living My Best Life Ben Rector | |
Buy Dirt Jordan Davis & Lu | |
Feel Something Joshua Bassett |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function groupAnagrams(words) { | |
const groupedWords = words.reduce((obj, word) => { | |
const sortedWord = word.split('').sort().join('') | |
if (!obj[sortedWord]) { | |
obj[sortedWord] = [] | |
} | |
obj[sortedWord].push(word) | |
return obj | |
}, {}) |