noteCounts
to store the frequency of each character in the ransomNote
.magazineCounts
to store the frequency of each character in the magazine
.noteCounts
.
a. Check if the character is present in magazineCounts
.
b. If not, return false
.
c. If present, check if the count in magazineCounts
is less than the count in noteCounts
.
d. If less, return false
.true
.