pattern and text. Check whether text contains a run of consecutive characters made of exactly the same letters as pattern, in the same quantities, possibly in a different order.
Return True if such a run exists and False otherwise.pattern="tea", text="sweater" → True
The piece eat (positions 2–4) is a rearrangement of tea.
pattern="moon", text="lemonade" → False
lemonade has only one o, while moon needs two.
pattern="abc", text="ab" → False
pattern="tea", text="sweater"
True
Run checks the first 3 tests in your browser. Submit checks all 98 tests on the server, hidden ones included.