Driver Code
public static void main ( String [ ] args ) { char [ ] [ ] board = { { ' A ' , ' B ' , ' C ' , ' E ' } , { ' S ' , ' F ' , ' C ' , ' S ' } , { ' A ' , ' D ' , ' E ' , ' E ' } } ; String word = " CFDASABCESEE " ; for ( int i = 0 ; i < board . length ; i ++ ) { for ( int j = 0 ; j < board [ 0 ] . length ; j ++ ) { if ( board [ i ] [ j ] == word . charAt ( 0 ) && checkWord ( board , word , 0 , i , j ) ) { System . out . println ( " True " ) ; return ; } } } System . out . println ( " False " ) ; } }