-
Notifications
You must be signed in to change notification settings - Fork 0
/
coneven.py
52 lines (38 loc) · 1.05 KB
/
coneven.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Dynamic-programing
stre = "aaabbbccbbdccde"
# stre = "dde"
b = list(stre)
n = list(stre)
def ret(data,temp):
i = j = count = 0
while i <= len(temp):
k = i
print(data[j]+" "+temp[i]+" "+str(j)+" "+str(i))
if data[j] == temp[i]:
count+=1
print("Count="+str(count))
i+=1
else:
print("Inside Else")
if count%2 == 0:
print("Inside if even")
print(data)
del data[j:j+count]
if(data[j] == data[j-1]):
j = data.index(temp[j])
if(len(data)==1):
return data
break
count = 0
j = data.index(temp[i])
i = k
else:
print("Inside if odd")
i = k
j = data.index(temp[i])
print("Printing i j")
print(i)
print(j)
count = 0
return data
print(ret(b,n))