I think the question is wrong

In the problem statement, it is given that its an decr - incr seq.but in input and sample case it’s given as incr - decr seq.
Please check

Hi @Codarikh
You have to do the question according to the problem statement that is first sequence is strictly decreasing and second is strictly increasing. In the sample case first sequence is null while second sequence is 1 2 3 4 5.