3 ms·
Technically, your code runs in O(n^2), as O(n) is a part of O(n^2). Still, he should have accepted the more precise answer O(n).
by thomas2718 7y ago
Technically, your code runs in O(n^2), as O(n) is a part of O(n^2). Still, he should have accepted the more precise answer O(n).