public boolean exist(char[][] board, String word) {
        if (board == null || board.length == 0 || word == null || word.length() == 0) {
            return false;
        }

        for (int i = 0; i < board.length; i++) {
            char[] rowArray = board[i];

            for (int j = 0; j < rowArray.length; j++) {
                if (search(board, i, j, word, 0, new HashMap<Integer, Boolean>())) {
                    return true;
                }
            }
        }

        return false;
    }