package utils

func AreSlicesEqual(a, b []string) bool {
	if len(a) != len(b) {
		return false
	}

	counts := make(map[string]int)

	for _, elem := range a {
		counts[elem]++
	}

	for _, elem := range b {
		if count, ok := counts[elem]; !ok || count == 0 {
			return false
		}
		counts[elem]--
	}

	return true
}
