Not geting Q plz help me

sir i am not getting Q
plz help me
i saw the hint but i am not undetrstanding.
…
…
…
…
…
…

It says that a sequence can be of following cases :

  1. Only increasing sequence
  2. Only decreasing sequence
  3. Increasing and then decreasing sequence
  4. Decreasing and then increasing sequence

You have to write the code such that when your input sequence is any of 1,2,4…the output should be true. Else for case 3, the output should be false.
Also take care of the case when two consecutive numbers in the sequence appear to be the same. In this case again the output should false

You can use any of the loops according to your convenience.

Refer this for the approach Can you please tell me how to approach this question

1 Like


can u tell me where i am wrong?