public boolean exist(char[][] board, String word) {
        // Note: The Solution object is instantiated only once and is reused by each test case.
		if (word.length() == 0)
			return false;
		
		int m = board.length;
		int n = board[0].length;
		marks = new int[m][n];
		
        for (int i = 0; i < m; i ++)
        	for (int j = 0; j < n; j++)
        		if(word.charAt(0) == board[i][j] && searchWord(board, i, j, word, 0) == true)
        				return true;
        return false;
    }