Increasing Decreasing Sequences one Testcase Failing

which case i missed??

plz help

https://ide.codingblocks.com/s/242746 this is my code

Hey @anandprakash1091971, can you tell me which test case is failing ?

testcase 1 is falling

Okay. So I checked your code. It is giving correct results only on sequences that are like :

  1. Increasing only
  2. Decreasing and then increasing
  3. Decreasing only

But what about the case when the sequence is

  1. increasing and then decreasing

This is the main question I guess. Consider the sequence :

5
1
2
3
2
1

This should return true right ? Your code is returning false.

Hope this helps.
All the best :slight_smile:

Given an array S of size N , check if it is possible to split sequence into two sequences -
s1 to si and si+1 to sN such that first sequence is strictly decreasing and second is strictly increasing. Print true/false as output.

it should print false??

Yes I guess there is some ambiguity in the question. We are checking and I will revert back soon. You can continue with the rest of the course till then :slight_smile:

Hey @anandprakash1091971, I checked your code again. You have not handled that case when two adjacent numbers become the same. In case two adjacent numbers appear, you need to return the output as false.

Hope this helps.

thanks now it’s working :+1: