check whether a string is present in matrix grid (either horizonatal(left to
right), vertical(top to boottom) ,reverse horizonatal(right to left)
reverse vertical(bottom to top).
i think the question is clear.
first try to give solution for horizontal and vertical only, just give the
logic
--
Hey, Tell me if this assumption of the problem statement is correct..
String: ram
Matrix:
|r | a b
|a | g h
|m| j d
This is vertical and similar for its horizontal counter part...
So the logic is more than obvious,
For vertical (and horizontal), do a sub-string search column-wise and