-
Notifications
You must be signed in to change notification settings - Fork 0
/
a.py
32 lines (31 loc) · 770 Bytes
/
a.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
N = ['aaaaaaaaaaaaaaaaaaaaaa']
for b in N:
# Write Your Code Here
n=[]
i=0
while i < len(b)-2:
if i!=0:
if b[i]<=n[-1]:
i+=1
continue
if b[i]>=b[i+1]:
if b[i]>b[i+2]:
n.append(b[i+1])
else:
n.append(b[i])
i+=1
else:
n.append(b[i])
else:
if b[i]>=b[i+1]:
if b[i]>b[i+2]:
n.append(b[i+1])
else:
n.append(b[i])
i+=1
else:
n.append(b[i])
i+=1
if(b[i+1]>b[i]):
n.append(b[i])
n.append(b[i+1])