> For the complete documentation index, see [llms.txt](https://emmaguo100.gitbook.io/leetcode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://emmaguo100.gitbook.io/leetcode/06-02-2022-383.-ransom-note.md).

# 06/02/2022 383. Ransom Note

Method: similiar to the anagram question. First check if those two strings are equal. Then check if the first string is longer than the second one. Then use hashmap to put the character and frequency of second string. Then iterate the first string, check if the the frequency is 0, if not, decrement the frequency.

Time O(m) m is the length of the second string.

Space O(1)
