2024-01-07发表2024-01-07更新LeetCode每日一题几秒读完 (大约67个字)0次访问383. 赎金信383. 赎金信 难度: easy 原始链接: https://leetcode.cn/problems/ransom-note 标签: 哈希 解法一: 哈希go12345678910111213func canConstruct(ransomNote string, magazine string) bool { countMap := make([]int, 26) for _, ch := range magazine { countMap[ch - 'a']++ } for _, ch := range ransomNote { if countMap[ch - 'a'] == 0 { return false } countMap[ch - 'a']-- } return true}383. 赎金信https://wuhunyu.top/leetcode/2024/01/ransom-note/index.html作者wuhunyu发布于2024-01-07更新于2024-01-07许可协议#哈希