Competitive Programing Problem Solutions/Virtual Judge/Maruf Vai-1/n2.cpp
void patternSearch(char grid[R][C], string word)
{
    // Consider every point as starting point and search
    // given word
    for (int row = 0; row < R; row++)
       for (int col = 0; col < C; col++)
          if (search2D(grid, row, col, word))
             cout << "pattern found at " << row << ", "
                  << col << endl;
}
//  Searches given word in a given matrix in all 8 directions

Searches given word in a given matrix in all 8 directions
Searches given word in a given matrix in all 8 directions
void patternSearch(char grid[R][C], string word)
{
    for (int row = 0; row < R; row++)
       for (int col = 0; col < C; col++)
          if (search2D(grid, row, col, word))
             cout << "pattern found at " << row << ", "
                  << col << endl;
}
void patternSearch ( char grid [ R ] [ C ] , string word ) { for ( int row = 0 ; row < R ; row ++ ) for ( int col = 0 ; col < C ; col ++ ) if ( search2D ( grid , row , col , word ) ) cout << " " << row << " " << col << endl ; }
Searches given word in a given matrix in all 8 directions
Searches given word in a given matrix in all 8 directions
// Consider every point as starting point and search
 // given word
