Easy
Ransom Note
Easy
236 submissions
10 coins
+50 XP
Hash Table
String
Problem Description
Each letter in `magazine` can be used at most once. Return `true` if `ransomNote` can be spelled using letters from `magazine`.
**Example 1:**
```
Input: ransomNote = "a", magazine = "b"
Output: false
```
**Example 2:**
```
Input: ransomNote = "aa", magazine = "ab"
Output: false
```
**Example 3:**
```
Input: ransomNote = "aa", magazine = "aab"
Output: true
```
Constraints
- `1 <= ransomNote.length, magazine.length <= 10^5`
- Lowercase English letters only.
Need help?
Connect with expert programmers for real-time collaborative coding, video meetings, and whiteboard sessions via CodeConnect.
Video Call
Whiteboard
Live Coding
Screen Share