↓Skip to main content

Easy

LeetCode 3903: Smallest Stable Index I
·1 min
LeetCode Easy Prefix-Sum Array
LeetCode 3903 note: the first index where the prefix maximum minus the suffix minimum is <= k; build the suffix minimum right to left first
LeetCode 3898: Find the Degree of Each Vertex
·1 min
LeetCode Easy Graph Matrix Array
LeetCode 3898 note: the number of ones in row i of the adjacency matrix is vertex i’s degree
LeetCode 1971: Find if Path Exists in Graph
·2 mins
LeetCode Easy Graph Union-Find
LeetCode note for Find if Path Exists in Graph, rebuilt from the original learning note
LeetCode 1826: Faulty Sensor
·2 mins
LeetCode Easy Two-Pointers Array
LeetCode 1826 note: at the first mismatch, test both “who dropped a value” explanations; if both fit, it cannot be determined, so return -1
LeetCode 3884: First Matching Character From Both Ends
·2 mins
LeetCode Easy Two-Pointers String
LeetCode 3884 note: compare from both ends toward the middle; the first match is the answer, and odd lengths always match in the middle
LeetCode 3842: Toggle Light Bulbs
·1 min
LeetCode Easy Hash-Table Simulation Array
LeetCode 3842 note: toggle membership in a set, or keep bulbs appearing an odd number of times, then sort
LeetCode 3838: Weighted Word Mapping
·1 min
LeetCode Easy Array String Simulation
LeetCode 3838 note: sum each word’s letter weights mod 26 and map backward: 0 -> z, i.e. chr(ord(‘z’) - r)
LeetCode 3833: Count Dominant Indices
·2 mins
LeetCode Easy Array Enumeration
LeetCode 3833 note: keep a suffix sum from the right and compare nums[i] × count > sum on the right, with no floats and without counting itself
LeetCode 3379: Transformed Array
·1 min
LeetCode Easy Array Simulation
LeetCode 3379 note: moving nums[i] steps right or left is nums[(i + nums[i]) % n]; Python’s % returns a non-negative result for negatives too
LeetCode 3827: Count Monobit Integers
·1 min
LeetCode Easy Bit-Manipulation Enumeration
LeetCode 3827 note: the only numbers with all-equal bits are 0 and 2^k - 1, so the count is (n + 1).bit_length()
LeetCode 3823: Reverse Letters Then Special Characters in a String
·2 mins
LeetCode Easy Two-Pointers String
LeetCode 3823 note: two converging-pointer passes, swapping only letters the first time and only special characters the second
LeetCode 2570: Merge Two 2D Arrays by Summing Values
·2 mins
LeetCode Easy Two-Pointers Array
LeetCode 2570 note: merge two id-sorted arrays with two pointers, adding values when ids match