package
0.0.0-20241220224003-b7cf03a90b2b
Repository: https://github.com/szhou12/leetcode-go.git
Documentation: pkg.go.dev
# README
383. Ransom Note
Solution idea
-
用 HashMap 统计
magazine
中每个字母出现的个数,然后在看够不够ransomNote
来使用 -
优化: 用长度为26的数组 而不是 HashMap 来统计
Time complexity = $O(n)$