There exits 2D array. We need or find out whether a given string (”microsoft”) exits in the given matrix. The string can be vertical or horizontal or in snake form but not in diagonal.
mi..
…c.o..oft
…..r.s
For every element, check its entire neighbor element to get the match
Please refer this link

Leave a Reply
You must be logged in to post a comment.