Since we are not iterating n times just (n - k + 1) times so it should really be: (n - k +1) * k = kn -k^2 + k ?
nvm figured it out
I had the same question when I looked at it. Can you clarify why it’s O(n*k) and not O((n-k)*k)?
Since we are not iterating n times just (n - k + 1) times so it should really be: (n - k +1) * k = kn -k^2 + k ?
nvm figured it out
I had the same question when I looked at it. Can you clarify why it’s O(n*k) and not O((n-k)*k)?