Driver Code
int main ( ) { vector < vector < char > > board = { { ' A ' , ' B ' , ' C ' , ' E ' } , { ' S ' , ' F ' , ' C ' , ' S ' } , { ' A ' , ' D ' , ' E ' , ' E ' } } ; string word = " CFDASABCESEE " ; for ( int i = 0 ; i < board . size ( ) ; i ++ ) { for ( int j = 0 ; j < board [ 0 ] . size ( ) ; j ++ ) { if ( board [ i ] [ j ] == word [ 0 ] && checkWord ( board , word , 0 , i , j ) ) { cout << " True " << ' ' ; return 0 ; } } } cout << " False " << ' ' ; return 0 ; }