Ransom Note

Easy · Hashing · about 5 minutes

Asked at Amazon, Microsoft, Google, Bloomberg, Meta, Apple, Rivian, Arm.

Given strings ransomNote and magazine of lowercase letters, return true if ransomNote can be built from the letters of magazine, using each magazine letter at most once.

Related guides