You are viewing a single comment's thread. Return to all comments →
generate_list function in Python would be:
def generate_list(A, B, n, m, x): L = [] for i in xrange(min(n, m - x)): for j in xrange((i + x), m): L.append(A[i]*B[j]) return L
Do I have to optimize this part as well? Or leave it as it is? I only passed 11 test cases using sort and heapq (I changed append to heappush).
Seems like cookies are disabled on this browser, please enable them to open this website
Kth Minimum
You are viewing a single comment's thread. Return to all comments →
generate_list function in Python would be:
Do I have to optimize this part as well? Or leave it as it is? I only passed 11 test cases using sort and heapq (I changed append to heappush).