Hey now you have just tripled the space complexity. From O(n) to 3*O(n). It's still considered O(n) but if you had only limited ram then the cost of swapping from the disk to the RAM would be noticable.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey now you have just tripled the space complexity. From O(n) to 3*O(n). It's still considered O(n) but if you had only limited ram then the cost of swapping from the disk to the RAM would be noticable.