Array push O(1), pop O(1), shift/unshift/splice O(n), slice, O(1)
SetMap add/delete O(1)
LinkedList add O(1) insert/delete O(1) two-way
Here is my solution: https://github.com/JSerZANP/leetCode_...
Hi I'm a JavaScript engineer who is not good at algorithms,
and currently practicing leetCode online. If you are interested, maybe we can learn together.