You are viewing a single comment's thread. Return to all comments →
for i in a: #top level for-loop g=i+k if g in a: #nested for-loop c+=1;
For each element in a you're performing another search through all of a. The (g in a) is definitely an O(n) operation.
Seems like cookies are disabled on this browser, please enable them to open this website
Pairs
You are viewing a single comment's thread. Return to all comments →
For each element in a you're performing another search through all of a. The (g in a) is definitely an O(n) operation.