Count Characters — JavaScript easy interview problem
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: `countCharacters(["cat","bt","hat","tree"], "atach")` → `6` (`"cat"` + `"hat"`).
Tags: hashmap, frequency
Practice this Strings problem free in the JS Interview Playground with automated tests and unlockable solutions.