Elnur
Feb 21, 2021

--

This article is well-written. But there is a mistake. You said that 2 different loop have O(n^2) time complexity in a result. But it is not. Each loop has O(n) time complexity and if we sum them up, we get O(2n) time complexity. So, we drop the constant and get O(n).

--

--