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

NZEC error

$
0
0

This is my code :-

#!/usr/bin/python


import sys, os, string,linecache

def main():



    file2=open("out.txt",'w')

    no= linecache.getline("in.txt",1)

    for i in range(2,int(no)+2):
        #print i
        l1=linecache.getline("in.txt",i)
        l1=l1[:-1]
        #print l1
        l=len(l1)
        l=l-1
        if l%2==0:

            if  sorted(l1[0:l/2])==sorted(l1[l/2:l]):
                file2.write("Yes")
                file2.write("\n")
            else:
                file2.write("No")
                file2.write("\n")
        else:

                if sorted(l1[0:l/2])==sorted(l1[l/2+1:l]):
                    file2.write("Yes")
                    file2.write("\n")
                else:
                    file2.write("No")
                    file2.write("\n")


    file2.close()

sys.exit(main())

It is working perfectly fine on my local machine . I am new to code shef . It is giving me NZEC effor ... any idea what it is going the same ?


Viewing all articles
Browse latest Browse all 40121


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