row-wise

CF

Matrix Find String Row-wise

A character matrix of size N*N and a string S are given as input.The program must check if the string is present in the matrix row-wise and…