If the number of iterations is known beforehand; use a for loop instead of while. (Example: working with two arrays)
if a < b: a = b # a lot faster than using max a = max(a, b)
Merging sorted arrays is faster using sort due to the very clever timsort algorythm in python.
ios::sync_with_stdio(false); cin.tie(NULL);
There was an error while loading. Please reload this page.