↓Skip to main content

Easy

LeetCode 2441: Largest Positive Integer That Exists With Its Negative
·2 mins
LeetCode Easy Hash-Map Two-Pointers Sorting
LeetCode 2441 note: keep positives and absolute values of negatives in separate sets and take the largest common value; absolute values alone mistake same-sign duplicates for pairs
LeetCode 3637: Trionic Array I
·2 mins
LeetCode Easy Array
LeetCode 3637 note: walk one index through uphill, downhill and uphill; all three runs must be non-empty and reach the end exactly
LeetCode 643: Maximum Average Subarray I
·1 min
LeetCode Daily Easy Sliding-Window
LeetCode Problem Solving
LeetCode 2210: Count Hills and Valleys in an Array
·1 min
LeetCode Easy Array
LeetCode 2210 note: treat equal neighbors as one point and remember only the last non-flat direction; up then down is a hill, down then up a valley
LeetCode 1304: Find N Unique Integers Sum up to Zero
·1 min
LeetCode Easy Math Array
LeetCode 1304 note: place 1..n/2 and their negatives so each pair cancels, adding 0 when n is odd
LeetCode 3622: Check Divisibility by Digit Sum and Product
·1 min
LeetCode Easy Math
LeetCode 3622 note: compute the digit sum and product and test n % (sum + product) == 0, keeping the modulo the right way around
LeetCode 3423: Maximum Difference Between Adjacent Elements in a Circular Array
·1 min
LeetCode Easy Array
LeetCode 3423 note: circular adjacency includes the last and first elements; starting from i = 0 with nums[i - 1] covers it
LeetCode 1290: Convert Binary Number in a Linked List to Integer
·2 mins
LeetCode Easy Linked-List Bit-Manipulation Math
LeetCode 1290 note: walk head to tail, shifting the running value left by one and adding the new bit
LeetCode 3606: Coupon Code Validator
·2 mins
LeetCode Easy Hash-Table String Sorting
LeetCode 3606 note: filter valid coupons, then sort by (category order, code); character ranges must include z, Z and 9
LeetCode 3550: Smallest Index With Digit Sum Equal to Index
·1 min
LeetCode Easy Math Array
LeetCode 3550 note: check indices in increasing order, computing each digit sum; the first match is the answer
LeetCode 1979: Find Greatest Common Divisor of Array
·1 min
LeetCode Easy Math Number-Theory Gcd Array
LeetCode 1979 note: find the minimum and maximum, then take their GCD with Euclid’s algorithm
LeetCode 2094: Finding 3-Digit Even Numbers
·2 mins
LeetCode Easy Hash-Table Enumeration Array
LeetCode 2094 note: enumerate the even numbers 100 to 998 instead and check that each digit needed is available; Counter subtraction keeps only positives