TestTrial's blog

By TestTrial, history, 3 years ago, In English

I've spent quite some time figuring out why is it that for problem (8A - Train and Peter), instead of "forward" at test 14, my output is "both", but to no avail. Since the entire string is hidden and I am shown just a part of it, it's quite hard to understand where the mistake could be. Here is my submission: 95835050. Thank you in advance. Edit: Some flaws fixed but no real result yet 95837954

  • Vote: I like it
  • +10
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Consider input:

abcdefgh
abc
ab

you print both even though the answer is fantasy.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks for the hint, i added the condition (strstr(v,a1)!=rstrstr(v,a1) || strstr(v,a2)!=rstrstr(v,a2)), still no progress on test 14 though

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Can you write down the condition for a pattern to be possible forward? (ignore backward for now)