Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

NZEC Error: Python

$
0
0

def main():

n = int(raw_input())
initList = []
tempMax = 0

for i in range (0,n):
    initList.append(raw_input())

initList.sort()

i = 0
for i in range (0,n-1):
    l0 = len(initList[i])
    l1 = len(initList[i+1])
    k = 0
    while (initList[i][k]==initList[i+1][k] and k<l0 and k<l1):
        k+=1
    if (k>tempMax):
            tempMax = k
print(tempMax)

return 0;

main()

Well.. I tried everything.. removing the main() and running the code in Body also, still getting NZEC error. Please someone help me


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>