Select Git revision
-
Sivakumaran authoredSivakumaran authored
p2.txt 495 B
1.
dict={}
for i inorigItems:if not in dict then adddict[i
for i in items:
if(dict[i]-price[i])!=0:ans++
print ans
2.
i=len(pre)-2
while i>0:
y=pre[i:]
if(text startswith(y)):length=len(y)
if(length<=len(pre):
max1=length
string1=y
i=0
while i<len(suffix):
y=suffix[:i]
if(text endswith(y)):length=len(y)
if(length<=len(pre):
max2=length
string2=y
summ=max1+max2
ans=[]
while i<=len(text):
y=text[:i]
if(text startswith(string1) and text endswith(y)):ans.append(y)
y.sort()
return y[0]