LeetCode 02xx
LeetCode problems 200–299
LeetCode 02xx
| # | Problem | Difficulty | Time | Notes |
|---|---|---|---|---|
| 200 | Number of Islands | 🟡 Medium | 10m 21s | The problem gives us a two dimensional grid where each cell contain… |
| 201 | Bitwise AND of Numbers Range | 🟡 Medium | 1m 28s | The problem asks us to compute the bitwise AND of every integer in … |
| 202 | Happy Number | 🟢 Easy | 1m 19s | This problem asks us to determine whether a given positive integer … |
| 203 | Remove Linked List Elements | 🟢 Easy | 1m 48s | The problem asks us to remove every node from a singly linked list … |
| 204 | Count Primes | 🟡 Medium | 1m 27s | The problem asks us to count how many prime numbers exist that are … |
| 205 | Isomorphic Strings | 🟢 Easy | 2m 56s | The problem asks us to determine whether two strings, s and t, are … |
| 206 | Reverse Linked List | 🟢 Easy | 1m 6s | The problem asks us to reverse a singly linked list. A singly linke… |
| 207 | Course Schedule | 🟡 Medium | 1m 17s | This problem models course dependencies as a directed graph. Each c… |
| 208 | Implement Trie (Prefix Tree) | 🟡 Medium | 1m 14s | The problem asks us to design and implement a Trie, also called a P… |
| 209 | Minimum Size Subarray Sum | 🟡 Medium | 1m 17s | The problem gives us an array of positive integers called nums and … |
| 210 | Course Schedule II | 🟡 Medium | 1m 14s | This problem asks us to determine a valid order in which courses ca… |
| 211 | Design Add and Search Words Data Structure | 🟡 Medium | 3m 26s | The problem asks us to design a data structure that supports two op… |
| 212 | Word Search II | 🔴 Hard | 1m 39s | LeetCode 212, LeetCode Word Search II, asks us to find every word f… |
| 213 | House Robber II | 🟡 Medium | 1m 20s | This problem is a variation of the classic House Robber dynamic pro… |
| 214 | Shortest Palindrome | 🔴 Hard | 1m 8s | The problem gives a string s and asks us to create the shortest pos… |
| 215 | Kth Largest Element in an Array | 🟡 Medium | 3m 9s | The problem asks us to find the kth largest element in an unsorted … |
| 216 | Combination Sum III | 🟡 Medium | 2m 21s | This problem asks us to generate all unique combinations of exactly… |
| 217 | Contains Duplicate | 🟢 Easy | 2m 55s | The problem gives an integer array nums and asks whether any number… |
| 218 | The Skyline Problem | 🔴 Hard | 2m 23s | The Skyline Problem asks us to compute the visible outer contour fo… |
| 219 | Contains Duplicate II | 🟢 Easy | 2m 19s | The problem asks us to determine whether an array contains two equa… |
| 220 | Contains Duplicate III | 🔴 Hard | 3m 23s | The problem asks whether there exists a pair of different indices (… |
| 221 | Maximal Square | 🟡 Medium | 1m 25s | The problem gives us a two dimensional binary matrix where each cel… |
| 222 | Count Complete Tree Nodes | 🟢 Easy | 1m 21s | The problem asks us to count how many nodes exist in a complete bin… |
| 223 | Rectangle Area | 🟡 Medium | 1m 32s | The problem gives the coordinates of two axis-aligned rectangles on… |
| 224 | Basic Calculator | 🔴 Hard | 1m 38s | The problem gives us a string representing a mathematical expressio… |
| 225 | Implement Stack using Queues | 🟢 Easy | 2m 26s | The problem asks us to implement a stack data structure while using… |
| 226 | Invert Binary Tree | 🟢 Easy | 2m 53s | The problem gives the root node of a binary tree and asks us to inv… |
| 227 | Basic Calculator II | 🟡 Medium | 1m 21s | The problem gives us a string representing a mathematical expressio… |
| 228 | Summary Ranges | 🟢 Easy | 1m 6s | The problem gives us a sorted array of unique integers and asks us … |
| 229 | Majority Element II | 🟡 Medium | 2m 20s | The problem asks us to find every element in an integer array that … |
| 230 | Kth Smallest Element in a BST | 🟡 Medium | 1m 2s | This problem gives us the root of a Binary Search Tree, abbreviated… |
| 231 | Power of Two | 🟢 Easy | 51s | The problem asks us to determine whether a given integer n is a pow… |
| 232 | Implement Queue using Stacks | 🟢 Easy | 1m 22s | The problem asks us to implement a queue using only stack operation… |
| 233 | Number of Digit One | 🔴 Hard | 2m 2s | Given a non-negative integer n, we must count how many times the di… |
| 234 | Palindrome Linked List | 🟢 Easy | 2m 45s | The problem gives us the head of a singly linked list and asks whet… |
| 235 | Lowest Common Ancestor of a Binary Search Tree | 🟡 Medium | 1m 1s | The problem asks us to find the Lowest Common Ancestor, commonly ab… |
| 236 | Lowest Common Ancestor of a Binary Tree | 🟡 Medium | 2m 13s | The problem asks us to find the Lowest Common Ancestor, usually abb… |
| 237 | Delete Node in a Linked List | 🟡 Medium | 57s | This problem asks us to delete a node from a singly linked list, bu… |
| 238 | Product of Array Except Self | 🟡 Medium | 1m 4s | The problem gives an integer array nums, and for every index i, we … |
| 239 | Sliding Window Maximum | 🔴 Hard | 2m 34s | The problem gives us an integer array nums and a window size k. A s… |
| 240 | Search a 2D Matrix II | 🟡 Medium | 1m 16s | The problem asks us to determine whether a given integer target exi… |
| 241 | Different Ways to Add Parentheses | 🟡 Medium | 1m 12s | The problem gives us a mathematical expression as a string containi… |
| 242 | Valid Anagram | 🟢 Easy | 1m 16s | The problem asks us to determine whether two strings are anagrams o… |
| 243 | Shortest Word Distance | 🟢 Easy | 1m 17s | The problem gives us an array of strings called wordsDict, along wi… |
| 244 | Shortest Word Distance II | 🟡 Medium | 1m 25s | This problem asks us to design a reusable data structure that can e… |
| 245 | Shortest Word Distance III | 🟡 Medium | 1m 16s | The problem gives us an array of strings, wordsDict, and two target… |
| 246 | Strobogrammatic Number | 🟢 Easy | 58s | The problem asks us to determine whether a given numeric string rem… |
| 247 | Strobogrammatic Number II | 🟡 Medium | 2m 20s | The problem asks us to generate every strobogrammatic number of a g… |
| 248 | Strobogrammatic Number III | 🔴 Hard | 2m 19s | The problem asks us to count how many numbers within the inclusive … |
| 249 | Group Shifted Strings | 🟡 Medium | 2m 36s | The problem asks us to group strings that belong to the same cyclic… |
| 250 | Count Univalue Subtrees | 🟡 Medium | 1m 6s | The problem asks us to count how many subtrees in a binary tree are… |
| 251 | Flatten 2D Vector | 🟡 Medium | 1m 28s | The problem asks us to design an iterator that traverses a two dime… |
| 252 | Meeting Rooms | 🟢 Easy | 1m 3s | The problem provides a list of meeting intervals, where each interv… |
| 253 | Meeting Rooms II | 🟡 Medium | 5m 31s | The problem gives us a list of meeting intervals where each interva… |
| 254 | Factor Combinations | 🟡 Medium | 1m 20s | The problem asks us to generate every unique way to express a numbe… |
| 255 | Verify Preorder Sequence in Binary Search Tree | 🟡 Medium | 1m 25s | The problem gives an array of unique integers called preorder. This… |
| 256 | Paint House | 🟡 Medium | 1m 11s | The problem gives us a row of houses, where each house must be pain… |
| 257 | Binary Tree Paths | 🟢 Easy | 1m 17s | The problem asks us to return every path from the root of a binary … |
| 258 | Add Digits | 🟢 Easy | 1m 24s | The problem asks us to repeatedly transform a number by summing its… |
| 259 | 3Sum Smaller | 🟡 Medium | 1m 38s | The problem asks us to count how many distinct index triplets (i, j… |
| 260 | Single Number III | 🟡 Medium | 4m 36s | The problem gives an integer array nums where every value appears e… |
| 261 | Graph Valid Tree | 🟡 Medium | 1m 17s | The problem asks whether a given undirected graph forms a valid tre… |
| 262 | Trips and Users | 🔴 Hard | 1m 31s | This problem asks us to compute the daily cancellation rate for tax… |
| 263 | Ugly Number | 🟢 Easy | 1m 34s | The problem asks us to determine whether a given integer n is an ug… |
| 264 | Ugly Number II | 🟡 Medium | 1m 23s | The problem asks us to generate the sequence of ugly numbers and re… |
| 265 | Paint House II | 🔴 Hard | 1m 25s | The problem gives us a matrix called costs, where costs[i][j] repre… |
| 266 | Palindrome Permutation | 🟢 Easy | 1m 49s | The problem asks whether the characters of a given string can be re… |
| 267 | Palindrome Permutation II | 🟡 Medium | 1m 38s | The problem asks us to generate every unique palindrome that can be… |
| 268 | Missing Number | 🟢 Easy | 1m 20s | The problem gives an array nums containing n distinct integers. Eve… |
| 269 | Alien Dictionary | 🔴 Hard | 2m 28s | This problem asks us to reconstruct the ordering of characters in a… |
| 270 | Closest Binary Search Tree Value | 🟢 Easy | 1m 57s | The problem gives us the root of a Binary Search Tree, abbreviated … |
| 271 | Encode and Decode Strings | 🟡 Medium | 1m 51s | The problem asks us to design a reversible encoding system for a li… |
| 272 | Closest Binary Search Tree Value II | 🔴 Hard | 1m 30s | This problem asks us to find the k values in a Binary Search Tree, … |
| 273 | Integer to English Words | 🔴 Hard | 2m 32s | The problem asks us to convert a non-negative integer into its Engl… |
| 274 | H-Index | 🟡 Medium | 1m 17s | The problem gives an array called citations, where each element rep… |
| 275 | H-Index II | 🟡 Medium | 1m 5s | This problem asks us to compute a researcher's h-index from a sorte… |
| 276 | Paint Fence | 🟡 Medium | 58s | The problem gives us a fence with n posts and k available colors. E… |
| 277 | Find the Celebrity | 🟡 Medium | 2m 14s | This problem asks us to identify whether there is a "celebrity" amo… |
| 278 | First Bad Version | 🟢 Easy | 2m 28s | The problem gives us a sequence of product versions numbered from 1… |
| 279 | Perfect Squares | 🟡 Medium | 4m 47s | The problem asks for the minimum number of perfect square numbers w… |
| 280 | Wiggle Sort | 🟡 Medium | 1m 18s | The problem asks us to rearrange an integer array so that it follow… |
| 281 | Zigzag Iterator | 🟡 Medium | 1m 23s | The problem asks us to design an iterator that alternates between t… |
| 282 | Expression Add Operators | 🔴 Hard | 1m 30s | The problem gives us a numeric string num and an integer target. We… |
| 283 | Move Zeroes | 🟢 Easy | 1m 46s | The problem gives us an integer array nums and asks us to move ever… |
| 284 | Peeking Iterator | 🟡 Medium | 2m 44s | The problem asks us to extend the functionality of a standard itera… |
| 285 | Inorder Successor in BST | 🟡 Medium | 3m 5s | This problem asks us to find the in-order successor of a given node… |
| 286 | Walls and Gates | 🟡 Medium | 1m 23s | The problem gives us a 2D grid called rooms, where each cell repres… |
| 287 | Find the Duplicate Number | 🟡 Medium | 1m 38s | The problem gives us an integer array nums of length n + 1, where e… |
| 288 | Unique Word Abbreviation | 🟡 Medium | 6m 40s | The problem asks us to design a data structure that determines whet… |
| 289 | Game of Life | 🟡 Medium | 1m 20s | The problem asks us to simulate one iteration of Conway's Game of L… |
| 290 | Word Pattern | 🟢 Easy | 1m 10s | The problem gives two inputs: a pattern string and a space-separate… |
| 291 | Word Pattern II | 🟡 Medium | 4m 16s | The problem asks us to determine whether a given string s can be fo… |
| 292 | Nim Game | 🟢 Easy | 2m 19s | The problem describes a two-player game involving a single heap of … |
| 293 | Flip Game | 🟢 Easy | 2m 20s | This problem is asking us to simulate a single move in a simple two… |
| 294 | Flip Game II | 🟡 Medium | 1m 47s | This problem describes a two-player impartial game played on a stri… |
| 295 | Find Median from Data Stream | 🔴 Hard | 1m 33s | The problem asks us to design a data structure that continuously re… |
| 296 | Best Meeting Point | 🔴 Hard | 2m 19s | The problem gives us a two-dimensional binary grid where each cell … |
| 297 | Serialize and Deserialize Binary Tree | 🔴 Hard | 4m 52s | The problem asks us to design two complementary operations for a bi… |
| 298 | Binary Tree Longest Consecutive Sequence | 🟡 Medium | 3m 30s | The problem asks us to find the length of the longest consecutive s… |
| 299 | Bulls and Cows | 🟡 Medium | 1m 3s | The problem gives two strings, secret and guess, representing two n… |