Bar and Foo
Asked at Meta · Coding Questions · Difficulty: Medium
You are given a list of strings (words) and a string s. Your task is to find the longest word in the list that can be constructed by deleting some characters of the string s (without re-arranging the other characters). If multiple words have the same length, you should choose the one that is smallest in lexicographical order. The given string s will have a length of at most 1000, the words will also have a maximum length of 50, and the number of words will not exceed 1000.
Loading the problem…
More Meta interview questions
- LLM conceptual questions
- Implement a Two-Hidden-Layer MLP with Backpropagation in NumPy
- Dot Product with Run-Length Encoded Vectors
- Count Lakes Wrapped by a Given Island
- Minimum Remove to Make Valid Parentheses
- LLM with Beam Search and Nucleus Sampling (Meta MSL)