LeetCode 03xx

LeetCode problems 300–399

100 items

LeetCode 03xx

# Problem Difficulty Time Notes
300 Longest Increasing Subsequence 🟡 Medium 1m 18s The problem asks us to find the length of the longest strictly incr…
301 Remove Invalid Parentheses 🔴 Hard 2m 59s The problem asks us to remove the minimum number of invalid parenth…
302 Smallest Rectangle Enclosing Black Pixels 🔴 Hard 2m 44s This problem gives us a binary matrix where each cell contains eith…
303 Range Sum Query - Immutable 🟢 Easy 1m 22s The problem asks us to design a data structure that supports effici…
304 Range Sum Query 2D - Immutable 🟡 Medium 2m 23s The problem asks us to design a data structure that can efficiently…
305 Number of Islands II 🔴 Hard 1m 26s The problem gives us an initially empty m x n grid where every cell…
306 Additive Number 🟡 Medium 1m 24s The problem asks us to determine whether a given string of digits c…
307 Range Sum Query - Mutable 🟡 Medium 2m 22s The problem asks us to design a mutable range sum data structure. W…
308 Range Sum Query 2D - Mutable 🟡 Medium 2m 21s The problem asks us to design a mutable 2D range sum data structure…
309 Best Time to Buy and Sell Stock with Cooldown 🟡 Medium 6m 31s This problem asks us to maximize profit from stock trading under a …
310 Minimum Height Trees 🟡 Medium 7m 25s This problem gives us an undirected tree with n nodes labeled from …
311 Sparse Matrix Multiplication 🟡 Medium 1m 43s This problem asks us to multiply two matrices, but with an importan…
312 Burst Balloons 🔴 Hard 3m 25s The problem gives us an array nums, where each element represents a…
313 Super Ugly Number 🟡 Medium 3m 19s This problem asks us to find the nth number in a special sequence c…
314 Binary Tree Vertical Order Traversal 🟡 Medium 1m 11s The problem asks us to group the nodes of a binary tree by their ve…
315 Count of Smaller Numbers After Self 🔴 Hard 1m 19s The problem asks us to compute, for every element in the array, how…
316 Remove Duplicate Letters 🟡 Medium 1m 2s This problem asks us to construct a new string from the input strin…
317 Shortest Distance from All Buildings 🔴 Hard 51s The problem asks us to find the optimal location to build a house o…
318 Maximum Product of Word Lengths 🟡 Medium 1m 2s The problem gives us an array of lowercase English words. We need t…
319 Bulb Switcher 🟡 Medium 1m 9s The problem describes a sequence of n bulbs, all initially turned o…
320 Generalized Abbreviation 🟡 Medium 1m 3s This problem asks us to generate every possible generalized abbrevi…
321 Create Maximum Number 🔴 Hard 1m 29s This problem asks us to build the lexicographically largest possibl…
322 Coin Change 🟡 Medium 1m 9s The problem gives us an array called coins, where each element repr…
323 Number of Connected Components in an Undirected Graph 🟡 Medium 1m 15s The problem asks us to determine how many connected components exis…
324 Wiggle Sort II 🟡 Medium 1m 10s The problem asks us to rearrange an array so that it follows a stri…
325 Maximum Size Subarray Sum Equals k 🟡 Medium 1m 13s The problem asks us to find the longest contiguous subarray whose s…
326 Power of Three 🟢 Easy 1m 11s The problem asks us to determine whether a given integer n can be r…
327 Count of Range Sum 🔴 Hard 1m 15s This problem asks us to count how many subarrays have sums that fal…
328 Odd Even Linked List 🟡 Medium 1m 16s This problem asks us to reorder a singly linked list so that all no…
329 Longest Increasing Path in a Matrix 🔴 Hard 1m 33s The problem gives us a two-dimensional grid of integers called matr…
330 Patching Array 🔴 Hard 59s The problem gives us a sorted array of positive integers, nums, and…
331 Verify Preorder Serialization of a Binary Tree 🟡 Medium 1m 8s The problem gives us a string that represents the preorder serializ…
332 Reconstruct Itinerary 🔴 Hard 1m 4s The problem is asking us to reconstruct a flight itinerary given a …
333 Largest BST Subtree 🟡 Medium 1m 41s The problem gives us the root of an arbitrary binary tree and asks …
334 Increasing Triplet Subsequence 🟡 Medium 1m 13s The problem asks us to determine whether an array contains three nu…
335 Self Crossing 🔴 Hard 1m 17s The problem describes a path traced on a two-dimensional grid. We b…
336 Palindrome Pairs 🔴 Hard 1m 5s The problem gives us a list of unique strings called words. We must…
337 House Robber III 🟡 Medium 1m 3s This problem is a variation of the classic House Robber dynamic pro…
338 Counting Bits 🟢 Easy 1m 4s The problem asks us to compute the number of set bits, also called …
339 Nested List Weight Sum 🟡 Medium 1m 1s This problem gives us a special nested data structure called Nested…
340 Longest Substring with At Most K Distinct Characters 🟡 Medium 1m 1s The problem asks us to find the length of the longest contiguous su…
341 Flatten Nested List Iterator 🟡 Medium 1m 18s This problem asks us to design an iterator that can traverse a deep…
342 Power of Four 🟢 Easy 1m 10s This problem asks us to determine whether a given integer n is an e…
343 Integer Break 🟡 Medium 1m 37s The problem asks us to split a positive integer n into the sum of a…
344 Reverse String 🟢 Easy 1m 1s The problem asks us to reverse a string that is represented as an a…
345 Reverse Vowels of a String 🟢 Easy 57s The problem asks us to reverse only the vowels in a string while le…
346 Moving Average from Data Stream 🟢 Easy 50s The problem asks us to design a data structure that continuously re…
347 Top K Frequent Elements 🟡 Medium 1m 10s The problem asks us to return the k most frequently occurring eleme…
348 Design Tic-Tac-Toe 🟡 Medium 1m 22s The problem asks us to design a data structure that simulates an n …
349 Intersection of Two Arrays 🟢 Easy 1m 6s The problem gives us two integer arrays, nums1 and nums2, and asks …
350 Intersection of Two Arrays II 🟢 Easy 1m 6s The problem asks us to find the intersection of two integer arrays,…
351 Android Unlock Patterns 🟡 Medium 1m 25s The problem models the Android lock screen as a 3 x 3 grid containi…
352 Data Stream as Disjoint Intervals 🔴 Hard 1m 20s This problem asks us to process a stream of non-negative integers a…
353 Design Snake Game 🟡 Medium 1m 23s The problem asks us to design a mutable data structure that simulat…
354 Russian Doll Envelopes 🔴 Hard 1m 8s The problem gives a list of envelopes, where each envelope is repre…
355 Design Twitter 🟡 Medium 1m 29s This problem asks us to design a simplified version of a social med…
356 Line Reflection 🟡 Medium 1m 9s The problem gives us a collection of points on a 2D plane, where ea…
357 Count Numbers with Unique Digits 🟡 Medium 1m The problem asks us to count how many integers in the range 0 <= x …
358 Rearrange String k Distance Apart 🔴 Hard 1m 32s The problem gives us a string s and an integer k. We must rearrange…
359 Logger Rate Limiter 🟢 Easy 1m 6s The problem asks us to design a logging system that controls how fr…
360 Sort Transformed Array 🟡 Medium 1m 18s The problem gives us a sorted integer array nums and a quadratic tr…
361 Bomb Enemy 🟡 Medium 33s The problem presents an m x n matrix called grid where each element…
362 Design Hit Counter 🟡 Medium 1m 25s The problem asks us to design a data structure that tracks how many…
363 Max Sum of Rectangle No Larger Than K 🔴 Hard 1m 43s The problem asks us to find the rectangular submatrix whose sum is …
364 Nested List Weight Sum II 🟡 Medium 1m 36s The problem gives us a nested list structure where each element can…
365 Water and Jug Problem 🟡 Medium 1m 20s The problem gives us two water jugs with capacities x and y. We can…
366 Find Leaves of Binary Tree 🟡 Medium 1m 13s The problem asks us to repeatedly remove all leaf nodes from a bina…
367 Valid Perfect Square 🟢 Easy 1m 7s The problem asks us to determine whether a given positive integer n…
368 Largest Divisible Subset 🟡 Medium 1m 27s The problem gives us an array of distinct positive integers and ask…
369 Plus One Linked List 🟡 Medium 47s The problem requires us to add one to a non-negative integer that i…
370 Range Addition 🟡 Medium 1m 26s The problem gives us an initially zero-filled array of size length.…
371 Sum of Two Integers 🟡 Medium 1m The problem asks us to compute the sum of two integers without usin…
372 Super Pow 🟡 Medium 1m 18s The problem asks us to compute: The complication is that the expone…
373 Find K Pairs with Smallest Sums 🟡 Medium 1m 28s The problem gives us two sorted integer arrays, nums1 and nums2, an…
374 Guess Number Higher or Lower 🟢 Easy 1m 13s The problem describes a classic interactive guessing game. A hidden…
375 Guess Number Higher or Lower II 🟡 Medium 34s This problem is a variant of the classic number guessing game with …
376 Wiggle Subsequence 🟡 Medium 1m 9s The problem asks us to find the length of the longest subsequence i…
377 Combination Sum IV 🟡 Medium 1m 15s The problem gives us an array of distinct positive integers called …
378 Kth Smallest Element in a Sorted Matrix 🟡 Medium 1m 18s The problem gives us an n x n matrix where both rows and columns ar…
379 Design Phone Directory 🟡 Medium 1m 11s The problem asks us to design a data structure that manages a fixed…
380 Insert Delete GetRandom O(1) 🟡 Medium 1m 19s This problem asks us to design a custom data structure called Rando…
381 Insert Delete GetRandom O(1) - Duplicates allowed 🔴 Hard 1m 28s The problem asks us to design a data structure called RandomizedCol…
382 Linked List Random Node 🟡 Medium 1m 19s The problem gives us the head of a singly linked list and asks us t…
383 Ransom Note 🟢 Easy 1m 12s This problem asks whether it is possible to construct the string ra…
384 Shuffle an Array 🟡 Medium 1m 15s The problem asks us to design a data structure that supports two op…
385 Mini Parser 🟡 Medium 1m 32s The problem gives us a string representation of a nested integer st…
386 Lexicographical Numbers 🟡 Medium 1m 22s The problem asks us to generate all integers from 1 to n, but not i…
387 First Unique Character in a String 🟢 Easy 1m 1s The problem gives us a string s consisting only of lowercase Englis…
388 Longest Absolute File Path 🟡 Medium 1m 27s The problem gives us a string representation of a file system hiera…
389 Find the Difference 🟢 Easy 47s This problem gives us two strings, s and t. The string t is created…
390 Elimination Game 🟡 Medium 1m 6s The problem gives us a sorted list containing every integer from 1 …
391 Perfect Rectangle 🔴 Hard 1m 33s This problem asks whether a collection of smaller axis-aligned rect…
392 Is Subsequence 🟢 Easy 1m 8s The problem asks whether string s can be formed from string t by de…
393 UTF-8 Validation 🟡 Medium 1m 4s The problem asks us to determine whether a sequence of integers rep…
394 Decode String 🟡 Medium 1m 15s The problem gives us a string that contains encoded patterns of the…
395 Longest Substring with At Least K Repeating Characters 🟡 Medium 1m 14s The problem asks us to find the length of the longest substring in …
396 Rotate Function 🟡 Medium 1m 19s The problem defines a special value called the rotation function fo…
397 Integer Replacement 🟡 Medium 1m 19s The problem gives us a positive integer n and asks for the minimum …
398 Random Pick Index 🟡 Medium 1m 11s The problem gives us an integer array nums that may contain duplica…
399 Evaluate Division 🟡 Medium 1m 24s This problem gives us a collection of equations between variables, …