SOLUCIONES
LEETCODE.

Soluciones y análisis de dificultad Hard.

Problema Dificultad Complejidad Fecha
0315 Count of Smaller Numbers After Self Hard T: O(N log N) donde N es la longitud del arreglo / S: O(N) para el buffer temporal de mezcla y el rastreo de indices mar 2026
0321 Create Maximum Number Hard T: O(K * (M + N)) donde M y N son las longitudes de los dos arreglos / S: O(M + N) mar 2026
0327 Count of Range Sum Hard T: O(N log N) donde N es la longitud del arreglo / S: O(N) para el arreglo de sumas prefijo y el buffer de mezcla mar 2026
0329 Longest Increasing Path in a Matrix Hard T: O(M * N) donde M y N son las dimensiones de la matriz / S: O(M * N) mar 2026
0330 Patching Array Hard T: O(M + log N) donde M es la longitud de nums y N es el objetivo / S: O(1) mar 2026
0332 Reconstruct Itinerary Hard T: O(E log E) donde E es el numero de boletos / S: O(E) mar 2026
0335 Self Crossing Hard T: O(n) donde n es la longitud del arreglo de distancias / S: O(1) mar 2026
0336 Palindrome Pairs Hard T: O(N * K^2) / S: O(N * K) mar 2026
0352 Data Stream as Disjoint Intervals Hard T: O(log N) por addNum, O(N) por getIntervals, donde N es el numero de intervalos / S: O(N) mar 2026
0354 Russian Doll Envelopes Hard T: O(N log N) donde N es el numero de sobres / S: O(N) mar 2026
0363 Max Sum of Rectangle No Larger Than K Hard T: O(M^2 * N * log N) donde M es el numero de filas y N es el numero de columnas / S: O(N) mar 2026
0381 Insert Delete GetRandom O(1) Duplicates Allowed Hard T: O(1) amortizado por insert, remove y getRandom / S: O(N), donde N es el numero total de elementos en la coleccion mar 2026
0391 Perfect Rectangle Hard T: O(N) donde N es el numero de rectangulos / S: O(N) mar 2026
0403 Frog Jump Hard T: O(N^2) donde N es el numero de piedras / S: O(N^2) mar 2026
0407 Trapping Rain Water II Hard T: O(M * N * log(M * N)) donde M y N son las dimensiones de la matriz / S: O(M * N) mar 2026
0410 Split Array Largest Sum Hard T: O(N * log(S)) donde N es la longitud del arreglo y S es la suma de todos los elementos / S: O(1) mar 2026
0420 Strong Password Checker Hard T: O(N) donde N es la longitud de la contraseña / S: O(N) para almacenar las secuencias repetidas mar 2026
0432 All O`one Data Structure Hard T: O(1) por cada operacion inc, dec, getMaxKey y getMinKey / S: O(N), donde N es el numero de claves distintas en la estructura mar 2026
0440 K-th Smallest in Lexicographical Order Hard T: O(log(n)^2), donde n es el limite superior del rango / S: O(1) mar 2026
0446 Arithmetic Slices II - Subsequence Hard T: O(N^2), donde N es la longitud del arreglo / S: O(N^2), por los hash maps almacenados en cada indice mar 2026