class WordSearch {

  public boolean contains(char[][] wordSearch, String word) {
    validateInputData(wordSearch, word);

    for (int i = 0; i < wordSearch.length; i++) {
      for (int j = 0; j < wordSearch[i].length; j++) {
        if (matches(wordSearch, i, j, word.charAt(0))) {
          if (isWordInWordSearchInner(wordSearch, word, i, j)) {
            return true;
          }
        }
      }
    }

    return false;
  }

}