Simple solution
public boolean exist(char[][] board, String word) {\n        for (int i = 0; i < board.length; i++) {\n            for (int j = 0; j < board[i].length; j++) {\n
    public boolean exist(char[][] board, String word) {\n        for (int i = 0; i < board.length; i++) {\n            for (int j = 0; j < board[i].length; j++) {\n                if(exist(board, i, j, word, 0)) return true;\n            }\n        }\n        return false;\n    }\n\n    private boolean exist(char[][] board, int x, int y, String word, int start) {\n        if(start >= word.length()) return true;\n        if(x < 0 || x >= board.length || y < 0 || y >= board[0].length) return false;\n        if (board[x][y] == word.charAt(start++)) {\n            char c = board[x][y];\n            board[x][y] = '#';\n            boolean res = exist(board, x + 1, y, word, start) || exist(board, x - 1, y, word, start) ||\n            exist(board, x, y + 1, word, start) || exist(board, x, y - 1, word, start);\n            board[x][y] = c;\n            return res;\n        }\n        return false;\n    }
[]