Ransom Note

Two strings are provided: a message to be assembled and a stock of available letters. Decide whether the message can be built by choosing letters from the stock, where each letter in the stock may be used at most as many times as it appears. Letters cannot be invented, letters cannot be reused beyond their count, and the order of the stock is irrelevant because only the multiset of characters matters.

Both strings consist of lowercase English letters. Repetition counts are what decide the answer: if the message needs n copies of a letter and the stock holds fewer than n, assembly is impossible regardless of how the other letters are arranged. If the message is empty, the answer is true; if the stock is empty and the message is not, the answer is false.

A frequency table over the 26 lowercase letters is the direct solution. Count the stock once, then walk the message and decrement the count for each character; a negative count at any moment means the message cannot be assembled. The work is linear in the combined length, and the table uses 26 counters. A variant asks whether the message is a subset of the stock as a multiset, which is the same computation, and a second variant reverses the direction by counting the message first and then verifying the stock covers every requirement.

Examples
Input: ["a","b"]
Output: false
Hints

Ransom Note

Two strings are provided: a message to be assembled and a stock of available letters. Decide whether the message can be built by choosing letters from the stock, where each letter in the stock may be used at most as many times as it appears. Letters cannot be invented, letters cannot be reused beyond their count, and the order of the stock is irrelevant because only the multiset of characters matters.