My code can be viewed in my github: Proverbs Github.
The following difficulty is defined by myself.

3sum-with-multiplicity(easy)

Similar to 3sum problem. Use map to count the multiplicity.

  • Time complexity: O(n^2).
  • Space complexity: O(100).

circular-array-loop(medium)

Bad description. [-2, 1, -1, -2, -2] returns false.
To be a loop, it must never change direction. In other words, the elements of the loop must all have the same sign, either all positive or all negative. If it reverses direction it is an oscillation rather than a loop.
Solution in O(1) space:
Mark nums[x] as (sign * size) when visiting.
Mark nums[x] as (2 * sign * size) after visiting.

  • Time complexity: O(n).
  • Space complexity: O(1).

compare-version-numbers(easy)

Split string to vector by points and compare from left to right.

  • Time complexity: O(length).
  • Space complexity: O(length).

design-hit-counter(easy)

Deque.

  • Time complexity: O(1).
  • Space complexity: O(n).

inorder-successor-in-bst(easy)

Do it during inorder traverse.

  • Time complexity: O(n).
  • Space complexity: O(1).

insert-interval(medium)

No need to binary search, can just scan from left to right and merge in the meanwhile.

  • Time complexity: O(n).
  • Space complexity: O(n).

minimum-size-subarray-sum(medium)

Two pointers. Maintain the sum between two pointers.
Followup: shortest-subarray-with-sum-at-least-k.

  • Time complexity: O(n).
  • Space complexity: O(1).

n-queens(medium)

DFS.

  • Time complexity: O(n^n).
  • Space complexity: O(n^2).

nested-list-weight-sum(easy)

DFS.

  • Time complexity: O(n).
  • Space complexity: O(1) except for stack space.

number-of-digit-one(medium)

Math. Consider how many numbers are there less than n if the i-th digit is 1.

  • Time complexity: O(#digits).
  • Space complexity: O(1).

shortest-subarray-with-sum-at-least-k(hard)

It is a typical problem. Mono-increasing deque extending from two pointers method.
For the right positions, (left, right], deque stores possible left pointers.
The trick is to pop back when there is a negative number.

  • Time complexity: O(n).
  • Space complexity: O(n).