Xyz encrytion problrm

su and sv are same.
su and sv are neighboring characters
how can both simultaneously possible , can you please eloborate the problem statement

Hi

these two condition need not to be same at same time, their is OR between them , edge exit
if su and sv are same OR su and sv are neighboring characters

for a string you generate a graph as per above rules (each node is a character)

now given a graph you have to tell if a string is possible or not.

Hit like if you get it!
Cheers!

There is some problem in posting commnts