Solución
solution.tsTypeScript
package main
func isAnagram(firstWord string, secondWord string) bool {
if len(firstWord) != len(secondWord) {
return false
}
frecuencias := make(map[rune]int)
for _, word := range firstWord {
frecuencias[word]++
}
for _, word := range secondWord {
frecuencias[word]--
if frecuencias[word] < 0 {
return false
}
}
return true
}0respuestas