Given a list of strings words and a string chars, find the sum of the lengths of
Fantastic news! We've Found the answer you've been seeking!
Question:
Given a list of strings words and a string chars, find the sum of the lengths of all strings in words that can be formed using the letters in chars. Each character in chars can only be used once.
For example, given words = ["cat", "bt", "hat", "tree"] and chars = "atach", the solution should return 6, since the strings "cat" and "hat" can be formed using the letters in chars.
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date: