leetle

Daily challenge for 2025-06-18

169. Word Pattern

Write a function solve that determines if a string follows a given pattern. Each letter in the pattern corresponds to exactly one unique word in the string.

Example:
Input: pattern = "abba", s = "dog cat cat dog"
Output: True

Run this challenge interactively in Python or JavaScript when the app loads.