LeetCode Collection
Long Thinking Traces
Entries with long j-code thought sections, usually where the interesting part is the search path.
45 entries
Focused gallery for this signal, ordered by the strongest matching metric.
08.11.2025
hard1611. Minimum One Bit Operations to Make Integers Zero
Min steps to make zero by xor 1 or xor rightmost+1
2.08.2025
hard2561. Rearranging Fruits
Min swaps cost to make a==b
26.07.2025
hard3480. Maximize Subarrays After Removing One Conflicting Pair
Max subarrays count without excluded pairs-1 sweep
20.02.2026
hard761. Special Binary String
Swaps of 1M0-special substring to make string large
06.09.2025
hard3495. Minimum Operations to Make Array Elements Zero
Sum query [a..b] of optimal pairwise /4 until range is zero
06.06.2025
medium2434. Using a Robot to Print the Lexicographically Smallest String
Smallest string by writing to stack
30.11.2025
medium1590. Make Sum Divisible by P
Min removal to make sum%p
02.06.2025
hard135. Candy
Min candies, fair siblings by ratings
27.02.2026
hard3666. Minimum Operations to Equalize Binary String
Min steps to convert 01 stirng to ones flipping K
07.03.2026
medium1888. Minimum Number of Flips to Make the Binary String Alternating
Min flips to make 01 alterating string sum window
01.12.2025
hard2141. Maximum Running Time of N Computers
Max time to run n computers with batteries
09.06.2025
hard440. K-th Smallest in Lexicographical Order
k-th lexicographical number of 1..n
15.04.2025
hard2179. Count Good Triplets in an Array
Triplets in same order in both (0..n)-arrays
28.03.2026
hard2573. Find the String with LCP
Build string from longest common prefixes matrix
2.07.2025
hard3333. Find the Original Typed String II
ways to remove duplicates, preserve length at least k
12.04.2024
hard42. Trapping Rain Water
Trap the water in area between vertical walls
20.04.2025
medium781. Rabbits in Forest
Count total rabbits from other numbers
30.04.2024
medium1915. Number of Wonderful Substrings
Count substrings with at most one odd frequency manipulation
14.02.2026
medium799. Champagne Tower
Flow in a Pascal's Triangle
29.09.2025
medium1039. Minimum Score Triangulation of Polygon
Min sum of triangle product for every possible triangulation
21.08.2025
medium1504. Count Submatrices With All Ones
Count islands of 1
12.07.2025
hard1900. The Earliest and Latest Rounds Where Players Compete
First and last round Alice fight Bob
25.04.2026
hard3464. Maximize the Distance Between Points on a Square
Max of minimum distnace between selected k points on square perimeter
06.12.2025
medium3578. Count Partitions With Max-Min Difference at Most K
Ways to partition into parts (max-min) at most k queue
26.05.2024
hard552. Student Attendance Record II
N times: A -> LP, L -> AP, P -> AL, at most one A, no LLL programming
21.01.2026
medium3315. Construct the Minimum Bitwise Array II
Reverse operation x or (x+1)
11.06.2025
hard3445. Maximum Difference Between Even and Odd Frequency II
Max odd - min even frequency, window at least k
11.05.2024
hard857. Minimum Cost to Hire K Workers
Min cost of k workers each doing quality[i] work for fair rate
12.03.2026
hard3600. Maximize Spanning Tree Stability with Upgrades
Max of min values in span tree of graph, 2 s at most k
01.06.2025
medium2929. Distribute Candies Among Children II
Ways to give limited from n candies to 3 kids
24.07.2025
hard2322. Minimum Score After Removals on a Tree
Min(max group xor - min group xor) by removing 2 edges from tree
19.04.2025
medium2563. Count the Number of Fair Pairs
Pairs a + b in lower..upper pointers
25.02.2025
medium1524. Number of Sub-arrays With Odd Sum
Count odd sum subarrays sum
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
7.07.2025
medium1353. Maximum Number of Events That Can Be Attended
Max attended events
07.10.2025
medium1488. Avoid Flood in The City
Replace zeros with numbers to avoid duplicates search
8.08.2025
medium808. Soup Servings
Probability A empty first plus both empty /2
23.05.2025
hard3068. Find the Maximum Sum of Node Values
Max sum by k-xoring edges
10.11.2025
medium3542. Minimum Operations to Convert All Elements to Zero
Min ops to zeros by making min of subarrays 0 stack
05.09.2025
medium2749. Minimum Operations to Make the Integer Zero
Min ops to subtract n2+2^(0..60) from n1 and make n1=0
17.08.2025
medium837. New 21 Game
Probability sum of random(1..m) less than n when stop adding at k
25.04.2025
medium2845. Count of Interesting Subarrays
Subarrays, count a[i]%m=k is c%m=k map
20.09.2024
hard214. Shortest Palindrome
Prepend to make the shortest palindrome hash
16.12.2025
hard3562. Maximum Profit from Trading Stocks with Discounts
Max profit in a tree
18.08.2025
hard679. 24 Game
Can a,b,c,d = 24 with ops /+-()