leetle

Daily challenge for 2025-10-14

287. Find Words That Can Be Formed by Characters

You are given an array of strings words and a string chars. A string is good if it can be formed by characters from chars (each character can only be used once). Return the sum of lengths of all good strings in words.

Example:
Input: words = ["cat","bt","hat","tree"], chars = "atach"
Output: 6
Explanation: "cat" and "hat" can be formed, total length is 3 + 3 = 6

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