Input
l1=[1,3,5,6,7]
l2=[1,2,2,3,4]
l3=[5,4,3,2,1]
l4=[5,5,3,2,1]
l5=[1,2,3,4.1,3,2]
l6=[3,2,1,0.4,1,2,3]
l7=[1,2,10,4,8,9,2]
l8=[1,2,3,4,4,3,2,1]
l9=[-0.05701686, 0.57707936, -0.34602634, -0.02599778]
l10=[ 0.13556905, 0.45859 , -0.34602634, -0.09178798, 0.03044908]
l11=[-0.38643975, -0.09178798, 0.57707936, -0.05701686, 0.00649252]
Notice: The value in sequence is float.
Expected
- Write a function
find_targeted_seq
that returns a sequence whether is strictly monotonically or there is one turning point where both sides are strictly monotonically.For example,l1
,l3
,l5
,l6
are expected.
Try
- Pandas API could solve strictly monotonically.,but I don't know how to solve there is one turning point, especially excluding
l8
.
from How to check a sequence is strictly monotonically or there is one turning point where both sides are strictly monotonically?
No comments:
Post a Comment