search2D receives the word to look for char word[], the size of the word int wordSize, size
of the grid const int Size and the puzzle grid char grid[Size][Size]. The word size can be
between 2 and 23. You are NOT required to check for the validity of the word size.
search2D should look for the first letter in the word row by row. If it finds the first letter of the word
in the puzzle, it should look for the remaining of the word in the 8 directions from the south and goes
clockwise, i.e. south, south-west, west, north-west, north, north-east, east and lastly south-east. If
the word is found, the function should print the row and column location of the first letter of the
word and the direction of the word from that location. Row and column count starts from 0.
These are several tasks in one function; therefore you should implement these two helper functions
that search2D will call.
bool search1D(char word[], int wordSize, const int Size, char grid[Size][Size],
int row, int col, int rowDir, int colDir);
void printFoundLocation(int rowDir, int colDir);
search1D should receive the word in char word[], word size in int wordSize, size of grid in
const int Size and the puzzle grid in char grid[Size][Size], the row and column indices in
the grid of the first letter in the word in int row and int col, and the row and column direction
to look in int rowDir and int colDir. The function should return if it found the word in this
direction or not.
printFoundLocation should receive the direction in int rowDir and int colDir and prints the
direction equivalent to these two integers.
You are encouraged to use more functions in your code.
Although you are asked to only implement three functions, you will have to implement the entire
program to test your code on VS Code. We suggest you test your code with a small 2D array,
example 4 by 4 or 5 by 5 and small words of 2 or 3 letters