Year
2024 archive
A year-sized slice of the daily archive, ordered newest first.
366 entries
366 entries from 2024.
31.12.2024
medium983. Minimum Cost For Tickets
Min sum buying 1,7,30-days tickets to travel all days programming
30.12.2024
medium2466. Count Ways To Build Good Strings
Ways to make 01-string length of low..high programming
29.12.2024
hard1639. Number of Ways to Form a Target String Given a Dictionary
Ways to make target with increasing positions in words programming
28.12.2024
hard689. Maximum Sum of 3 Non-Overlapping Subarrays
max non-intersecting intervals programming window
27.12.2024
medium1014. Best Sightseeing Pair
Max (a[i] + a[j] + i - j), i > j
26.12.2024
medium494. Target Sum
Count signs permutations to sum equal target programming
25.12.2024
medium515. Find Largest Value in Each Tree Row
Tree layers maxes
24.12.2024
hard3203. Find Minimum Diameter After Merging Two Trees
Diameter of 2 connected trees
23.12.2024
medium2471. Minimum Number of Operations to Sort a Binary Tree by Level
Min swaps to sort tree layers
22.12.2024
hard2940. Find Building Where Alice and Bob Can Meet
Common indices t, h[t] > h[a], h[t] > h[b] for queries q[][a,b] stack
21.12.2024
hard2872. Maximum Number of K-Divisible Components
Max connected components divisible by k in graph
20.12.2024
medium2415. Reverse Odd Levels of Binary Tree
Odd-levels reversal in a perfect tree
19.12.2024
medium769. Max Chunks To Make Sorted
Maximum independent chunks to merge-sort array
18.12.2024
easy1475. Final Prices With a Special Discount in a Shop
Subtract next smaller value stack
17.12.2024
medium2182. Construct String With Repeat Limit
Max lexical ordered with repeat limit string sort
16.12.2024
easy3264. Final Array State After K Multiplication Operations I
Mutliply k minimums
15.12.2024
medium1792. Maximum Average Pass Ratio
Arrange passed students to improve average score
14.12.2024
medium2762. Continuous Subarrays
Count subarrays with difference <= 2 queue set
13.12.2024
medium2593. Find Score of an Array After Marking All Elements
Sum of minimums in order excluding siblings stack
12.12.2024
medium2558. Take Gifts From the Richest Pile
Sum after k-Sqrt of tops in array
11.12.2024
medium2779. Maximum Beauty of an Array After Applying Operation
Max equal nums after adjusting to [-k..+k] search sweep
10.12.2024
medium2981. Find Longest Special Substring That Occurs Thrice I
Max same-char 3-windows length window
09.12.2024
medium3152. Special Array II
Queries is all adjucents parity differ [i..j] pointers
08.12.2024
medium2054. Two Best Non-Overlapping Events
Max two non-overlapping intervals search
07.12.2024
medium1760. Minimum Limit of Balls in a Bag
Max number after at most maxOperations of splitting search
06.12.2024
medium2554. Maximum Number of Integers to Choose From a Range I
Sum 1..n excluding banned until maxSum
05.12.2024
medium2337. Move Pieces to Obtain a String
Move L left and R right to match strings
04.12.2024
medium2825. Make String a Subsequence Using Cyclic Increments
Increase some chars once to make a subsequence
03.12.2024
medium2109. Adding Spaces to a String
Insert spaces into string
02.12.2024
easy1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence
Position of the prefix
01.12.2024
easy1346. Check If N and Its Double Exist
Any i != j && a[i] = 2 a[j]
30.11.2024
hard2097. Valid Arrangement of Pairs
Hierholzer algorithm
29.11.2024
hard2577. Minimum Time to Visit a Cell In a Grid
Min time start-end 4-d travel in 2D matrix with waiting
28.11.2024
hard2290. Minimum Obstacle Removal to Reach Corner
Min removals to travel first-last in 2D grid
27.11.2024
medium3243. Shortest Distance After Road Addition Queries I
Query shortest paths after adding new edges
26.11.2024
medium2924. Find Champion II
Root of the graph
25.11.2024
hard773. Sliding Puzzle
Steps to solve slide puzzle
24.11.2024
medium1975. Maximum Matrix Sum
Max sum of 2D matrix after multiply by -1 adjacent cells
23.11.2024
medium1861. Rotating the Box
Rotate matrix and simulate the fall
22.11.2024
medium1072. Flip Columns For Maximum Number of Equal Rows
Max same-bit-rows after flipping columns in 01-2D matrix
21.11.2024
medium2257. Count Unguarded Cells in the Grid
Count unseen cells in 2D matrix with guards and walls
20.11.2024
medium2516. Take K of Each Character From Left and Right
Min take k of a,b,c from head or tail pointers
19.11.2024
medium2461. Maximum Sum of Distinct Subarrays With Length K
Max k-unique window sum window
18.11.2024
easy1652. Defuse the Bomb
Next +-k window sums window
17.11.2024
hard862. Shortest Subarray with Sum at Least K
Min subarray with sum at least k queue
16.11.2024
medium3254. Find the Power of K-Size Subarrays I
Tops of consecutive increasing windows window
15.11.2024
medium1574. Shortest Subarray to be Removed to Make Array Sorted
Min subarray remove to make array sorted pointers
14.11.2024
medium2064. Minimized Maximum of Products Distributed to Any Store
Min of max of quantities spread by n single-type stores search
13.11.2024
medium2563. Count the Number of Fair Pairs
Count pairs a[i] + a[j] in lower..upper search pointers
12.11.2024
medium2070. Most Beautiful Item for Each Query
Queries of max beauty for q[i] price search
11.11.2024
medium2601. Prime Subtraction Operation
Increased sequence by subtracting primes? search
10.11.2024
medium3097. Shortest Subarray With OR at Least K II
Min subarray with OR[..] >= k manipulation window
09.11.2024
medium3133. Minimum Array End
nth of increasing sequence with AND[..]=x manipulation
08.11.2024
medium1829. Maximum XOR for Each Query
Running xor to make 2^k-1 manipulation
07.11.2024
medium2275. Largest Combination With Bitwise AND Greater Than Zero
Max positive AND-subset manipulation
06.11.2024
medium3011. Find if Array Can Be Sorted
Can array be sorted by adjacent swap same-1-bits-nums
05.11.2024
medium2914. Minimum Number of Changes to Make Binary String Beautiful
Min changes to make even-sized 0 and 1
04.11.2024
medium3163. String Compression III
Compress repeating chars in string pointers
03.11.2024
easy796. Rotate String
Is string rotated goal?
02.11.2024
easy2490. Circular Sentence
Are words circular?
01.11.2024
easy1957. Delete Characters to Make Fancy String
Filter 3+ repeating chars from string
31.10.2024
hard2463. Minimum Total Distance Traveled
Min robots[x] travel to factories[x,capacity] programming
30.10.2024
hard1671. Minimum Number of Removals to Make Mountain Array
Min removes to make a mountain programming search
29.10.2024
medium2684. Maximum Number of Moves in a Grid
Max increasing path from left to right in 2D matrix programming
28.10.2024
medium2501. Longest Square Streak in an Array
Longest quadratic subset
27.10.2024
medium1277. Count Square Submatrices with All Ones
Count 1-filled squares in 2D matrix programming
26.10.2024
hard2458. Height of Binary Tree After Subtree Removal Queries
n new heights by cutting nodes in a Tree
25.10.2024
medium1233. Remove Sub-Folders from the Filesystem
Remove empty subfolders
24.10.2024
medium951. Flip Equivalent Binary Trees
Are trees flip-equal
23.10.2024
medium2641. Cousins in Binary Tree II
Replace Tree's values with cousines sum
22.10.2024
medium2583. Kth Largest Sum in a Binary Tree
kth largest level-sum in a tree
21.10.2024
medium1593. Split a String Into the Max Number of Unique Substrings
Max count of unique split parts
20.10.2024
hard1106. Parsing A Boolean Expression
before evaluation, index i should point at the first token of the subproblem
19.10.2024
medium1545. Find Kth Bit in Nth Binary String
kth bit of sequence bs[i] = bs[i-1] + '1' + rev(inv(bs[i-1])) manipulation
18.10.2024
medium2044. Count Number of Maximum Bitwise-OR Subsets
Count subsequences with max bitwise or
17.10.2024
medium670. Maximum Swap
Max number after a single digits swap
16.10.2024
medium1405. Longest Happy String
Longest string of a, b, c not repeating 3 times
15.10.2024
medium2938. Separate Black and White Balls
Min moves to sort 01 string
14.10.2024
medium2530. Maximal Score After Applying K Operations
Replace max(arr) with ceil(max/3) k times
13.10.2024
hard632. Smallest Range Covering Elements from K Lists
Smallest intersection of k sorted lists set
12.10.2024
medium2406. Divide Intervals Into Minimum Number of Groups
Count non-intersecting groups of intervals
11.10.2024
medium1942. The Number of the Smallest Unoccupied Chair
target's chair number when chairs reused by multiple [arrival, leave] times
10.10.2024
medium962. Maximum Width Ramp
Max j-i between a[i] <= a[j] in an array stack
09.10.2024
medium921. Minimum Add to Make Parentheses Valid
Minimum inserts to balance brackets
08.10.2024
medium1963. Minimum Number of Swaps to Make the String Balanced
Min swaps to balance brackets pointers
07.10.2024
easy2696. Minimum String Length After Removing Substrings
Remove 'AB' and 'CD' from the string
06.10.2024
medium1813. Sentence Similarity III
Are strings equal after inserting substring?
05.10.2024
medium567. Permutation in String
Is s2 contains permutation of s1? pointers
04.10.2024
medium2491. Divide Players Into Teams of Equal Skill
Sum of products of pairs with equal sums
03.10.2024
medium1590. Make Sum Divisible by P
Min removed subarray length to make remainder % p = 0
02.10.2024
easy1331. Rank Transform of an Array
Array values to their sorted set positions
01.10.2024
medium1497. Check If Array Pairs Are Divisible by k
Can all pairs sums be k-even?
30.09.2024
medium1381. Design a Stack With Increment Operation
Stack with range increment operation
29.09.2024
hard432. All O`one Data Structure
Count usage frequencies in O(1) list
28.09.2024
medium641. Design Circular Deque
Ring buffer
27.09.2024
medium731. My Calendar II
Add intervals intersecting less than two times sweep
26.09.2024
medium729. My Calendar I
Insert non-intersection interval search
25.09.2024
hard2416. Sum of Prefix Scores of Strings
Counts of words with same prefixes
24.09.2024
medium3043. Find the Length of the Longest Common Prefix
Common digit prefix between all pairs of two num arrays
23.09.2024
hard2707. Extra Characters in a String
Min extra chars to form an s from dictionary programming
22.09.2024
hard440. K-th Smallest in Lexicographical Order
k lexicographically smallest value from 1..n
21.09.2024
medium386. Lexicographical Numbers
Lexicographical ordered numbers 1..n
20.09.2024
hard214. Shortest Palindrome
Prepend to make the shortest palindrome hash
19.09.2024
medium241. Different Ways to Add Parentheses
Eval all possible parenthesis placements programming
18.09.2024
medium179. Largest Number
Concatenate nums to largest number
17.09.2024
easy884. Uncommon Words from Two Sentences
Unique words from two strings
16.09.2024
medium539. Minimum Time Difference
Min difference in a list of times hh:mm
15.09.2024
medium1371. Find the Longest Substring Containing Vowels in Even Counts
Longest substring with even number of "aeiou" manipulation pointers
14.09.2024
medium2419. Longest Subarray With Maximum Bitwise AND
Max bitwise AND subarray manipulation pointers
13.09.2024
medium1310. XOR Queries of a Subarray
Run queries[[from, to]] of xor(arr[from..to]) manipulation
12.09.2024
easy1684. Count the Number of Consistent Strings
Count words with allowed characters
11.09.2024
easy2220. Minimum Bit Flips to Convert Number
Bit diff between two numbers manipulation
10.09.2024
medium2807. Insert Greatest Common Divisors in Linked List
Insert gcd in-between LinkedList nodes list
09.09.2024
medium2326. Spiral Matrix IV
LinkedList to spiral 2D matrix list
08.09.2024
medium725. Split Linked List in Parts
Split LinkedList into k parts list
07.09.2024
medium1367. Linked List in Binary Tree
Is the LinkedList in the BinaryTree? list
06.09.2024
medium3217. Delete Nodes From Linked List Present in Array
Remove nums from a Linked List list
05.09.2024
medium2028. Find Missing Observations
Find n numbers to make [n m]/(n+m)=mean
04.09.2024
medium874. Walking Robot Simulation
Max distance after robot moves simulation
03.09.2024
easy1945. Sum of Digits of String After Convert
Sum of number chars k times
02.09.2024
medium1894. Find the Student that Will Replace the Chalk
Position of a k sum in a cyclic array
01.09.2024
easy2022. Convert 1D Array Into 2D Array
D to 2D mxn array
31.08.2024
medium1514. Path with Maximum Probability
Max path in graph
30.08.2024
hard2699. Modify Graph Edge Weights
Assign vacant -1 weight in graph to make shorted path equal target
29.08.2024
medium947. Most Stones Removed with Same Row or Column
Count islands of intersecting x and y
28.08.2024
medium1905. Count Sub Islands
Count islands intersecting in both 2D grids
27.08.2024
medium1514. Path with Maximum Probability
Max path in a weighted graph
26.08.2024
easy590. N-ary Tree Postorder Traversal
Postorder tree traversal
25.08.2024
easy145. Binary Tree Postorder Traversal
Postorder tree traversal tree
24.08.2024
hard564. Find the Closest Palindrome
Closest palindrome number
23.08.2024
easy592. Fraction Addition and Subtraction
Eval string of fractions sum
22.08.2024
easy476. Number Complement
Invert bits: 101 becomes 010 manipulation
21.08.2024
hard664. Strange Printer
Minimum continuous replacements to make a string programming
20.08.2024
medium1140. Stone Game II
Max Alice price taking 1..2m piles optimally with Bob programming
19.08.2024
medium650. 2 Keys Keyboard
Min copy-pastes to make n A's from one programming
18.08.2024
medium264. Ugly Number II
nth number with only [1,2,3,5] multipliers
17.08.2024
medium1937. Maximum Number of Points with Cost
Max top-down path sum with column diff in 2D matrix programming
16.08.2024
medium624. Maximum Distance in Arrays
Max diff between the arrays
15.08.2024
easy860. Lemonade Change
Simulate money exchange
14.08.2024
hard719. Find K-th Smallest Pair Distance
kth smallest pairs diff in an array search pointers
13.08.2024
medium40. Combination Sum II
Unique target sum subsequences
12.08.2024
easy703. Kth Largest Element in a Stream
kth largest in a stream of values
11.08.2024
hard1568. Minimum Number of Days to Disconnect Island
Min changes 1 to 0 to disconnect islands
10.08.2024
medium959. Regions Cut By Slashes
Count islands divided by '\' and '/' in 2D matrix
09.08.2024
medium840. Magic Squares In Grid
Count 9x9 1..9 equal row col diag sum subgrids
08.08.2024
medium885. Spiral Matrix III
D spiraling order
07.08.2024
hard273. Integer to English Words
Integer to English words
06.08.2024
medium3016. Minimum Number of Pushes to Type Word II
Minimum keystrokes after assigning letter to keys
05.08.2024
easy2053. Kth Distinct String in an Array
kth unique
04.08.2024
medium1508. Range Sum of Sorted Subarray Sums
Sum of [left..right] of sorted subarray's sums
03.08.2024
easy1460. Make Two Arrays Equal by Reversing Subarrays
Can arr transform to target by rotating subarrays?
02.08.2024
medium2134. Minimum Swaps to Group All 1's Together II
Min swaps to make a circular [01] array window
01.08.2024
easy2678. Number of Senior Citizens
Count filtered by a substring
31.07.2024
medium1105. Filling Bookcase Shelves
Min total height to split [[w,h]] array by shelfWidth programming
30.07.2024
medium1653. Minimum Deletions to Make String Balanced
Min removals to sort 'ab' string
29.07.2024
medium1395. Count Number of Teams
Count increasing or decreasing (i, j, k)
28.07.2024
hard2045. Second Minimum Time to Reach Destination
Second min time to travel from 1 to n in time-edged graph stopping every change seconds
27.07.2024
medium2976. Minimum Cost to Convert String I
Min cost to change the source to the target
26.07.2024
medium1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance
Node with minimum neighbors by distanceThreshold
25.07.2024
medium912. Sort an Array
Sort array using minimum memory
24.07.2024
medium2191. Sort the Jumbled Numbers
Sort array by digits mapping
23.07.2024
easy1636. Sort Array by Increasing Frequency
Sort by frequency or descending
22.07.2024
easy2418. Sort the People
Sort one array by another
21.07.2024
hard2392. Build a Matrix With Conditions
Build a matrix from a graph conditions
20.07.2024
medium1605. Find Valid Matrix Given Row and Column Sums
Matrix from rows and cols sums
19.07.2024
easy1380. Lucky Numbers in a Matrix
Min in rows and max in columns in a unique number matrix
18.07.2024
medium1530. Number of Good Leaf Nodes Pairs
Count at most distance paths between leaves
17.07.2024
medium1110. Delete Nodes And Return Forest
Trees after remove nodes from tree
16.07.2024
medium2096. Step-By-Step Directions From a Binary Tree Node to Another
U-L-R path from s to d in a Binary Tree
15.07.2024
medium2196. Create Binary Tree From Descriptions
Restore binary tree from [parent, child, isLeft]
14.07.2024
hard726. Number of Atoms
Simplify chemical formula parenthesis
13.07.2024
hard2751. Robot Collisions
D dimensional robots fight
12.07.2024
medium1717. Maximum Score From Removing Substrings
Max score removing from s, x for ab, y for ba
11.07.2024
medium1190. Reverse Substrings Between Each Pair of Parentheses
Reverse string in parentheses recursively
10.07.2024
easy1598. Crawler Log Folder
Filesystem path depth
9.07.2024
medium1701. Average Waiting Time
Average of intersecting intervals
8.07.2024
medium1823. Find the Winner of the Circular Game
Last of k-th excluded from 1..n
7.07.2024
easy1518. Water Bottles
Bottles drink and exchange simulation
6.07.2024
easy2582. Pass the Pillow
Loop position in increasing-decreasing array
5.07.2024
medium2058. Find the Minimum and Maximum Number of Nodes Between Critical Points
[min, max] distance between critical points in linked list list
4.07.2024
medium2181. Merge Nodes in Between Zeros
Collapse in-between 0 nodes in a LinkedList list
3.07.2024
medium1509. Minimum Difference Between Largest and Smallest Value in Three Moves
Min difference after 3 changes in array window programming
2.07.2024
easy350. Intersection of Two Arrays II
Array intersection with duplicates
1.07.2024
easy1550. Three Consecutive Odds
Has window of 3 odds?
30.06.2024
medium1579. Remove Max Number of Edges to Keep Graph Fully Traversable
Remove extra nodes in a connected graph by type 1, 2 and 3=1+2
29.06.2024
medium2192. All Ancestors of a Node in a Directed Acyclic Graph
List of ancestors in a DAG
28.06.2024
medium2285. Maximum Total Importance of Roads
Sort graph by siblings and compute sum(i s)
27.06.2024
easy1791. Find Center of Star Graph
Center of a start graph
26.06.2024
medium1382. Balance a Binary Search Tree
Make a balanced Binary Search Tree
25.06.2024
medium1038. Binary Search Tree to Greater Sum Tree
Aggregate Binary Search Tree from the right
24.06.2024
medium995. Minimum Number of K Consecutive Bit Flips
Count k-range flips in binary array to make all 1 window
23.06.2024
medium1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Longest subarray with abs(a[i] - a[j]) <= limit window queue
22.06.2024
medium1248. Count Number of Nice Subarrays
Count subarrays with k odds window
21.06.2024
medium1052. Grumpy Bookstore Owner
Max customers sum after make consecutive minutes non-grumpy window
20.06.2024
medium1552. Magnetic Force Between Two Balls
Max shortest distance between m positions search
19.06.2024
medium1482. Minimum Number of Days to Make m Bouquets
Min days to take m k-subarrays search
18.06.2024
medium826. Most Profit Assigning Work
Max profit by assigning [profit, difficulty] to workers any times
17.06.2024
medium633. Sum of Square Numbers
Is c sum of squares? search
16.06.2024
hard330. Patching Array
Insertions to make subsets sums fill 1..n
15.06.2024
hard502. IPO
Max capital by choosing k jobs with profits[] & capital[] given w on start
14.06.2024
medium945. Minimum Increment to Make Array Unique
Min increments to make items unique
13.06.2024
easy2037. Minimum Number of Moves to Seat Everyone
Sum of diffs of sorted students and seats
12.06.2024
medium75. Sort Colors
Sort 012 array
11.06.2024
easy1122. Relative Sort Array
Sort an array by the given order
10.06.2024
easy1051. Height Checker
Count unsorted elements in array
09.06.2024
medium974. Subarray Sums Divisible by K
Count subarrays divisible by k
08.06.2024
medium523. Continuous Subarray Sum
Any subarray sum % k = 0
07.06.2024
medium648. Replace Words
Replace words with suffixes from dictionary
06.06.2024
medium846. Hand of Straights
Can array be split into consecutive groups
05.06.2024
easy1002. Find Common Characters
Common letters in words
04.06.2024
easy409. Longest Palindrome
Max palindrome length from chars
03.06.2024
medium2486. Append Characters to String to Make Subsequence
Min diff to make t substring of s
02.06.2024
easy344. Reverse String
Reverse an array
01.06.2024
easy3110. Score of a String
Sum(abs(window))
31.05.2024
medium260. Single Number III
Two not duplicated numbers from array manipulation
30.05.2024
medium1442. Count Triplets That Can Form Two Arrays of Equal XOR
Number (i,j,k) where xor arr[i..j] = xor arr[j..k] manipulation
29.05.2024
medium1404. Number of Steps to Reduce a Number in Binary Representation to One
Steps even/2, odd+1 to make binary s to 1
28.05.2024
medium1208. Get Equal Substrings Within Budget
Max substring sum(abs(s[..] - t[..])) < maxCost window
27.05.2024
easy1608. Special Array With X Elements Greater Than or Equal X
Count of more or equal nums[i] equal itself
26.05.2024
hard552. Student Attendance Record II
N times: A -> LP, L -> AP, P -> AL, at most one A, no LLL programming
25.05.2024
hard140. Word Break II
All string splits with dictionary programming
24.05.2024
hard1255. Maximum Score Words Formed by Letters
Max score of words subset from letters
23.05.2024
medium2597. The Number of Beautiful Subsets
Count subsets without k difference in them
22.05.2024
medium131. Palindrome Partitioning
All palindrome partitions programming
21.05.2024
medium78. Subsets
All subsets
20.05.2024
easy1863. Sum of All Subset XOR Totals
Sum of subsets xors
19.05.2024
hard3068. Find the Maximum Sum of Node Values
Max sum after xor k any edges in a tree
18.05.2024
medium979. Distribute Coins in Binary Tree
Min moves to spread the coins across the tree
17.05.2024
easy1325. Delete Leaves With a Given Value
Recursively remove target leafs from the tree
16.05.2024
easy2331. Evaluate Boolean Binary Tree
Evaluate tree where 0/1 is false/true and 2/3 is or/and
15.05.2024
medium2812. Find the Safest Path in a Grid
Safest path in a grid with thieves
14.05.2024
medium1219. Path with Maximum Gold
Max one-way path in matrix
13.05.2024
medium861. Score After Flipping Matrix
Max binary-row sum after toggling rows and columns
12.05.2024
easy2373. Largest Local Values in a Matrix
Max pooling by 3x3 matrix
11.05.2024
hard857. Minimum Cost to Hire K Workers
Min cost of k workers each doing quality[i] work for fair rate
10.05.2024
medium786. K-th Smallest Prime Fraction
kth arr[i]/arr[j], i < j, arr[i] < arr[j] search
09.05.2024
medium3075. Maximize Happiness of Selected Children
Sum of k maximums decreasing each step
08.05.2024
easy506. Relative Ranks
Convert results array to ranks array
07.05.2024
medium2816. Double a Number Represented as a Linked List
Double the number as a Linked List list
06.05.2024
medium2487. Remove Nodes From Linked List
Make a Linked List non-increasing list
05.05.2024
medium237. Delete Node in a Linked List
Delete current node in a Linked List
04.05.2024
medium881. Boats to Save People
Minimum total boats with at most 2 people & limit weight pointers
03.05.2024
medium165. Compare Version Numbers
Compare version numbers
02.05.2024
easy2441. Largest Positive Integer That Exists With Its Negative
Max number that has its negative in array pointers
01.05.2024
easy2000. Reverse Prefix of Word
Reverse [..ch] prefix in string
30.04.2024
medium1915. Number of Wonderful Substrings
Count substrings with at most one odd frequency manipulation
29.04.2024
medium2997. Minimum Number of Operations to Make Array XOR Equal to K
Bit diff between k and nums xor manipulation
28.04.2024
hard834. Sum of Distances in Tree
Sums of paths to each leafs in a tree
27.04.2024
hard514. Freedom Trail
Min steps to produce key by rotating ring programming map
26.04.2024
hard1289. Minimum Falling Path Sum II
Min non-direct path top down in a 2D matrix programming
25.04.2024
medium2370. Longest Ideal Subsequence
Max length of less than k adjacent subsequence programming
24.04.2024
easy1137. N-th Tribonacci Number
nth Tribonacci number f(n + 3) = f(n) + f(n + 1) + f(n + 2)
23.04.2024
medium310. Minimum Height Trees
Center of an acyclic graph
22.04.2024
medium752. Open the Lock
Steps to rotate 4-wheel 0000 -> target
21.04.2024
easy1971. Find if Path Exists in Graph
Are source and destination connected in graph?
20.04.2024
medium1992. Find All Groups of Farmland
Count 1-rectangles in 0-1 2D matrix
19.04.2024
medium200. Number of Islands
Count 1-islands in 0-1 a 2D matrix
18.04.2024
easy463. Island Perimeter
Perimeter of 1's islands in 01-matrix
17.04.2024
medium988. Smallest String Starting From Leaf
Smallest string from leaf to root in a Binary Tree
16.04.2024
medium623. Add One Row to Tree
Insert nodes at the depth of the Binary Tree
15.04.2024
medium129. Sum Root to Leaf Numbers
Sum root-leaf numbers in a Binary Tree
14.04.2024
easy404. Sum of Left Leaves
Left-leaf sum in a Binary Tree
13.04.2024
hard85. Maximal Rectangle
Max 1-only area in a 0-1 matrix
12.04.2024
hard42. Trapping Rain Water
Trap the water in area between vertical walls
11.04.2024
medium402. Remove K Digits
Minimum number after removing k digits
10.04.2024
medium950. Reveal Cards In Increasing Order
Sort cards by rules: take top, next goes bottom
09.04.2024
easy2073. Time Needed to Buy Tickets
Seconds to buy tickets by k-th person in a rotating 1 second queue
08.04.2024
easy1700. Number of Students Unable to Eat Lunch
First sandwitch not eaten by any while popped from a queue
07.04.2024
medium678. Valid Parenthesis String
Are parenthesis valid with wildcard?
06.04.2024
medium1249. Minimum Remove to Make Valid Parentheses
Remove minimum to make parenthesis valid
05.04.2024
easy1544. Make The String Great
Remove lowercase-uppercase pairs
04.04.2024
easy1614. Maximum Nesting Depth of the Parentheses
Max nested parenthesis
03.04.2024
medium79. Word Search
Does grid have a word path?
02.04.2024
easy205. Isomorphic Strings
Can map chars from one string to another?
01.04.2024
easy58. Length of Last Word
Last word length
31.03.2024
hard2444. Count Subarrays With Fixed Bounds
Count subarrays of range minK..maxK
30.03.2024
hard992. Subarrays with K Different Integers
Count subarrays with k distinct numbers
29.03.2024
medium2962. Count Subarrays Where Max Element Appears at Least K Times
Count subarrays with at least k array max in
28.03.2024
medium2958. Length of Longest Subarray With at Most K Frequency
Max subarray length with frequencies <= k
27.03.2024
medium713. Subarray Product Less Than K
Subarrays count with product less than k
26.03.2024
hard41. First Missing Positive
First number 1.. not presented in the array, O(1) space
25.03.2024
medium442. Find All Duplicates in an Array
All duplicate numbers of 1..n using O(1) memory
24.03.2024
medium287. Find the Duplicate Number
Duplicate single number in 1..n array, no extra memory
23.03.2024
medium143. Reorder List
Reorder Linked List 1->2->3->4->5 -> 1->5->2->4->3
22.03.2024
easy234. Palindrome Linked List
Is Linked List a palindrome
21.03.2024
easy206. Reverse Linked List
Reverse a Linked List
20.03.2024
medium1669. Merge In Between Linked Lists
Replace a segment in a LinkedList
19.03.2024
medium621. Task Scheduler
Count CPU cycles if task can't run twice in n cycles
18.03.2024
medium452. Minimum Number of Arrows to Burst Balloons
Count non-intersecting intervals
17.03.2024
medium57. Insert Interval
Insert interval into a sorted intervals array
16.03.2024
medium525. Contiguous Array
Max length of subarray sum(0) == sum(1)
15.03.2024
medium238. Product of Array Except Self
Array of suffix-prefix products
14.03.2024
medium930. Binary Subarrays With Sum
Count goal-sum subarrays in a 0-1 array
13.03.2024
easy2485. Find the Pivot Integer
Pivot of 1..n where sum[1..p] == sum[p..n].
12.03.2024
medium1171. Remove Zero Sum Consecutive Nodes from Linked List
Remove consequent 0-sum items from a LinkedList
11.03.2024
medium791. Custom Sort String
Construct string from s using order
10.03.2024
easy349. Intersection of Two Arrays
Intersection of two nums arrays
09.03.2024
easy2540. Minimum Common Value
First common number in two sorted arrays
08.03.2024
easy3005. Count Elements With Maximum Frequency
Count of max-freq nums
07.03.2024
easy876. Middle of the Linked List
Middle of the Linked List
06.03.2024
easy141. Linked List Cycle
Detect cycle
05.03.2024
medium1750. Minimum Length of String After Deleting Similar Ends
Min length after trimming matching prefix-suffix several times.
04.03.2024
medium948. Bag of Tokens
Max score converting power to token[i] and token[i] to score.
03.03.2024
medium19. Remove Nth Node From End of List
Remove nth node from the tail of linked list.
02.03.2024
easy977. Squares of a Sorted Array
Sorted squares.
01.03.2024
easy2864. Maximum Odd Binary Number
Max odd number string rearrangement.
29.02.2024
medium1609. Even Odd Tree
Binary tree levels are odd increasing and even decreasing.
28.02.2024
medium513. Find Bottom Left Tree Value
Leftmost node value of the last level of the Binary Tree.
27.02.2024
easy543. Diameter of Binary Tree
Max distance between any nodes in binary tree.
26.02.2024
easy100. Same Tree
Are two binary trees equal?
25.02.2024
hard2709. Greatest Common Divisor Traversal
Are all numbers connected through gcd?
24.02.2024
hard2092. Find All People With Secret
Who knows 0 and firstPerson's secret after group meetings at times: [personA, personB, time].
23.02.2024
medium787. Cheapest Flights Within K Stops
Cheapest travel src -> dst with at most k stops in a directed weighted graph.
22.02.2024
easy997. Find the Town Judge
Find who trusts nobody and everybody trusts him in [trust, trusted] array.
21.02.2024
medium201. Bitwise AND of Numbers Range
Bitwise AND for [left..right].
20.02.2024
easy268. Missing Number
Missing in [0..n] number.
19.02.2024
easy231. Power of Two
Is number 2^x?
18.02.2024
hard2402. Meeting Rooms III
Most frequent room of 0..
17.02.2024
medium1642. Furthest Building You Can Reach
Max index to climb diff = a[i +1] - a[i] > 0 using bricks -= diff and ladders-- for each.
16.02.2024
medium1481. Least Number of Unique Integers after K Removals
Min uniq count after removing k numbers.
15.02.2024
medium2971. Find Polygon With the Largest Perimeter
The largest subset sum(a[..i]) > a[i + 1] where a is a subset of array.
14.02.2024
medium2149. Rearrange Array Elements by Sign
Rearrange array to positive-negative sequence.
13.02.2024
easy2108. Find First Palindromic String in the Array
Find a palindrome.
12.02.2024
easy169. Majority Element
Element with frequency > nums.len / 2.
11.02.2024
medium1463. Cherry Pickup II
Maximum paths sum of two robots top-down in XY grid.
10.02.2024
medium647. Palindromic Substrings
Count palindromes substrings.
09.02.2024
medium368. Largest Divisible Subset
Longest subset of divisible by s[i] % s[j] == 0 || s[j] % s[i] == 0.
08.02.2024
medium279. Perfect Squares
Min square numbers sum up to n.
07.02.2024
medium451. Sort Characters By Frequency
Sort string by char's frequencies.
06.02.2024
medium49. Group Anagrams
Group words by chars in them.
05.02.2024
easy387. First Unique Character in a String
First non-repeating char position.
04.02.2024
hard76. Minimum Window Substring
Let's try to shorten the code
03.02.2024
medium1043. Partition Array for Maximum Sum
Max sum of partition array into chunks size of at most k filled with max value in chunk.
02.02.2024
medium1291. Sequential Digits
Numbers with sequential digits in low..high range.
01.02.2024
medium2966. Divide Array Into Arrays With Max Difference
Split array into tripples with at most k difference.
31.01.2024
medium739. Daily Temperatures
Array of distances to the next largest.
30.01.2024
medium150. Evaluate Reverse Polish Notation
Solve Reverse Polish Notation.
29.01.2024
easy232. Implement Queue using Stacks
Queue by 2 stacks.
28.01.2024
hard1074. Number of Submatrices That Sum to Target
Count submatrix target sums.
27.01.2024
hard629. K Inverse Pairs Array
Number of arrays of 1..n with k reversed order pairs.
26.01.2024
medium576. Out of Boundary Paths
Number of paths from cell in grid to out of boundary.
25.01.2024
medium1143. Longest Common Subsequence
Longest common subsequence of two strings.
24.01.2024
medium1457. Pseudo-Palindromic Paths in a Binary Tree
Count can-form-a-palindrome paths root-leaf in a binary tree.
23.01.2024
medium1239. Maximum Length of a Concatenated String with Unique Characters
Max length subsequence of strings array with unique chars.
22.01.2024
easy645. Set Mismatch
Return missing and duplicated number in 1..n array with one number replaced.
21.01.2024
medium198. House Robber
Max sum to rob non adjacent items in array.
20.01.2024
medium907. Sum of Subarray Minimums
Sum of minimums of all array ranges.
19.01.2024
medium931. Minimum Falling Path Sum
Min sum moving bottom center, left, right in 2D matrix.
18.01.2024
easy70. Climbing Stairs
Ways to climb n stairs by 1 or 2 steps.
17.01.2024
easy1207. Unique Number of Occurrences
Are array frequencies unique.
16.01.2024
medium380. Insert Delete GetRandom O(1)
Implement HashSet
15.01.2024
medium2225. Find Players With Zero or One Losses
[sorted winners list, sorted single lose list]
14.01.2024
medium1657. Determine if Two Strings Are Close
Are strings convertible by swapping existing chars positions or frequencies.
13.01.2024
medium1347. Minimum Number of Steps to Make Two Strings Anagram
Min operations to make string t anagram of s.
12.01.2024
easy1704. Determine if String Halves Are Alike
Let's use some Kotlin's API
11.01.2024
medium1026. Maximum Difference Between Node and Ancestor
Max diff between node and ancestor in a binary tree.
10.01.2024
medium2385. Amount of Time for Binary Tree to Be Infected
Max distance from node in a Binary Tree.
9.01.2024
easy872. Leaf-Similar Trees
Are leafs sequences equal for two trees.
8.01.2024
easy938. Range Sum of BST
Sum of BST in range [low..high].
7.01.2024
hard446. Arithmetic Slices II - Subsequence
Count of arithmetic subsequences.
6.01.2024
hard1235. Maximum Profit in Job Scheduling
Max profit in non-intersecting jobs given startTime[], endTime[] and profit[].
5.01.2024
medium300. Longest Increasing Subsequence
Longest increasing subsequence length.
4.01.2024
medium2870. Minimum Number of Operations to Make Array Empty
Minimum pairs or triples duplicate removal operations to empty array of numbers.
3.01.2024
medium2125. Number of Laser Beams in a Bank
Beams count between consequent non-empty row's 1s.
2.01.2024
medium2610. Convert an Array Into a 2D Array With Conditions
Convert numbers array into array of unique number-rows.
1.01.2024
easy455. Assign Cookies
Max count of greedy children g[Int] to assign cookies with sizes s[Int].