Given two strings ransomNote and magazine, return true if ransomNote can be built from the letters of magazine, and false otherwise. Each letter in magazine can be used at most once in ransomNote.
Given two strings ransomNote and magazine, return true if ransomNote can be built from the letters of magazine, and false otherwise. Each letter in magazine can be used at most once in ransomNote.
Example 1:
Input: {"ransomNote":"a","magazine":"b"}
Output: false
Constraints:
1≤ransomNote.length,magazine.length≤105
ransomNote and magazine consist of lowercase English letters.
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"ransomNote":"a","magazine":"b"}
Goal: cut the 1-letter note "a" out of the magazine "b", using each magazine letter at most once.