Marking from front to back one by one will time out. After some thought, in certain cases the complexity is O(n^2).
However, marking from back to front is different – it is approximately O(n).
| |
Marking from front to back one by one will time out. After some thought, in certain cases the complexity is O(n^2).
However, marking from back to front is different – it is approximately O(n).
| |