Find String in 2D Array of Strings

You are given a two dimensional array containing arrays of single character strings and a single string as an argument. Return true if the argument string can be found across any of the arrays in any orientation, and false if not.

Requirements

  • Must return either true or false

Example #1

solve([["a","z","d"],["r","q","s"],["b","c","p"],["l","t","j"], ["abc"]])
> true

The "abc" string's characters can all be found in the arrays of single character strings, so we return true.

Example #2

solve([["a","z","d"],["r","q","s"],["b","c","p"],["l","t","j"], ["truck"]])
> true

The "truck" string's characters "t", "r" and "c" can be found but not "u" or "k" so we return false.