LeetCode 380. Insert Delete GetRandom O(1) | JSer - JavaScript & Algorithm

Опубликовано: 10 Октябрь 2024
на канале: JSer
315
5

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.