Can someone explain the logic of the problem ?
Problem Set : Increasing Decreasing Sequence
Hello,
You are given a sequence of numbers.
you don’t have to split the sequence.
what you are required to do is to keep track of whether the sequence is:
strictly increasing (entirely) eg. [1,2,3,4]
strictly decreasing (entirely) eg. [5,3,2,0]
First strictly decreasing than strictly increasing eg. [5,3,1,4,6]
if yes,
print true
else,
print false
strict function: which do not contain the same number at consecutive positions i.e. same values cannot occur one after other.
example: [1, 1, 2] This not a strict function as there are two 1 at consecutive locations.
Hint: there should be no decrease in sequence if it once starts increasing i.e. first increasing than decreasing returns false. eg. [2,4,7,3,1] (not accepted)
Hope, this would help.
if you still have doubts, feel free to ask.
Give a like, if you are satisfied.
Please, mark it as resolved if you have doubt is solved.