Form a String from Array of Characters

You are given an array of strings and a single string as an argument. Return true if the single string can be formed by using any combination of strings from the array, false if not.


  • Must return either true or false

Example #1

solve(["pp", "le", "a", "j", "eow"], "apple")
> true

Example #2

solve(["pp", "le", "ap", "j", "eow"], "apple")
> false

The strings would form appple (ap + pp + le) which is close to the given string but has too many p's, so we return false.