find a string in a grid

P

puzzlecracker

Hi guys,

These are some MS questions which i encountered in a recent interview.
Hope it'll be helpfull to some of you.

#1. Given an n X m grid of characters. You are supposed to search for
a string with in this maze. The characters in the string need not be
alligned in a straight line. They just need to be holding adjusent
positiong.

eg

if this is a maze

a b d e f
r n a j u
g y m r l
e t i y u

The string namit should return a found(True "2,2 2,3 3,3 4,3 4,2" They
hold adjucent positions).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,655
Latest member
eizareri

Latest Threads

Top