Subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements Example : abc”, “abg”, “bdf”, “aeg”, ‘”acefg”, … etc are subsequences of “abcdefg”
Substring of a string S is another string S that occurs “in” S. Example : “the best” is a substring of “It was the best of times”.
There is a minor difference What you are referring to is substring but the problem says subsequence.
I actually whent throught this Article : Shortest Common Supersequence and was baffled when my code didn’t pass the testcases.
###PS: Geeks4Geeks is really helpful for Hard Problems and Competitive Programming
Hello,
me too, I have a code with the validation test A + C = AC not working. Anybody known how th debug a validation test, or the imput data for this test.
thanks a lot
I have a problem with one of the validators as well, namely, Example 3, but with the first two words nested. I’ve tried a bunch of combinations from Example 3 and everything seems to be correct. All of the other validators and tests pass smoothly. Any ideas?
(PS. I wish the names of validators would be more specific, since right now all the feedback I get is ‘something’s wrong! good luck trying to figure out what.’
Maybe cause most people fail at the A+C = AC one include it in the test cases so people can debug that one or see what is wrong with it. I’m one of those people who is failing at this one, and only this one, and it’s kinda frustrating to solve something where you can’t see your fault.
I had the exact same problem with A+C = AC test and solved it by changing a little thing (I ordered by length the testing of sequences that completly contains another).
So I think it should be as @Drahull said a time limit issue. Try to figure out a worst case for your algorithm with a lot of “A” “C” and “AC”.
Or maybe it has nothing to do with it and it fixed a small issue in my code, but as I tested many case I don’t think so.
EDIT:
Or not (see below), try with this : {A;C;AC} in this order.
Hi there.
Like @naruchaaan, I’m stuck with the “Example 3, but with the first two words nested”.
I’ve tried an input like this:
3
ACT
CT
ACTG
But does not seems to match the validator.
If the validator name could be more expressive (sorry for not being english native), we could find a way out.