DSA Problems

598+ hand-picked problems with detailed explanations, multiple approaches, and code in Java, Python, C++ & JavaScript.

🔍
Showing 598 of 598 problems
Num
Title
Difficulty
1
Determine If an Array Is Already Sorted
Easy
2
Find a Pair That Sums to a Target in a Sorted Array
Easy
3
Find Largest Element in an Array
Easy
4
Find Second Largest Element in an Array
Easy
5
Find the Missing Number in a Sequence
Easy
6
Merge Two Sorted Arrays Into the First Array In Place
Easy
7
Produce the Sorted List of Squared Values
Easy
8
Remove Repeated Values from a Sorted Array
Easy
9
Replace Each Element with the Maximum Element to Its Right
Easy
10
Reverse an Array
Easy
11
Shift All Zeros to the End of the Array
Easy
12
Cyclically Shift an Array by K Steps
Medium
13
Find the Repeated Number in an Array
Medium
14
Find the Triplet Sum Nearest to a Target Value
Medium
15
List Every Unique Quadruplet That Sums to a Target
Medium
16
List Every Unique Triplet That Sums to Zero
Medium
17
Maximum Water Trapped Between Two Vertical Lines
Medium
18
Minimum Rescue Boats Needed Under a Weight Limit
Medium
19
Sort an Array Containing Only 0s, 1s, and 2s
Medium
20
Total Rainwater Trapped Across an Elevation Map
Hard
21
Two Sum
Hard
22
Check If a Sentence Reads the Same Ignoring Case and Symbols
Easy
23
Valid Anagram
Easy
24
Valid Parentheses
Easy
25
Maximum Sum Subarray of Size K
Medium
26
Longest Run of Consecutive Ones
Easy
27
Longest Run of Ones After K Flips
Medium
28
Count Subarrays With Product Less Than K
Medium
29
Longest Subarray With At Most Two Distinct Values
Medium
30
Smallest Subarray With Sum At Least Target
Medium
31
Check If a String Contains a Permutation of Another
Medium
32
Maximum of Every Sliding Window of Size K
Hard
33
Cumulative Sum of an Array
Easy
34
Answer a Range Sum Query on an Array
Easy
35
Find the Equilibrium Index of an Array
Easy
36
Longest Subarray With Sum Equal to K
Medium
37
Count Subarrays Summing to K
Medium
38
Product of All Elements Except Self
Medium
39
Largest Sum of Any Contiguous Subarray
Medium
40
Largest Product of Any Contiguous Subarray
Medium
41
Largest Sum Subarray in a Circular Array
Hard
42
Maximum Profit From One Buy and One Sell
Easy
43
Check If an Array Contains Any Duplicate
Easy
44
Length of the Longest Run of Consecutive Numbers
Medium
45
Find the Element Appearing More Than Half the Time
Easy
46
Find All Elements Appearing More Than a Third of the Time
Medium
47
List Every Number That Appears Twice
Medium
48
Sum of Both Diagonals of a Square Matrix
Easy
49
Transpose of a Matrix
Easy
50
Zero Out Rows and Columns Containing a Zero
Medium
51
Traverse a Matrix in Spiral Order
Medium
52
Rotate a Square Matrix 90 Degrees Clockwise
Medium
53
Reverse a String In-Place
Easy
54
Length of the Last Word in a Sentence
Easy
55
Longest Common Prefix of an Array of Strings
Easy
56
Reverse the Order of Words in a Sentence
Medium
57
Add Two Binary Strings
Easy
58
Compress a String Using Run-Length Encoding
Medium
59
Multiply Two Numbers Represented as Strings
Hard
60
Convert a Roman Numeral to an Integer
Medium
61
Remove the Outermost Parentheses From Every Primitive Group
Easy
62
Check If One String Is a Rotation of Another
Easy
63
Find the First Non-Repeating Character in a String
Easy
64
Group Strings That Are Anagrams of Each Other
Medium
65
Check if Two Strings Are Isomorphic
Easy
66
Sort Characters of a String by Frequency
Medium
67
Longest Substring With All Unique Characters
Medium
68
Find All Starting Indices of Anagrams in a String
Medium
69
Longest Substring After At Most K Character Replacements
Medium
70
Smallest Window Containing All Characters of Another String
Hard
71
Palindrome After Deleting At Most One Character
Easy
72
Check If a String Is a Subsequence of Another String
Easy
73
Reverse Only the Vowels of a String
Easy
74
Compare Strings After Simulating Backspace Characters
Easy
75
Build a Linked List From an Array of Values
Easy
76
Insert a Node at the Beginning of a Linked List
Easy
77
Insert a Node at the End of a Linked List
Easy
78
Insert a Node at a Given Position in a Linked List
Medium
79
Delete the First Node of a Linked List
Easy
80
Delete a Node at a Given Position in a Linked List
Medium
81
Delete the Last Node of a Linked List
Medium
82
Search for a Value in a Linked List
Easy
83
Traverse a Linked List and Collect Its Values
Easy
84
Find the Length of a Linked List
Easy
85
Find the Middle Node of a Linked List
Easy
86
Detect a Loop in a Linked List
Easy
87
Find the First Node of a Loop in a Linked List
Medium
88
Remove a Loop in a Linked List
Medium
89
Find the Kth Node From the End of a Linked List
Easy
90
Remove the Nth Node From the End of a Linked List
Medium
91
Delete the Middle Node of a Linked List
Medium
92
Merge Two Sorted Linked Lists Into One
Easy
93
Remove Duplicate Values From a Sorted Linked List
Easy
94
Remove All Nodes With Duplicate Values From a Sorted List
Medium
95
Sort the Nodes of a Linked List
Medium
96
Merge K Sorted Linked Lists Into One
Hard
97
Find the Node Where Two Linked Lists Intersect
Easy
98
Reverse a Sublist of a Linked List
Medium
99
Pairwise Swap Nodes in a Linked List
Medium
100
Rotate a Linked List to the Right
Medium
101
Check if a Linked List Is a Palindrome
Easy
102
Reorder a Linked List
Medium
103
Reverse a Linked List in Groups of K
Hard
104
Locate a Value's Position in a Sorted Array
Easy
105
Compute the Floor of a Number's Square Root
Easy
106
Find Where a Value Belongs in a Sorted Array
Easy
107
Find a Value in an Array Rotated at an Unknown Pivot
Medium
108
Find a Value in a Rotated Sorted Array That May Contain Duplicates
Medium
109
Find the Smallest Element After a Sorted Array Is Rotated
Medium
110
Find Any Local Maximum in an Array
Medium
111
Find the Lower Bound of a Target in a Sorted Array
Easy
112
Find the Upper Bound of a Target in a Sorted Array
Easy
113
Find the Start and End Indices of a Target in a Sorted Array
Medium
114
Count How Many Times a Number Appears in a Sorted Array
Easy
115
Find the Floor and Ceiling of a Number in a Sorted Array
Easy
116
Find a Value in a Matrix Sorted Like a Flattened Array
Medium
117
Find a Value in a Matrix With Sorted Rows and Columns
Medium
118
Find the Row Containing the Most 1s in a Binary Matrix
Medium
119
Find Any Local Maximum in a 2D Matrix
Hard
120
Find the Median of All Elements in a Row-Sorted Matrix
Hard
121
Increment a Number Stored as a Linked List
Easy
122
Add Two Numbers Stored in Reverse Order
Medium
123
Add Two Numbers Stored in Forward Order
Medium
124
Find the Next Greater Value for Each Node in a Linked List
Medium
125
Remove Nodes With a Greater Value Somewhere to Their Right
Medium
126
Find All Divisors of a Number
Easy
127
Prime Factorization of a Number
Easy
128
Power of a Number, Modulo 10⁹ + 7
Medium
129
Count Prime Numbers — Sieve of Eratosthenes
Medium
130
Power Set of an Array
Medium
131
Subsets With Duplicates
Medium
132
Partition to K Equal Sum Subsets
Hard
133
Single Number
Easy
134
Single Number II
Medium
135
Single Number III
Medium
136
Find the Two Numbers Appearing Odd Number of Times
Easy
137
XOR of Numbers from L to R
Easy
138
Sum of Subset XOR Totals
Easy
139
Subarray XOR Queries
Medium
140
Maximum XOR of Two Numbers in an Array
Medium
141
Maximum XOR With an Element From Array
Hard
142
Check if the i-th Bit is Set or Not
Easy
143
Check if a Number is Odd or Even
Easy
144
Set / Unset the Rightmost Unset Bit
Easy
145
Count Number of Set Bits / Hamming Weight
Easy
146
Check if a Number is Power of 2
Easy
147
Count Bits to Convert A to B
Easy
148
Swap Two Numbers
Easy
149
Divide Two Integers Without Multiplication, Division or Mod
Medium
150
Missing Number
Easy
151
Alternating Bit
Easy
152
Implement Trie (Prefix Tree)
Medium
153
Implement Trie II — Advanced Operations
Medium
154
Add and Search Word
Medium
155
Longest Word in Dictionary
Medium
156
Search Suggestions System
Medium
157
Word Break
Medium
158
Replace Words
Medium
159
Concatenated Words
Hard
160
Number of Distinct Substrings
Medium
161
Longest String with All Prefixes
Medium
162
House Robber III
Medium
163
Maximum Rectangle Area with All 1s
Hard
164
Count Square Submatrices with All Ones
Medium
165
Scramble String
Hard
166
Matrix Chain Multiplication
Hard
167
Minimum Cost to Cut a Stick
Hard
168
Burst Balloons
Hard
169
Boolean Parenthesization
Hard
170
Palindrome Partitioning II
Hard
171
Partition Array for Maximum Sum
Medium
172
Minimum Cost to Merge Stones
Hard
173
Best Time to Buy and Sell Stock II
Medium
174
Best Time to Buy and Sell Stock III
Hard
175
Best Time to Buy and Sell Stock IV
Hard
176
Best Time to Buy and Sell Stock with Cooldown
Medium
177
Best Time to Buy and Sell Stock with Transaction Fee
Medium
178
Longest Common Subsequence
Medium
179
Print Longest Common Subsequence
Medium
180
Longest Common Substring
Medium
181
Longest Palindromic Subsequence
Medium
182
Minimum Insertions to Make String Palindrome
Medium
183
Minimum Insertions / Deletions to Convert String
Medium
184
Shortest Common Supersequence
Hard
185
Distinct Subsequences
Hard
186
Edit Distance
Medium
187
Wildcard Matching
Hard
188
Regular Expression Matching
Hard
189
Longest Increasing Subsequence
Medium
190
Print Longest Increasing Subsequence
Medium
191
Largest Divisible Subset
Medium
192
Longest String Chain
Medium
193
Longest Bitonic Subsequence
Medium
194
Number of Longest Increasing Subsequences
Medium
195
Climbing Stairs
Easy
196
Frog Jump
Easy
197
Frog Jump with K Distances
Medium
198
House Robber
Medium
199
House Robber II
Medium
200
Decode Ways
Medium
201
Subset Sum
Medium
202
Count Subsets with Sum K
Medium
203
Partition Equal Subset Sum
Medium
204
Partition Set Into 2 Subsets with Min Absolute Sum Diff
Medium
205
Count Partitions with Given Difference
Medium
206
0/1 Knapsack
Medium
207
Coin Change
Medium
208
Coin Change II
Medium
209
Target Sum
Medium
210
Unbounded Knapsack
Medium
211
Rod Cutting
Medium
212
Unique Paths
Medium
213
Unique Paths II
Medium
214
Minimum Path Sum
Medium
215
Triangle
Medium
216
Minimum Falling Path Sum
Medium
217
Maximum Path Sum in Grid
Medium
218
Ninja and His Friends
Hard
219
Dungeon Game
Hard
220
Cherry Pickup
Hard
221
Reverse a Linked List
Easy
222
Clone Linked List with Random Pointer
Medium
223
Odd-Even Linked List
Medium
224
Partition List
Medium
225
Flattening a Linked List
Hard
226
Build a Doubly Linked List from an Array of Values
Easy
227
Insert a Node in a Doubly Linked List
Easy
228
Delete a Node in a Doubly Linked List
Easy
229
Reverse a Doubly Linked List
Easy
230
Delete All Occurrences of a Key in a Doubly Linked List
Easy
231
Remove Duplicates from a Sorted Doubly Linked List
Easy
232
Find Pairs with a Given Sum in a Doubly Linked List
Medium
233
Flatten a Multilevel Doubly Linked List
Hard
234
Insertion Sort
Easy
235
Bubble Sort
Easy
236
Selection Sort
Easy
237
Merge Sort
Medium
238
Quick Sort
Medium
240
Top K Frequent Elements
Medium
241
Task Scheduler
Medium
242
Hand of Straights
Medium
243
4Sum II
Medium
244
Count Number of Bad Pairs
Medium
245
Word Pattern
Easy
246
LRU Cache
Medium
247
Insert Delete GetRandom O(1)
Medium
248
Find the Slowest Reading Speed That Still Finishes All Books in Time
Medium
249
Minimum Wait Days to Harvest Flower Bundles
Medium
250
Find the Smallest Batch Size That Keeps Total Processing Rounds Within a Limit
Medium
251
Minimum Load Capacity to Deliver Parcels Within a Deadline
Medium
252
Find the Kth Positive Integer Missing From a Sorted Array
Easy
253
Place Sensors on a Track to Maximize the Smallest Gap Between Them
Hard
254
Place Chargers in Baskets to Maximize the Minimum Distance Between Them
Medium
255
Split a Manuscript's Chapters Among Editors to Minimize the Heaviest Assignment
Hard
256
Divide a Playlist Into K Segments to Minimize the Longest Segment's Total Duration
Hard
257
Assign Wall Boards to Painters to Minimize the Slowest Painter's Time
Hard
258
Add K Streetlights at Integer Positions to Minimize the Longest Dark Stretch
Hard
259
Find the Integer Nth Root of a Number (or Report It Doesn't Exist)
Medium
260
Minimum Integer Speed to Cross All Segments Before a Deadline
Medium
261
Double the Median When Merging Two Sorted Price Lists
Hard
262
Kth Smallest Reading When Merging Two Sorted Sensor Logs
Medium
263
Implement a Stack Using a Resizable Array
Easy
264
Implement a Stack Using a Singly Linked List
Easy
265
Implement a Stack Using Two Queues
Easy
266
Implement a Queue Using Two Stacks
Easy
267
Minimum Insertions to Balance a Bracket String
Medium
268
Nested Bracket Score Calculation
Medium
269
Balanced Bracket Check With Wildcard Characters
Medium
270
Longest Balanced Bracket Substring
Hard
271
Replay a Score Log With Undo and Combine Commands
Easy
272
Collapse Adjacent Duplicate Letters
Easy
273
Resolve a Simplified Absolute File Path
Medium
274
Decode a Run-Length Nested Encoded String
Medium
275
Convert an Infix Expression to Postfix
Medium
276
Evaluate a Postfix Arithmetic Expression
Easy
277
Evaluate a Calculator Expression With Parentheses
Hard
278
Evaluate an Expression With Precedence, No Parentheses
Medium
279
Previous Smaller Element for Each Array Position
Medium
280
Next Smaller Element to the Right
Medium
281
Total of Every Subarray's Minimum Value
Medium
282
Largest Rectangular Panel Under a Row of Fence Posts
Hard
283
Previous Greater Element for Each Array Position
Medium
284
Next Greater Value From a Reference Sequence
Easy
285
Next Greater Value in a Circular Sequence
Medium
286
Wait Time Until a Higher Temperature Arrives
Medium
287
Backward Price Span for Each Trading Day
Medium
288
Drone Collisions Along a One-Dimensional Corridor
Medium
289
Total High-Low Spread of Every Subarray
Hard
290
Smallest Value Achievable by Deleting K Digits
Medium
291
Remove Duplicate Letters in Lexicographic Order
Medium
292
Minimum Remove to Make Valid Parentheses
Medium
293
Build the Largest Number by Merging Two Digit Sequences
Hard
294
Stack With O(1) Access to Its Current Minimum
Medium
295
Stack Supporting Removal of Its Own Maximum Element
Hard
296
Stack With a Range-Increment Operation
Medium
297
Push a Value to the Very Bottom of a Stack
Easy
298
Flip a Stack's Order Using Pure Recursion
Easy
299
Delete the Middle Element of a Stack Using Recursion
Easy
300
Multiply Every Integer From 1 Through N
Easy
301
Print 1 to N and N to 1 With a Single Recursive Function
Easy
302
Check If a String Reads the Same Forwards and Backwards — Recursively
Easy
303
Nth Term of the Fibonacci Sequence
Easy
304
Locate a Target's Index in a Sorted Array Using Recursive Halving
Easy
305
Compute a Power Using Fast Exponentiation
Medium
306
Find the Doubled Median of Two Sorted Arrays via Partitioning
Hard
307
Merge a Pair of Ascending Linked Lists Recursively
Easy
308
Build a Target Sum by Reusing Candidates Freely
Medium
309
Pick Each Number At Most Once to Reach a Target Sum
Medium
310
Every Possible Ordering of a Set of Distinct Numbers
Medium
311
Every Unique Ordering When Values May Repeat
Medium
312
Every Well-Formed Bracket Sequence of a Given Length
Medium
313
Every Way to Split a String Into Palindromic Pieces
Medium
314
Every Valid IPv4 Address Restorable From a Digit String
Medium
315
Every Letter Combination From a Phone Keypad Sequence
Medium
316
Every Way to Place N Non-Attacking Queens on a Board
Hard
317
Can a Graph Be Colored With at Most M Colors?
Medium
318
Fill In a 9×9 Sudoku Puzzle to Completion
Hard
319
Insert Operators Between Digits to Reach a Target Value
Hard
320
Count Paths Through a Grid Moving Only Down or Right
Medium
321
Can a Word Be Traced Through Adjacent Board Letters?
Medium
322
Maximum Gold Collectible Along a Non-Revisiting Path
Medium
323
Find Every Dictionary Word Traceable on a Letter Board
Hard
324
Count Paths That Visit Every Open Cell Exactly Once
Hard
325
Serve Support Tickets Most-Urgent-First With Arrival Tie-Breaks
Easy
326
Replay an Operation Log on a Min-Heap
Easy
327
Replay an Operation Log on a Max-Heap With a Replace-Top Command
Easy
328
Find the Kth Highest Reading in a Sensor Batch
Medium
329
Rank the K Most Repeated Words in a Document
Medium
330
Track the Running Twice-Median of a Live Price Feed
Hard
331
Cheapest K Pairings Across Two Sorted Menus
Medium
332
Narrowest Window That Touches Every Schedule
Hard
333
Join Cable Segments at the Lowest Total Splice Cost
Medium
334
Merge Files K at a Time at the Lowest Total Cost
Medium
335
Combine Cards Into a Limited Number of Piles at Minimum Cost
Medium
336
Rearrange Letters So No Two Neighbors Match
Medium
337
Twice-the-Median of Every Window Along a Sensor Trace
Hard
338
Run Jobs Shortest-First and Report Each Job's Wait
Medium
339
Match Each Guest With a Snack Big Enough
Easy
340
Pack Grain Sacks by Value per Kilo
Medium
341
Make Exact Change Using the Fewest Notes
Easy
342
Give Exact Change at a Ticket Kiosk
Easy
343
Load Crates Onto a Truck for the Most Cargo
Easy
344
Schedule Unit Jobs Before Their Deadlines for Maximum Profit
Medium
345
Book the Most Non-Clashing Workshops in One Hall
Easy
346
Combine Overlapping Booking Ranges
Medium
347
Slot a New Booking Into a Sorted Calendar
Medium
348
Fewest Talks to Cancel So the Rest Don't Overlap
Medium
349
Fewest Rooms Needed for a Day of Sessions
Medium
350
Fewest Platforms for a Station Timetable
Medium
351
Fewest Laser Shots to Pop Every Balloon
Medium
352
Can the Frog Reach the Last Lily Pad?
Medium
353
Fewest Hops to Reach the Last Lily Pad
Medium
354
Fewest Sprinklers to Cover the Whole Path
Hard
355
Hand Out Prizes So Higher Scorers Beat Their Neighbours
Hard
356
Split the Tape Into the Most Segments With No Shared Letters
Medium
357
Arrange Numbers to Form the Largest Possible Value
Medium
358
List a Tree's Values Left, Node, Right
Easy
359
List a Tree's Values Node, Left, Right
Easy
360
List a Tree's Values Left, Right, Node
Easy
361
Group a Tree's Values Level by Level
Medium
362
Count the Nodes of a Complete Tree Without Visiting Them All
Easy
363
Check Whether Two Trees Match Exactly
Easy
364
Is the Tree a Mirror Image of Itself
Easy
365
Flip a Tree Left to Right
Easy
366
Shortest Downward Trip From the Root to a Leaf
Easy
367
Does One Tree Hide Inside Another
Easy
368
Write Out Every Route From the Root to a Leaf
Easy
369
Does Any Root-to-Leaf Route Add Up to the Target
Easy
370
List Every Root-to-Leaf Route With a Given Total
Medium
371
Count Downward Stretches With a Given Total
Medium
372
Trace the Route From the Root to a Chosen Node
Medium
373
How Many Levels Tall Is the Tree
Easy
374
Is the Tree Height-Balanced at Every Node
Easy
375
Find the Longest Link Between Any Two Nodes
Easy
376
Find the Heaviest Path Anywhere in the Tree
Hard
377
Whole-Number Average of Every Level
Easy
378
Are the Two Nodes on the Same Level With Different Parents
Easy
379
Widest Level of the Tree, Counting the Gaps
Medium
380
Link Each Node to Its Right Neighbour
Medium
381
List the Levels From the Bottom Up
Easy
382
Read the Levels in a Zigzag Pattern
Medium
383
What You See Looking at the Tree From the Right
Medium
384
What You See Looking at the Tree From the Left
Easy
385
Read the Tree Column by Column
Hard
386
What You See Looking Down at the Tree
Medium
387
What You See Looking Up at the Tree
Medium
388
Find the Lowest Node Above Both Chosen Nodes
Medium
389
How Many Steps Separate Two Nodes
Medium
390
Find the K-th Ancestor of a Chosen Node
Medium
391
Walk Around the Outer Edge of the Tree
Medium
392
List Every Node a Fixed Number of Steps From a Chosen Node
Medium
393
How Long Until Fire Reaches the Whole Tree
Hard
394
Does Every Node Equal the Sum of Its Children
Easy
395
Flatten the Tree Into a Right-Leaning Chain
Medium
396
Rebuild a Tree From Its Node-First and Middle-Out Listings
Medium
397
Rebuild a Tree From Its Middle-Out and Node-Last Listings
Medium
398
Save a Tree as Text and Load It Back
Hard
399
Look Up a Key and Return Its Whole Subtree
Easy
400
Largest Stored Value That Does Not Exceed a Number
Medium
401
Smallest Stored Value That Is Not Below a Number
Medium
402
Find the Stored Value Nearest to a Number
Easy
403
Add a New Key to a Search Tree
Medium
404
Remove a Key From a Search Tree
Medium
405
Does the Tree Really Obey the Search Rule
Medium
406
Find the K-th Smallest Value in a Search Tree
Medium
407
Find the K-th Largest Value in a Search Tree
Medium
408
Step Through a Search Tree One Value at a Time
Medium
409
Which Stored Value Comes Right After a Key
Medium
410
Which Stored Value Comes Right Before a Key
Medium
411
Find the Meeting Point of Two Keys in a Search Tree
Easy
412
Do Two Different Stored Values Add Up to a Target
Easy
413
Add the Sum of All Larger Keys to Every Node
Medium
414
Restore a Search Tree After Two Values Were Swapped
Medium
415
Turn a Sorted List Into a Balanced Search Tree
Easy
416
Rebuild a Search Tree From Its Node-First Listing
Medium
417
Find the Largest Search-Tree Piece Inside a Tree
Medium
418
Count the Separate Friend Circles
Medium
419
Count the Islands of Connected Towns
Medium
420
Make an Independent Copy of a Connected Network
Medium
421
How Long Until Every Fresh Fruit Spoils
Medium
422
Distance From Every Cell to the Nearest Empty Slot
Medium
423
Shortest Clear Route Through a Blocked Board
Medium
424
Repaint a Connected Patch of Tiles
Easy
425
Count the Separate Landmasses on a Map
Medium
426
Shortest Word Ladder Between Two Words
Hard
427
All Routes From the Entrance to the Exit
Medium
428
Fill the Enclosed Ponds
Medium
429
Count the Stranded Land Tiles
Medium
430
Count the Distinct Island Shapes
Medium
431
Can Everyone Be Split Into Two Teams
Medium
432
Does the Road Network Contain a Loop
Medium
433
Does the One-Way Network Contain a Circuit
Medium
434
Longest Loop in a Conveyor Network
Hard
435
The One Valid Build Order (DFS)
Medium
436
Alphabetical Build Order (Kahn)
Medium
437
Can All the Courses Be Completed
Medium
438
Plan the Course Order
Medium
439
Stations From Which You Can Never Get Trapped
Medium
440
Recover the Sorting Order of an Old Catalogue
Hard
441
Fewest Hops From One Town to Every Other
Medium
442
Cheapest Routes Through a One-Way Freight Network
Medium
443
Fewest Spins to Open the Combination Lock
Medium
444
Cheapest Route to Every Town With Road Tolls
Medium
445
How Long Until Every Server Hears the Broadcast
Medium
446
Laying a Pipe Over Uneven Ground
Medium
447
Cheapest Flight With a Limited Number of Layovers
Medium
448
Count the Cheapest Routes Between Two Cities
Medium
449
The Cheapest Walk Across a Toll Grid
Medium
450
Wading Across a Flooding Field
Hard
451
Routes With Discounts and Surcharges
Medium
452
Is There a Bargain Loop That Pays You Forever
Medium
453
Cheapest Route Between Every Pair of Stations
Hard
454
The Quietest City Within Driving Range
Medium
455
Connect All Villages With the Least Cable
Medium
456
Who Connects Each Village to the Cable Network
Medium
457
List the Cables of the Cheapest Network
Medium
458
Friend Groups That Merge and Get Queried
Medium
459
How Big Is Your Friend Group
Medium
460
Rebuild Rope Bridges to Join Every Island
Medium
461
Find the Cable That Closes the Loop
Medium
462
Merge Contact Lists That Share an Email
Medium
463
Removing Stones From a Shared Yard
Medium
464
Islands Rising One Cell at a Time
Hard
465
Build the Biggest Island With One Extra Cell
Hard
466
Cables Whose Loss Splits the Network
Hard
467
Servers Whose Failure Splits the Network
Hard
468
Groups of Stations That Can All Reach Each Other
Hard
469
How Long Can You Wait Before the Fire Arrives
Hard
470
Fibonacci Series — From Recursion to Space-Optimized DP
Easy
471
Check Whether a Number Is Positive, Negative, or Zero
Easy
472
Find the Largest of Two Numbers
Easy
473
Find the Largest of Three Numbers
Easy
474
Check Whether a Year Is a Leap Year
Easy
475
Check Voting Eligibility by Age
Easy
476
Calculate Letter Grade from a Percentage Score
Easy
477
Build a Simple Four-Operation Calculator
Easy
478
Count the Number of Digits in an Integer
Easy
479
Sum of Digits of a Number
Easy
480
Reverse the Digits of a Number
Easy
481
Check if a Number Is a Palindrome
Easy
482
Check if a Number Is an Armstrong Number
Easy
483
Check if a Number Is Prime
Easy
484
List All Prime Numbers up to N
Easy
485
Find the GCD of Two Numbers
Easy
486
Find the LCM of Two Numbers
Easy
487
Calculate the Power of a Number
Easy
488
Print Numbers from 1 to N
Easy
489
Print Numbers from N to 1
Easy
490
Print Even Numbers from 1 to N
Easy
491
Print Odd Numbers from 1 to N
Easy
492
Sum of the First N Natural Numbers
Easy
493
Sum of Even Numbers from 1 to N
Easy
494
Print the Multiplication Table of a Number
Easy
495
Count the Numbers from 1 to N
Easy
496
Print a Square Star Pattern
Easy
497
Print a Rectangle Star Pattern
Easy
498
Print a Right Half Pyramid Star Pattern
Easy
499
Print a Reverse Right Half Pyramid Star Pattern
Easy
500
Print a Left Half Pyramid Star Pattern
Easy
501
Print a Reverse Left Half Pyramid Star Pattern
Easy
502
Print a Number Square Pattern
Easy
503
Print an Increasing Number Triangle
Easy
504
Print a Reverse Number Triangle
Easy
505
Print a Number Changing Pyramid
Easy
506
Print a Number Increasing Pyramid
Easy
507
Print a Number Increasing Reverse Pyramid
Easy
508
Print a Continuously Increasing Number Triangle
Easy
509
Print a Full Star Pyramid
Easy
510
Print a Reverse Star Pyramid
Easy
511
Print a Diamond Star Pattern
Easy
512
Print Your Name
Easy
513
Print Multiple Lines
Easy
514
Read a Number Typed as Text
Easy
515
Read Inputs of Several Data Types
Easy
516
Find the Exact Average of Two Integers
Easy
517
Perform the Five Basic Arithmetic Operations
Easy
518
Sum of Two Numbers
Easy
519
Calculate Simple Interest
Easy
520
Calculate the Area of a Circle
Easy
521
Convert Celsius to Fahrenheit
Easy
522
Calculate a Percentage
Easy
523
Find the Quotient and Remainder
Easy
524
Print a Hollow Diamond Pattern
Easy
525
Print a Butterfly Star Pattern
Easy
526
Print a Rhombus Star Pattern
Easy
527
Print a Hollow Square Star Pattern
Easy
528
Print a Hollow Right Triangle Star Pattern
Easy
529
Print a Hollow Inverted Right Triangle Star Pattern
Easy
530
Print a Hollow Hourglass Star Pattern
Easy
531
Print Pascal's Triangle as a Pattern
Easy
532
Print a Palindrome Number Pyramid
Easy
533
Print a Mirrored Number Triangle
Easy
534
Print a Zero-One Triangle
Easy
535
Print a Right Pascal's Triangle Star Pattern
Easy
536
Evaluate Expressions with Operator Precedence
Easy
537
Compare Two Numbers with Relational Operators
Easy
538
Decide Entry Using Logical Operators
Easy
539
Track a Value Through Compound Assignments
Easy
540
Compare Prefix and Postfix Increment and Decrement
Easy
541
Find the Smallest of Three Numbers
Easy
542
Write and Reuse an Add Function
Easy
543
Classify Numbers with an isEven Function
Easy
544
Keep Only the Prime Numbers
Easy
545
Simplify a Fraction Using GCD
Easy
546
Add a Number to Its Reverse
Easy
547
Count Palindromic Numbers in a Range
Easy
548
Convert Seconds to Hours, Minutes and Seconds
Easy
549
Count the Operations in a Summing Loop
Easy
550
Count Multiples of K up to N
Easy
551
Count Comparisons in a Linear Search
Easy
552
Find the Minimum and Maximum with Constant Space
Easy
553
Get the First, Middle and Last Elements
Easy
554
Count How Many Times N Can Be Halved
Easy
555
Count How Often the Maximum Appears
Easy
556
Find the Smallest Difference Between Any Two Values
Easy
557
Count Out-of-Order Pairs
Easy
558
Count the Calls Made by Naive Fibonacci
Easy
559
Count Iterations of a Stepping Loop
Easy
560
Count Iterations of a Nested Loop
Easy
561
Count Iterations of Consecutive Loops
Easy
562
Count Iterations When Dividing by K
Easy
563
Count Iterations When Multiplying by Two
Easy
564
Count Pairs with Equal Values
Easy
565
Create and Fill an Array of Squares
Easy
566
Find the Sum of an Array
Easy
567
Find the Average of an Array
Easy
568
Find the Smallest Element in an Array
Easy
569
Count Even and Odd Numbers in an Array
Easy
570
Count Positive and Negative Numbers in an Array
Easy
571
Check if an Array Contains a Value
Easy
572
Copy an Array
Easy
573
Insert an Element at a Position
Easy
574
Delete an Element at a Position
Easy
575
Rearrange Positives and Negatives Alternately
Easy
576
Linear Search for a Value
Easy
577
Find the First Occurrence of a Value
Easy
578
Find the Last Occurrence of a Value
Easy
579
Count Occurrences of a Value
Easy
580
Count How Often Each Element Appears
Easy
581
Trim Spaces from a Line of Text
Easy
582
Find the Length of a String
Easy
583
Space Out the Characters of a String
Easy
584
Count Letters, Digits, Spaces and Other Characters
Easy
585
Count Vowels and Consonants in a String
Easy
586
Convert Lowercase Letters to Uppercase
Easy
587
Convert Uppercase Letters to Lowercase
Easy
588
Count the Words in a Sentence
Easy
589
Remove All Spaces from a String
Easy
590
Remove the Vowels from a String
Easy
591
Count the Frequency of Each Character
Easy
592
Push onto a Stack with a Capacity Limit
Easy
593
Pop Items from a Stack
Easy
594
Peek at the Top After Each Operation
Easy
595
Check Whether a Stack Is Empty After Each Operation
Easy
596
Implement a Queue Using an Array
Easy
597
Implement a Circular Queue
Easy
598
Implement a Queue Using a Linked List
Easy
599
Sum of N Numbers Using Recursion
Easy