0383 - Ransom Note
Last updated
Last updated
Given two stings ransomNote and magazine, return true if ransomNote can be constructed from magazine and false otherwise.
Each letter in magazine can only be used once in ransomNote.
Input: ransomNote = "a", magazine = "b" Output: false
Input: ransomNote = "aa", magazine = "ab" Output: false
Input: ransomNote = "aa", magazine = "aab" Output: true
1 <= ransomNote.length, magazine.length <= 105 ransomNote and magazine consist of lowercase English letters.