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

help in little chef and numbers why this code is giving time limit exceeded error

$
0
0

def fun(): test = input() test1 = int(test) for i in range(test1): num = input() num1= int(num) arr = input() arr1 = arr.split() arr1 = list(set(arr1)) le= len(arr1)-1 i,j=0,le count = 0 while(len(arr1)>1): if(i<j): m="int(arr1[i])*int(arr1[j])" add="int(arr1[i])+int(arr1[j])" if(m="">add): count+=1 j-=1 else: arr1.pop() j=len(arr1)-1

    print (count)

if name=='main': fun()


Viewing all articles
Browse latest Browse all 40121

Trending Articles



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