https://www.codechef.com/viewsolution/27946925
i dont know why its giving wrong answer.
Consider the testcase:
2
3
1 2 3
2
1 2
3
1 2 3
2
1 5
1 Like
can you now tell me. output is correct
answer is correct here “no”
The correct answer is Yes
:
1 2 3 4 5 6
| | |
2 4 6
It’s a very badly-written question, but you need to tell whether the second sequence occurs as a subsequence of the first sequence, not a sub"string".
OMG SUBSTRING NEED NOT BE CONTIGUOS??
1 Like
Yep - like I said, a really badly-written question XD
1 Like
thankyou lol
1 Like
Bad test cases too; it looks like programs succeed even if they don’t care about the ordering of the desired sequence.
And if that’s what was intended, the question is even worse. But in fact a program that requires the favorite sequence to be in order also succeeds, so I suspect there just isn’t a test case which has all the favorite sequence but not in the right order.
1 Like