Ctrl K

Note From Clipped Letters

Easy
You want to put together a note message by cutting letters out of an old newspaper. All the letters you managed to cut out are listed in the string clippings. Each clipped letter can be glued down only once, and the order of letters in clippings does not matter. Return True if these letters are enough to assemble the whole note, and False otherwise.
Example 1
message='tea', clippings='aetherial' → True

The clippings contain a "t", an "e" and an "a", at least one of each.

Example 2
message='book', clippings='bok' → False

The word needs two "o"s, but the clippings only have one.

Example 3
message='zz', clippings='zaz' → True

The clippings have two "z"s; the extra "a" does no harm.

Constraints
  • 1 ≤ message.length, clippings.length ≤ 10⁵
  • Both strings consist of lowercase English letters only
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsFirst One-Off Letter EasyWords Heard Only Once EasyWords From Letter Tiles EasyBalloon Signs From Letters EasyLetters Up and Down Easy
loading Python…
Input
message='tea', clippings='aetherial'
Expected
True

Run checks the first 3 tests in your browser. Submit checks all 139 tests on the server, hidden ones included.