I have two (very long) lists. I want to find the sum of the minimum of each pair in the list. Eg, if
X = [2,3,4]
Y = [5,4,2]
then, the sum would be 2+3+2 = 7.
At the moment, I'm doing this by zipping the lists and using a list comprehension. My lists are X and Y:
mins = [min(x,y) for x,y in zip(X,Y)]
summed_mins = sum(mins)
This is causing serious runtime issues in my program. Is there a faster way to do this? List comprehensions are the fastest that I know of.