{"nodes":[{"id":"absences-monotonic-lates-resettable","text":"In `checkRecord`, `absences` is monotonically increasing (global count) while `consecutive_lates` resets on every non-`'L'` character (local streak), reflecting the two different rule scopes","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/absences-monotonic-lates-resettable.json"},{"id":"abstraction-cost-predicts-convergence-strength","text":"Strategy convergence strength in an uncoordinated repo appears predictable from abstraction overhead: streaming (zero abstractions) converges strongest, hash-then-stream (one preprocessing step with Counter/set) converges next, sort-then-scan (ordering prerequisite plus pointer management) converges weakest — the adoption barrier gradient closely tracks the abstraction cost gradient.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/abstraction-cost-predicts-convergence-strength.json"},{"id":"abstraction-overhead-explains-strategy-hierarchy","text":"Non-streaming strategies require lookup abstractions (Counter, set, binary search) as load-bearing infrastructure between pipeline phases, while streaming requires none — this asymmetric abstraction overhead causally explains the strategy hierarchy: streaming dominates because it avoids the data-structure selection and initialization cost that alternatives impose on each solution author.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/abstraction-overhead-explains-strategy-hierarchy.json"},{"id":"add-strings-avoids-int-conversion","text":"`addStrings` converts between characters and digit values using `ord()/chr()` arithmetic (`ord(c) - 48`, `chr(d + 48)`) and never calls `int()` or `str()`, satisfying the problem's constraint against built-in integer conversion.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/add-strings-avoids-int-conversion.json"},{"id":"add-to-array-form-k-as-carry","text":"The add-to-array-form solution uses the input integer `k` as both the addend and carry accumulator via `k //= 10`, eliminating the need for a separate carry variable.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/add-to-array-form-k-as-carry.json"},{"id":"add-to-array-form-prepend-quadratic-worst-case","text":"When `k` has more digits than `num`, each extra digit triggers an O(n) `list.insert(0, ...)`, making the overflow phase O(d*n) rather than the O(max(n,d)) achievable with append-and-reverse.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/add-to-array-form-prepend-quadratic-worst-case.json"},{"id":"additive-then-subtractive-counting-pattern","text":"Grid geometry problems (surface area, island perimeter) use an \"add full contribution, then subtract shared faces\" strategy — computing isolated values first, then removing occlusion — as a reusable template.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/additive-then-subtractive-counting-pattern.json"},{"id":"adjacent-pair-range-minus-one","text":"`range(len(nums) - 1)` with `nums[i+1]` access is the repo's standard pattern for pairwise element comparison, preventing out-of-bounds reads on the last index.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/adjacent-pair-range-minus-one.json"},{"id":"adoption-barrier-gradient-explains-convergence-pattern","text":"The repo's multi-level convergence appears to correlate with strategy self-sufficiency: streaming, which requires no preprocessing or data structure selection, exhibits the strongest convergence, consistent with the principle that lower adoption barriers tend to produce stronger convergence pressure in an uncoordinated environment. Whether this gradient extends predictably to other paradigms (sort-then-scan, hash-then-scan) remains an observed pattern rather than a confirmed causal relationship.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/adoption-barrier-gradient-explains-convergence-pattern.json"},{"id":"algorithmic-coherence-emerges-without-engineering","text":"Despite zero cross-solution coordination and no consistency enforcement, solutions independently converge on two dominant paradigms (streaming and sort-then-scan), demonstrating that LeetCode's problem domain naturally constrains the algorithmic solution space.","truth_value":"IN","justification_count":1,"dependent_count":4,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/algorithmic-coherence-emerges-without-engineering.json"},{"id":"algorithmic-precision-despite-engineering-neglect","text":"The repo invests in algorithmic quality (exact arithmetic via isqrt, integer division; stdlib delegation for precision via Counter, set) while neglecting engineering quality (naming, structure, reusability), creating an asymmetry where computational correctness is high but code maintainability is low.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/algorithmic-precision-despite-engineering-neglect.json"},{"id":"alias-is-identity","text":"`min_time_to_remove_balloons` is a module-level alias (same function object) for `countStudents`, not a wrapper — likely exists for a test harness or problem variant that expects that name.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/alias-is-identity.json"},{"id":"alien-dict-assumes-valid-order","text":"The alien dictionary solution assumes `order` covers all characters in `words`; a missing character produces an unhandled `KeyError` — no input validation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/alien-dict-assumes-valid-order.json"},{"id":"alien-dict-function-misnamed","text":"The function solving LeetCode 953 (alien dictionary verification) is named `reverse_string`, which has nothing to do with its actual behavior — a naming bug, not an alias.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/alien-dict-function-misnamed.json"},{"id":"alien-dict-prefix-rule","text":"The alien dictionary solution explicitly enforces the prefix rule: if all shared characters match but the first word is longer, it returns `False`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/alien-dict-prefix-rule.json"},{"id":"alien-dict-rank-map-idiom","text":"The alien dictionary solution builds a `{char: index}` dict from the ordering string, converting custom-alphabet comparison to integer comparison with O(1) lookups.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/alien-dict-rank-map-idiom.json"},{"id":"all-groups-equal-length-k","text":"Every element returned by divideString has exactly k characters, guaranteed by the pad step preceding the slice step.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/all-groups-equal-length-k.json"},{"id":"all-nonalgorithmic-defects-invisible-at-runtime","text":"All engineering defects — whether sourced from the generation pipeline (naming errors, stale aliases) or from the isolation architecture (tooling confusion, convention drift, duplicated definitions) — are invisible at runtime because the submission-optimized architecture confines their blast radius to non-functional dimensions.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/all-nonalgorithmic-defects-invisible-at-runtime.json"},{"id":"all-ones-check-idiom","text":"`(m & (m + 1)) == 0` tests whether `m` is zero or all-ones up to the MSB — the complement of the `n & (n-1) == 0` power-of-two check, reusable across bit-manipulation problems.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/all-ones-check-idiom.json"},{"id":"all-solutions-pure-python-no-imports","text":"All five solutions use only Python builtins and (optionally) `typing.List` or `unittest` — none import third-party libraries or non-trivial standard library modules, keeping each solution self-contained","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/all-solutions-pure-python-no-imports.json"},{"id":"all-solutions-reduce-to-adapted-streaming","text":"Every solution in the repo is fundamentally a streaming algorithm: pure streaming solutions operate directly, while sort-then-scan and hash-then-scan solutions use preprocessing as a domain adapter that transforms the problem into one where streaming's self-sufficiency applies — making the preprocessing phase structurally optional rather than architecturally distinct.","truth_value":"IN","justification_count":1,"dependent_count":4,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/all-solutions-reduce-to-adapted-streaming.json"},{"id":"alternating-bits-o1","text":"`has_alternating_bits` runs in O(1) time and space with no loops or string conversion — pure arithmetic on two intermediate values.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/alternating-bits-o1.json"},{"id":"anagram-check-uses-sorted-canonical-form","text":"Anagram comparison in `anagramOperations` uses `sorted(word) == sorted(other)` — O(k log k) per word but avoids the complexity of frequency-counting approaches.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/anagram-check-uses-sorted-canonical-form.json"},{"id":"anagram-comparison-target-is-last-accepted","text":"Each word is compared against `result[-1]` (the last *accepted* word), not the previous word in the input — when consecutive anagrams are dropped, the comparison target stays the same until a non-anagram breaks the run.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/anagram-comparison-target-is-last-accepted.json"},{"id":"anagram-dedup-consecutive-only","text":"`anagramOperations` only collapses *consecutive* anagram runs; non-adjacent anagram pairs survive (e.g., `[\"ab\", \"cd\", \"ba\"]` returns unchanged).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/anagram-dedup-consecutive-only.json"},{"id":"anagram-mappings-duplicate-safe","text":"`anagramMappings` handles duplicate values correctly by queuing all indices per value in a `defaultdict(deque)`, with each occurrence in `nums1` consuming exactly one queued index via `pop()`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/anagram-mappings-duplicate-safe.json"},{"id":"anagram-mappings-lifo-index-order","text":"When duplicates exist, `anagramMappings` assigns indices in LIFO order (last-appended index consumed first) because `deque.pop()` removes from the right.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/anagram-mappings-lifo-index-order.json"},{"id":"anagram-ops-crashes-on-empty","text":"`anagramOperations([])` raises `IndexError` because `words[0]` is accessed unconditionally with no length check.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/anagram-ops-crashes-on-empty.json"},{"id":"anchor-tracking-pattern-shared","text":"The \"last-seen non-zero\" anchor-tracking idiom appears in both `max_captured_forts` and `countHillValley` — skip irrelevant elements, compare the current significant value to the previous one.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/anchor-tracking-pattern-shared.json"},{"id":"ap-integer-division-exact","text":"In `missing-number-in-arithmetic-progression/solution.py`, the expression `(arr[-1] - arr[0]) // n` never truncates under valid inputs because the span of a valid AP is always an exact multiple of the gap count.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ap-integer-division-exact.json"},{"id":"apples-capacity-hardcoded","text":"The basket capacity of 5000 is hardcoded in `maxNumberOfApples`, not parameterized — matching the LeetCode spec but preventing reuse with different limits.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/apples-capacity-hardcoded.json"},{"id":"apples-early-return-index","text":"`maxNumberOfApples` returns the loop index `i` (not `i+1`) on budget overflow because `enumerate` is zero-based and `i` equals the count of previously accumulated apples before the one that broke the budget.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/apples-early-return-index.json"},{"id":"apples-greedy-optimality","text":"Sorting ascending and taking greedily is provably optimal for maximizing item count under a weight budget when all items have equal value (1 apple = 1 unit).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/apples-greedy-optimality.json"},{"id":"apples-mutates-input","text":"`maxNumberOfApples` mutates the caller's list via `weight.sort()` rather than using `sorted()`, so callers cannot rely on original order being preserved.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/apples-mutates-input.json"},{"id":"apply-ops-two-phase-pattern","text":"`apply-operations-to-an-array` uses a two-phase in-place transformation: Phase 1 (pairwise doubling, left-to-right with sequential dependency) must complete before Phase 2 (zero compaction via write-pointer), and interleaving them produces incorrect results.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/apply-ops-two-phase-pattern.json"},{"id":"architecture-immune-to-own-engineering-defects","text":"The repo's architecture exhibits structural immunity to its own engineering defects: zero-coupling costs are invisible at runtime because each solution's correctness is independent, and the most prominent such cost — naming drift — serves no functional role at any layer. This means the architecture cannot be degraded by the class of inconsistencies it systematically produces; even adversarial naming errors would be absorbed without observable effect.","truth_value":"IN","justification_count":1,"dependent_count":4,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/architecture-immune-to-own-engineering-defects.json"},{"id":"arithmetic-progression-mutates-input","text":"`can_construct` calls `arr.sort()`, mutating the input list in place; callers needing the original order must pass a copy.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/arithmetic-progression-mutates-input.json"},{"id":"arithmetic-progression-sort-then-scan","text":"`can_construct` sorts the input then verifies constant consecutive difference in one pass — O(n log n) time, O(1) extra space beyond the sort.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/arithmetic-progression-sort-then-scan.json"},{"id":"arithmetic-triplets-set-lookup-linear","text":"`count_arithmetic_triplets` achieves O(n) time via set-based membership lookups, treating each element as the largest of a potential triplet and checking for `x - diff` and `x - 2*diff` in a `seen` set","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/arithmetic-triplets-set-lookup-linear.json"},{"id":"array-partition-mutates-input","text":"`nums.sort()` mutates the caller's list in-place rather than using `sorted()` to preserve the original.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/array-partition-mutates-input.json"},{"id":"array-partition-no-validation","text":"`array_pair_sum` assumes even-length input and performs no length or type checking; odd-length input silently produces a wrong answer.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/array-partition-no-validation.json"},{"id":"array-partition-sort-greedy","text":"`array_pair_sum` uses sort + even-index sum as its greedy strategy; no dynamic programming or enumeration.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/array-partition-sort-greedy.json"},{"id":"array-transform-endpoints-immutable","text":"The first and last elements of the array are never modified; only indices 1 through len-2 are candidates for change.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/array-transform-endpoints-immutable.json"},{"id":"array-transform-no-mutation","text":"The input list is copied on entry (`arr[:]`), so the caller's original list is never modified — contrasting with array-partition and assign-cookies which mutate in-place.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/array-transform-no-mutation.json"},{"id":"array-transform-simultaneous-update","text":"All comparisons in a single round use the pre-round snapshot (`arr`), not the in-progress mutations (`new`), making updates simultaneous rather than sequential.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/array-transform-simultaneous-update.json"},{"id":"array-transform-strict-comparison","text":"Only strict local minima/maxima trigger adjustments; elements equal to a neighbor are left unchanged, meaning plateaus are inherently stable.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/array-transform-strict-comparison.json"},{"id":"ascending-check-uses-sentinel-minus-one","text":"`areNumbersAscending` initializes `prev = -1`, relying on the constraint that all numbers are positive integers (1–200); any other sentinel could break the first comparison","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ascending-check-uses-sentinel-minus-one.json"},{"id":"ascending-subarray-empty-input-crashes","text":"Passing an empty list raises `IndexError` on `nums[0]`; the function relies on the LeetCode guarantee that `nums` is non-empty rather than handling this edge case.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ascending-subarray-empty-input-crashes.json"},{"id":"ascending-subarray-function-name-is-wrong","text":"The function is named `concatenated_binary` but implements maximum ascending subarray sum; this is a copy-paste naming bug that doesn't affect correctness since tests import by name.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ascending-subarray-function-name-is-wrong.json"},{"id":"ascending-subarray-resets-to-current","text":"On a non-ascending step, `current_sum` resets to the current element (not zero), because the current element is always the start of the next potential ascending subarray.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ascending-subarray-resets-to-current.json"},{"id":"ascending-subarray-uses-strict-inequality","text":"The ascending condition is strictly greater-than (`>`), not `>=`, so equal adjacent elements reset the running sum — matching the LeetCode specification.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ascending-subarray-uses-strict-inequality.json"},{"id":"ascii-32-detects-case-pairs","text":"`abs(ord(a) - ord(b)) == 32` is true if and only if `a` and `b` are the same English letter in different cases, given inputs restricted to `[a-zA-Z]`, because ASCII lower and upper variants of every letter differ by exactly 32.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ascii-32-detects-case-pairs.json"},{"id":"assign-cookies-greedy-optimal","text":"The greedy strategy (smallest sufficient cookie to least greedy child) produces a provably optimal assignment; no DP or exhaustive search needed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/assign-cookies-greedy-optimal.json"},{"id":"assign-cookies-mutates-inputs","text":"`find_content_children` mutates both input lists via in-place `.sort()`; callers cannot assume list order is preserved.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/assign-cookies-mutates-inputs.json"},{"id":"assign-cookies-zero-extra-space","text":"The two-pointer algorithm uses O(1) auxiliary space beyond the in-place sort — no heaps, hash maps, or copied arrays.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/assign-cookies-zero-extra-space.json"},{"id":"assumes-square-grid","text":"`projectionArea` uses a single `n = len(grid)` for both dimensions, relying on the LeetCode constraint that the grid is always n × n; non-square grids would produce incorrect results","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/assumes-square-grid.json"},{"id":"average-salary-divisor-assumes-length-gte-3","text":"The expression `len(salary) - 2` in the average-salary solution would produce a ZeroDivisionError if called with fewer than 3 elements; correctness relies on the problem's length guarantee.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/average-salary-divisor-assumes-length-gte-3.json"},{"id":"average-salary-single-pass-arithmetic","text":"The average-salary solution computes the trimmed mean algebraically via `(sum - min - max) / (n - 2)` using three linear scans, avoiding O(n log n) sorting entirely.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/average-salary-single-pass-arithmetic.json"},{"id":"average-salary-unique-values-invariant","text":"Correctness of the average-salary solution depends on all salary values being unique; duplicate min or max values would cause only one copy to be subtracted, producing a wrong answer.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/average-salary-unique-values-invariant.json"},{"id":"ba-substring-equivalence","text":"`\"ba\" not in s` is equivalent to \"every 'a' precedes every 'b'\" when the input contains only 'a' and 'b' — the only way to violate the ordering is a b-to-a transition, which is exactly the substring \"ba\".","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ba-substring-equivalence.json"},{"id":"backspace-compare-reverse-two-pointer-o1-space","text":"The backspace-string-compare solution uses reverse traversal with a skip counter instead of a stack, achieving O(1) auxiliary space and O(n+m) time for comparing two backspace-processed strings.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/backspace-compare-reverse-two-pointer-o1-space.json"},{"id":"balanced-strings-function-name-mismatch","text":"`find_special_integer` in `split-a-string-in-balanced-strings/solution.py` does not match the problem it solves — it's a template artifact that was never renamed, suggesting other solutions may share this issue.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/balanced-strings-function-name-mismatch.json"},{"id":"balanced-substring-always-even-result","text":"`longestBalancedSubstring` always returns an even integer (including 0) because `best` is updated as `2 * min(zeros, ones)`, and updates occur only when processing `'1'` characters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/balanced-substring-always-even-result.json"},{"id":"balanced-substring-reset-on-zero-after-ones","text":"Both `zeros` and `ones` counters reset to zero when a `'0'` follows a `'1'`, which prevents stale zero-counts from inflating results across non-contiguous balanced segments.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/balanced-substring-reset-on-zero-after-ones.json"},{"id":"balanced-substring-single-pass-counter","text":"`longestBalancedSubstring` uses a single-pass O(n) time, O(1) space counter technique — tracking running counts of consecutive zeros and ones — rather than checking all substrings or using groupby.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/balanced-substring-single-pass-counter.json"},{"id":"balanced-tree-short-circuit-propagation","text":"The balanced-binary-tree solution achieves O(n) time by short-circuiting: once any subtree returns `-1` (unbalanced), the value propagates upward immediately without recursing into sibling subtrees.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/balanced-tree-short-circuit-propagation.json"},{"id":"balloon-hardcoded-target-not-generalizable","text":"The five-argument `min(...)` in `max_number_of_balloons` encodes the word \"balloon\" directly; changing the target word requires rewriting the return expression rather than parameterizing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/balloon-hardcoded-target-not-generalizable.json"},{"id":"balloon-needs-double-l-and-o","text":"The `// 2` divisor in `max_number_of_balloons` is applied to exactly `l` and `o` counts because \"balloon\" contains two of each; all other target characters (`b`, `a`, `n`) appear once.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/balloon-needs-double-l-and-o.json"},{"id":"banned-set-conversion-for-o1-lookup","text":"`mostCommonWord` converts the `banned` list to a `set` before filtering, ensuring O(1) amortized membership checks during the counting pass.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/banned-set-conversion-for-o1-lookup.json"},{"id":"bare-function-vs-solution-class-inconsistency","text":"Some solutions use a `Solution` class with methods (e.g., `reverseVowels`, `maximumWealth`, `countPoints`) while others use bare functions (e.g., `judgeCircle`, `reverse_words_in_string`) — the repo is not consistent about which convention to use.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bare-function-vs-solution-class-inconsistency.json"},{"id":"base7-digits-lsb-first","text":"Digits in convert_to_base7 are accumulated least-significant-first via repeated `% 7` and `//= 7`, then reversed at the end — the standard accumulate-then-reverse idiom that avoids O(n) prepend costs.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/base7-digits-lsb-first.json"},{"id":"base7-sign-magnitude","text":"Negative inputs in convert_to_base7 are handled by converting to absolute value and prepending `\"-\"`, avoiding Python's floor-division behavior on negative numbers which would complicate digit extraction.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/base7-sign-magnitude.json"},{"id":"base7-zero-special-case","text":"`convert_to_base7` handles input 0 via an explicit early return; without this guard, the `while num:` loop would never execute and the function would return an empty string.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/base7-zero-special-case.json"},{"id":"baseline-then-upgrade-allocation","text":"distribute-money allocates $1 to every child first, reducing the problem to distributing `remaining` in increments of $7 — separating feasibility from optimization.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/baseline-then-upgrade-allocation.json"},{"id":"bfs-guarantees-manhattan-order","text":"BFS from a center cell on a grid with 4-directional edges produces cells in non-decreasing Manhattan distance order, because every edge has weight 1 and BFS explores layer by layer.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bfs-guarantees-manhattan-order.json"},{"id":"bfs-level-snapshot-pattern","text":"`averageOfLevels` partitions BFS into discrete levels by snapshotting `len(queue)` before each inner loop, not by using sentinels or multiple queues.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bfs-level-snapshot-pattern.json"},{"id":"bigram-empty-input-degrades-gracefully","text":"When `text` has fewer than 3 words, `range(len(words) - 2)` produces an empty range and the result is `[]` — no special-case code needed","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bigram-empty-input-degrades-gracefully.json"},{"id":"bigram-index-bound-prevents-oob","text":"`findOcurrences` uses `range(len(words) - 2)` so that `words[i+2]` is always in-bounds — no try/except or sentinel values needed","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bigram-index-bound-prevents-oob.json"},{"id":"bigram-overlap-naturally-handled","text":"Overlapping bigram matches are collected independently — a word can serve as `second` in one match and `first` in the next because each index `i` is checked without regard to prior matches","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bigram-overlap-naturally-handled.json"},{"id":"bin-count-for-popcount","text":"The repo uses `bin(n).count('1')` as the standard Python popcount idiom; no bit-manipulation tricks or `int.bit_count()` (Python 3.10+) are used","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bin-count-for-popcount.json"},{"id":"binary-gap-bit-scan-pattern","text":"`binary_gap` uses `n & 1` / `n >>= 1` right-shift scanning rather than `bin()` string conversion — the same bit-scanning idiom appears in `number-of-1-bits/solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/binary-gap-bit-scan-pattern.json"},{"id":"binary-gap-measures-adjacent-ones-only","text":"`binary_gap` measures distances between consecutive `1` bits only — `last_one` is updated on every `1` bit, so it never computes gaps between non-adjacent set bits.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/binary-gap-measures-adjacent-ones-only.json"},{"id":"binary-gap-negative-input-infinite-loop","text":"Passing a negative integer to `binary_gap` causes an infinite loop because Python's arbitrary-precision right-shift of a negative number never reaches `0`.","truth_value":"OUT","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/binary-gap-negative-input-infinite-loop.json"},{"id":"binary-search-closed-interval-style","text":"The binary search implementation uses closed-interval bounds `[left, right]` with `while left <= right`, where both endpoints are inclusive candidates — not the half-open `[left, right)` alternative.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/binary-search-closed-interval-style.json"},{"id":"binary-search-on-derived-quantities-pattern","text":"Binary searching on a derived monotonic function (like missing-count) rather than on array values directly is a recurring technique in this repo, applicable to problems like kth-missing-positive and first-bad-version.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/binary-search-on-derived-quantities-pattern.json"},{"id":"binary-search-on-value-pattern","text":"`is_perfect_square` binary-searches the range `[1, num]` for a value whose square equals `num`, achieving O(log n) time and O(1) space with no library calls.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/binary-search-on-value-pattern.json"},{"id":"binary-search-oracle-pattern","text":"`guessNumber` uses standard binary search but replaces array-index comparison with a ternary oracle function (`guess()`), making it a search over an implicit sorted sequence.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/binary-search-oracle-pattern.json"},{"id":"binary-search-variants-share-convergence-structure","text":"All binary search solutions share the same convergence loop structure (narrow [lo, hi] until they meet) but vary along three independent dimensions: what is searched (raw values vs. derived monotonic functions), bias direction (leftmost vs. rightmost match), and post-loop extraction (lo, hi, or result variable).","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/binary-search-variants-share-convergence-structure.json"},{"id":"binary-string-segment-depends-on-no-leading-zeros","text":"The `\"01\" not in s` check for at-most-one-segment-of-ones is only correct because the problem guarantees no leading zeros; without that constraint, `\"011\"` (a valid single segment) would be incorrectly rejected.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/binary-string-segment-depends-on-no-leading-zeros.json"},{"id":"binary-watch-brute-force-enumeration","text":"`readBinaryWatch` evaluates all 720 (h, m) candidates via nested `range(12) × range(60)` and filters by popcount match; there is no combinatorial generation or pruning.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/binary-watch-brute-force-enumeration.json"},{"id":"binary-watch-deterministic-order","text":"`readBinaryWatch` output is ordered hours ascending, then minutes ascending within each hour, as a direct consequence of nested `range()` iteration order.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/binary-watch-deterministic-order.json"},{"id":"bisect-right-for-strict-greater-than","text":"`bisect_right` (not `bisect_left`) is required when searching for the first element strictly greater than a target in a sorted array; `bisect_left` would incorrectly return the target itself when present.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bisect-right-for-strict-greater-than.json"},{"id":"bisect-two-neighbor-sufficiency","text":"After `bisect_left` on sorted `arr2`, checking only `arr2[pos]` and `arr2[pos-1]` is sufficient to determine if any element is within distance `d` of `val` — all other elements are provably farther away.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bisect-two-neighbor-sufficiency.json"},{"id":"bit-position-independence-principle","text":"In XOR-subset problems, each bit position contributes independently to the total sum — if any element has bit b set, exactly half of all 2^n subsets have that bit survive XOR.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bit-position-independence-principle.json"},{"id":"bit-shift-accumulation-correctness","text":"`(current << 1) | node.val` correctly builds a binary number MSB-first, equivalent to `current * 2 + node.val` — used in tree and linked-list path-to-number problems.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bit-shift-accumulation-correctness.json"},{"id":"bit-walking-over-string-conversion","text":"`even_odd_indices` walks bits via `n & 1` and `n >>= 1` rather than converting to a binary string with `bin()`, avoiding string allocation and keeping the solution at O(log n) with no dependencies.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bit-walking-over-string-conversion.json"},{"id":"both-reversal-variants-mutate-in-place","text":"Neither `reverse_list` nor `reverse_list_recursive` creates new `ListNode` instances; they rewire existing `.next` pointers, meaning the original head's `.next` is `None` after reversal.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/both-reversal-variants-mutate-in-place.json"},{"id":"boundary-handling-complete-unless-degenerate-input-escapes","text":"Streaming's structural boundary handling (sentinel initialization + early exit) combined with observed crash-freedom for degenerate inputs jointly establish that the streaming paradigm handles all boundary conditions without conditional logic — provided no degenerate input (single-element, empty, zero) escapes the sentinel+early-exit net.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"derived","url":"/public/leetcode-expert/belief/boundary-handling-complete-unless-degenerate-input-escapes.json"},{"id":"box-category-exhaustive-return","text":"`boxCategory` always returns exactly one of four string literals; the if/elif chain covers all four (bulky, heavy) combinations with no unreachable or missing branch.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/box-category-exhaustive-return.json"},{"id":"box-category-flag-then-branch","text":"`boxCategory` separates classification into two phases: compute boolean flags (`bulky`, `heavy`) from thresholds, then map the flag pair to a string label via cascading if/elif.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/box-category-flag-then-branch.json"},{"id":"box-category-short-circuit-bulky","text":"The `bulky` check uses `any(d >= 10_000 for d in ...)` joined with `or` to the volume check, so if any dimension is >= 10,000 the volume multiplication is never evaluated.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/box-category-short-circuit-bulky.json"},{"id":"box-category-trailing-space","text":"All `boxCategory` return values include a trailing space character, matching the LeetCode problem's expected output format — this is intentional, not a bug.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/box-category-trailing-space.json"},{"id":"boyer-moore-constant-space","text":"The Boyer-Moore implementation uses exactly two scalar variables (`candidate`, `count`) — O(1) auxiliary space regardless of input size.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/boyer-moore-constant-space.json"},{"id":"boyer-moore-no-verification-pass","text":"`majority_element` in `majority-element/solution.py` does not include a second pass to verify the candidate; it assumes the precondition (a majority element exists) holds, and returns an arbitrary element if violated.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/boyer-moore-no-verification-pass.json"},{"id":"broken-set-disjoint-pattern","text":"`canBeTypedWords` converts `brokenLetters` to a set and uses `set.isdisjoint` against each word, achieving O(n) time in total text length instead of O(n*b).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/broken-set-disjoint-pattern.json"},{"id":"brute-force-deletion-over-analytical","text":"`can_equal_frequency` uses O(n^2) brute-force simulation (try every single deletion) rather than an analytical O(n) approach, deliberately trading efficiency for correctness — this problem is notorious for edge-case bugs in analytical solutions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/brute-force-deletion-over-analytical.json"},{"id":"bst-inorder-no-materialized-list","text":"The BST minimum-difference solution computes the answer in O(h) stack space during traversal without collecting all node values into a list first.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bst-inorder-no-materialized-list.json"},{"id":"bst-min-diff-between-inorder-neighbors","text":"The minimum absolute difference in a BST always occurs between two values adjacent in the inorder (sorted) traversal; the solution exploits this by comparing only consecutive visits rather than all pairs.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bst-min-diff-between-inorder-neighbors.json"},{"id":"bst-property-assumed-not-validated","text":"`minDiffInBST` assumes its input is a valid BST without checking; a non-BST tree produces incorrect (possibly negative) differences silently.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bst-property-assumed-not-validated.json"},{"id":"bst-pruning-correctness","text":"`range_sum_bst` prunes the left subtree when `root.val < low` and the right subtree when `root.val > high`; this is correct only if the input is a valid BST — feeding a non-BST tree silently produces wrong results","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bst-pruning-correctness.json"},{"id":"buddy-strings-cross-match-invariant","text":"The final correctness check requires that the two differing positions cross-match (`s[i] == goal[j]` and `s[j] == goal[i]`), not merely that they differ — this is the necessary and sufficient condition for a single-swap solution.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/buddy-strings-cross-match-invariant.json"},{"id":"buddy-strings-early-exit-on-third-diff","text":"The diff-collection loop returns `False` immediately upon finding a 3rd mismatch, bounding the `diffs` list to at most length 2 and guaranteeing safe index access in the final check.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/buddy-strings-early-exit-on-third-diff.json"},{"id":"buddy-strings-equal-case-duplicate-check","text":"When `s == goal`, `buddyStrings` returns `True` only if `s` contains a duplicate character (`len(s) != len(set(s))`), because swapping two copies of the same character is the only valid \"swap that produces the same string.\"","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/buddy-strings-equal-case-duplicate-check.json"},{"id":"build-array-encode-order-safety","text":"The `% n` in `nums[nums[i]] % n` during the encode pass ensures correctness regardless of whether `nums[nums[i]]` has already been encoded earlier in the same loop iteration.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-array-encode-order-safety.json"},{"id":"build-array-in-place-modular-encoding","text":"`buildArray` encodes two values per slot as `original + n * new_value`, recoverable via `% n` (original) and `// n` (new value), achieving the O(1) extra space follow-up challenge.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-array-in-place-modular-encoding.json"},{"id":"build-array-mutates-input","text":"`buildArray` mutates and returns the input `nums` list rather than allocating a separate output array — callers lose access to the original values after the call.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-array-mutates-input.json"},{"id":"build-array-permutation-precondition","text":"The modular encoding algorithm is only correct when `nums` is a valid zero-based permutation (all values in `[0, n)`, each appearing exactly once); invalid input produces silently wrong results.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-array-permutation-precondition.json"},{"id":"build-helper-uses-list-pop-zero","text":"`_build` constructs trees via BFS using `queue.pop(0)`, which is O(n) per pop on a Python list, making tree construction O(n^2) — acceptable for small test inputs but not optimal","truth_value":"OUT","justification_count":0,"dependent_count":2,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-helper-uses-list-pop-zero.json"},{"id":"build-tree-bfs-from-level-order","text":"Tree solutions use a `build_tree` utility that constructs a `TreeNode` tree from a level-order list (LeetCode's serialization format) via BFS queue traversal, with `None` representing absent nodes.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-tree-bfs-from-level-order.json"},{"id":"build-tree-is-shared-infra","text":"`TreeNode` and `build_tree` defined in `sum-of-root-to-leaf-binary-numbers/solution.py` are imported by hundreds of test files across the repository, making that file load-bearing shared infrastructure despite being a solution file.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-tree-is-shared-infra.json"},{"id":"build-tree-level-order","text":"`_build_tree(values)` constructs a tree from a level-order (BFS) list where `None` represents absent children, matching LeetCode's standard serialization format; it is used across tree-problem test suites","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-tree-level-order.json"},{"id":"build-tree-level-order-convention","text":"`build_tree` constructs trees from level-order lists (LeetCode's serialization format) using BFS, where `None` entries represent missing nodes — this is the standard tree construction interface across the repo.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-tree-level-order-convention.json"},{"id":"build-tree-levelorder-serialization","text":"`build_tree` constructs trees level-by-level using a queue, matching LeetCode's standard level-order serialization format where `None` marks absent nodes.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-tree-levelorder-serialization.json"},{"id":"build-tree-uses-leetcode-level-order","text":"`_build_tree` constructs trees from LeetCode's standard level-order serialization format (BFS order with `None` for missing nodes), making test cases directly copy-pasteable from problem examples.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-tree-uses-leetcode-level-order.json"},{"id":"build-tree-uses-level-order","text":"`build_tree` deserializes LeetCode's bracket/level-order format using a FIFO queue (`list.pop(0)`), assigning left then right children per node; `None` entries represent absent children.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/build-tree-uses-level-order.json"},{"id":"bus-stops-clockwise-complement","text":"The counterclockwise distance is computed as `sum(distance) - clockwise` rather than by iterating the reverse path — a complement trick that avoids modular wrap-around logic.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bus-stops-clockwise-complement.json"},{"id":"bus-stops-swap-normalization","text":"The solution normalizes `start > destination` by swapping, guaranteeing `start <= destination` so that `distance[start:destination]` captures the clockwise path without wrap-around indexing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/bus-stops-swap-normalization.json"},{"id":"busyStudent-inclusive-boundaries","text":"`busyStudent` uses `s <= queryTime <= e` (inclusive on both ends), meaning a student is counted as busy when queryTime equals exactly startTime or endTime.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/busyStudent-inclusive-boundaries.json"},{"id":"buy-sell-stock-returns-zero-for-no-profit","text":"When no profitable transaction exists (monotonically decreasing prices), `maxProfit` returns `0`, never a negative number.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/buy-sell-stock-returns-zero-for-no-profit.json"},{"id":"buy-sell-stock-single-pass-greedy","text":"`maxProfit` runs in O(n) time and O(1) space by tracking the running minimum price — a Kadane's-style greedy pattern.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/buy-sell-stock-single-pass-greedy.json"},{"id":"buy-sell-stock-single-transaction-only","text":"`maxProfit` finds the best single buy-sell pair; it is not the unlimited-transactions variant (LeetCode #122).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/buy-sell-stock-single-transaction-only.json"},{"id":"calpoints-linear-time","text":"`calPoints` runs in O(n) time and O(n) space, where n is the number of operations.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/calpoints-linear-time.json"},{"id":"calpoints-no-input-validation","text":"`calPoints` assumes all inputs are valid per the LeetCode contract and raises unhandled `IndexError` or `ValueError` on malformed input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/calpoints-no-input-validation.json"},{"id":"calpoints-stack-only","text":"`calPoints` uses a single list as a stack, accessing only `[-1]` and `[-2]` — never arbitrary indexes.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/calpoints-stack-only.json"},{"id":"calpoints-strip-defensive","text":"The `op.strip()` call in `calPoints` is a defensive guard against whitespace that LeetCode inputs never contain.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/calpoints-strip-defensive.json"},{"id":"camelcase-solution-methods-snakecase-helpers","text":"Solution class methods use camelCase to match LeetCode's interface signatures, while standalone helper functions and local utilities use Python's snake_case convention.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/camelcase-solution-methods-snakecase-helpers.json"},{"id":"can-place-flowers-boundary-as-empty","text":"Array boundaries are treated as empty plots: index 0 has no left constraint and the last index has no right constraint, handled by short-circuit `or` guards rather than sentinel padding.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/can-place-flowers-boundary-as-empty.json"},{"id":"can-place-flowers-greedy-is-optimal","text":"Greedy left-to-right placement is provably optimal: planting at the earliest valid slot never reduces the number of remaining valid slots compared to any alternative placement order.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/can-place-flowers-greedy-is-optimal.json"},{"id":"can-place-flowers-mutates-input","text":"`canPlaceFlowers` modifies the `flowerbed` list in place by setting planted positions to `1`; callers who need the original must copy first.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/can-place-flowers-mutates-input.json"},{"id":"canformarray-bounds-check-before-value","text":"The inner loop checks `i >= len(arr)` before comparing `arr[i] != val`, preventing an out-of-bounds access when a piece would extend past the end of `arr`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/canformarray-bounds-check-before-value.json"},{"id":"canformarray-distinctness-required","text":"The `{p[0]: p for p in pieces}` lookup strategy is only correct because the problem guarantees all integers across all pieces are distinct; duplicate first elements would silently overwrite entries.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/canformarray-distinctness-required.json"},{"id":"canformarray-first-element-keyed-lookup","text":"`canFormArray` indexes pieces by their first element into a dict, enabling O(1) lookup at each position in `arr` — a pattern that recurs in problems with distinctness constraints.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/canformarray-first-element-keyed-lookup.json"},{"id":"canformarray-linear-time","text":"`canFormArray` runs in O(n) time where n = len(arr), visiting each element exactly once via a greedy left-to-right scan with hash-map lookups.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/canformarray-linear-time.json"},{"id":"canonical-form-frequency-counting-pattern","text":"Multiple solutions (domino pairs, good pairs, similar strings) reduce pair/group-counting problems to: canonicalize each element, count frequencies, then derive the answer from counts — avoiding O(n^2) pairwise comparison.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/canonical-form-frequency-counting-pattern.json"},{"id":"canonical-pipeline-has-exactly-two-instantiations","text":"The preprocess-then-stream pipeline has exactly two concrete forms — hash-then-stream (Counter/set for membership and frequency queries) and sort-then-stream (sorted order for positional queries) — matching the two preprocessing paradigms one-to-one with a single shared consumption phase.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/canonical-pipeline-has-exactly-two-instantiations.json"},{"id":"capitalize-title-no-builtin-titlecase","text":"The solution manually constructs title case (`w[0].upper() + w[1:].lower()`) rather than using `str.title()` or `str.capitalize()`, because the length-based conditional requires a branch regardless.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/capitalize-title-no-builtin-titlecase.json"},{"id":"capitalize-title-threshold-is-2","text":"Words of length `<= 2` are fully lowercased; words of length `>= 3` are title-cased. The boundary is at exactly 3 characters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/capitalize-title-threshold-is-2.json"},{"id":"carfleet-alias-is-dead-code","text":"`carFleet = projectionArea` in the projection-area solution is a stale alias from the automated solution generation pipeline; it is never called by tests and is unrelated to the problem","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/carfleet-alias-is-dead-code.json"},{"id":"ceiling-div-integer-idiom","text":"The codebase uses `(n + d - 1) // d` (here `(sum + 1) // 2`) as the standard integer ceiling division idiom, avoiding floating-point precision issues from `math.ceil`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ceiling-div-integer-idiom.json"},{"id":"cell-range-column-major-by-nesting","text":"`cell_range` output order is column-major (all rows for column A before column B) enforced structurally by the loop nesting order, not by a post-hoc sort.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/cell-range-column-major-by-nesting.json"},{"id":"cell-range-empty-on-inverted-bounds","text":"If the start column/row exceeds the end column/row, `cell_range` returns an empty list because `range()` produces no values — no explicit guard needed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/cell-range-empty-on-inverted-bounds.json"},{"id":"cell-range-single-char-columns","text":"`cell_range` parses the input string by fixed character positions (s[0], s[1], s[3], s[4]), so it only handles single-letter columns (A-Z) and single-digit rows (1-9).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/cell-range-single-char-columns.json"},{"id":"century-leap-year-rule-tested","text":"The `day-of-the-year` test suite covers both the century non-leap case (1900) and the 400-year leap case (2000), exercising the two most commonly missed leap-year edge cases.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/century-leap-year-rule-tested.json"},{"id":"chars-pool-shared-readonly-across-words","text":"The `chars_count` Counter is built once and reused read-only for every word check; the character pool resets between words rather than being consumed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/chars-pool-shared-readonly-across-words.json"},{"id":"chebyshev-distance-for-8dir-grid","text":"The minimum steps between two points on an 8-directional grid equals Chebyshev distance `max(|dx|, |dy|)`, not Manhattan distance `|dx| + |dy|`; diagonal moves close both axes simultaneously.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/chebyshev-distance-for-8dir-grid.json"},{"id":"check-double-even-guard","text":"The `x % 2 == 0` guard is required for correctness; without it, odd numbers would falsely match via integer division truncation (e.g., `7 // 2 = 3`)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/check-double-even-guard.json"},{"id":"check-double-insert-after-lookup","text":"`checkIfExist` inserts each element into `seen` only after checking for its double/half, which prevents self-matching at the same index","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/check-double-insert-after-lookup.json"},{"id":"check-double-linear-complexity","text":"`checkIfExist` runs in O(n) time and O(n) space via single-pass iteration with hash set lookups","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/check-double-linear-complexity.json"},{"id":"check-double-zero-pair","text":"Two zeros in the input correctly return `True` because the second zero finds `2 * 0 = 0` already in `seen` from the first zero","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/check-double-zero-pair.json"},{"id":"chips-parity-reduction","text":"Moving chips by any even distance is free, so `min_cost_to_move_chips` reduces to `min(count_odd, count_even)` — move the smaller parity group across the boundary at cost 1 each.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/chips-parity-reduction.json"},{"id":"chr-arithmetic-maps-1-to-a","text":"`chr(ord(\"a\") + num - 1)` maps integer 1 to `'a'` and integer 26 to `'z'` — the standard idiom for 1-based alphabet mapping in this repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/chr-arithmetic-maps-1-to-a.json"},{"id":"circular-distance-formula-no-modulo","text":"The circular distance between two indices in an array of size n is computed as `min(abs(i - j), n - abs(i - j))` without modular arithmetic — a recurring idiom across circular-array problems in this repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/circular-distance-formula-no-modulo.json"},{"id":"circular-distance-idiom-min-diff-n-minus-diff","text":"The `min(diff, N - diff)` idiom for shortest arc on a modular ring appears across multiple solutions including `minimum-time-to-type-word-using-special-typewriter`, `distance-between-bus-stops`, and (without wrap) `single-row-keyboard`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/circular-distance-idiom-min-diff-n-minus-diff.json"},{"id":"circular-sentence-no-split","text":"`is_circular` checks circularity by scanning for spaces as word boundaries rather than calling `str.split()`, achieving O(n) time and O(1) auxiliary space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/circular-sentence-no-split.json"},{"id":"circular-sentence-nonempty-assumed","text":"`is_circular` accesses `sentence[0]` and `sentence[-1]` unconditionally; an empty string raises `IndexError`.","truth_value":"OUT","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/circular-sentence-nonempty-assumed.json"},{"id":"circular-sentence-space-boundary-invariant","text":"The circular-sentence algorithm assumes spaces never appear at position 0 or `len(sentence)-1`; indexing `sentence[i-1]` and `sentence[i+1]` around spaces would produce wrong results or IndexError if this invariant is violated.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/circular-sentence-space-boundary-invariant.json"},{"id":"circular-sentence-wrap-check-separate","text":"The wrap-around condition (`sentence[0] != sentence[-1]`) is checked as an independent early-exit before the space-boundary loop, not unified into the main scan.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/circular-sentence-wrap-check-separate.json"},{"id":"climbing-stairs-constant-space","text":"The climbing-stairs solution uses two rolling variables (`a`, `b`) with tuple swap instead of an O(n) DP array, achieving O(1) auxiliary space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/climbing-stairs-constant-space.json"},{"id":"climbing-stairs-is-fibonacci","text":"`climbStairs(n)` computes the (n+1)th Fibonacci number — the problem is isomorphic to Fibonacci computation with base cases fib(1)=1, fib(2)=2.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/climbing-stairs-is-fibonacci.json"},{"id":"climbing-stairs-no-input-validation","text":"`climbStairs` does not guard against `n <= 0`; passing 0 returns 0, and negative values return the negative input — both incorrect but outside the LeetCode contract `1 <= n <= 45`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/climbing-stairs-no-input-validation.json"},{"id":"clock-times-enumerate-over-case-logic","text":"`count_valid_times` iterates over all 24 hours and 60 minutes (84 total iterations) and pattern-matches, rather than building conditional case tables per digit position.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/clock-times-enumerate-over-case-logic.json"},{"id":"clock-times-hour-minute-independence","text":"`count_valid_times` exploits the independence of hour and minute wildcards, computing `matching_hours * matching_minutes` instead of enumerating all 1440 combinations.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/clock-times-hour-minute-independence.json"},{"id":"clockwise-rotation-formula","text":"`mat[n-1-j][i]` maps a source position to a 90° clockwise rotation of an n×n matrix; confusing this with counterclockwise (`mat[j][n-1-i]`) would produce incorrect results.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/clockwise-rotation-formula.json"},{"id":"closed-form-preferred-over-simulation","text":"When a mathematical closed-form exists (e.g., triangular number formula for arranging-coins), the repo uses it with exact integer arithmetic (`math.isqrt`) rather than iterative simulation or binary search.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/closed-form-preferred-over-simulation.json"},{"id":"closed-form-reduction-eliminates-iteration","text":"Multiple solutions reduce seemingly iterative problems to O(1) closed-form mathematical expressions — arithmetic series, algebraic identities, or combinatorial formulas — bypassing simulation or accumulation entirely.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/closed-form-reduction-eliminates-iteration.json"},{"id":"closed-interval-overlap-formula","text":"The event conflict solution uses `a <= d and c <= b` (closed-interval overlap), meaning events sharing only a boundary moment are reported as conflicting; using `<` instead of `<=` would change this semantic.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/closed-interval-overlap-formula.json"},{"id":"closest-to-zero-positive-tiebreak","text":"When two numbers have equal absolute value, the closest-to-zero solver returns the positive one via the `num > best` guard in the update predicate.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/closest-to-zero-positive-tiebreak.json"},{"id":"closest-value-bst-ordering-assumed","text":"The directional pruning (`left if target < node.val else right`) is only correct for valid BSTs; a non-BST input silently produces wrong results with no validation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/closest-value-bst-ordering-assumed.json"},{"id":"closest-value-o-h-time-o1-space","text":"`closestValue` visits at most one node per tree level via iterative BST-directed search, making it O(h) time and O(1) space (no recursion stack).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/closest-value-o-h-time-o1-space.json"},{"id":"closest-value-requires-non-null-root","text":"`closestValue` dereferences `root.val` on the first line with no null check; passing `root=None` raises `AttributeError`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/closest-value-requires-non-null-root.json"},{"id":"closest-value-self-contained-file","text":"The closest-binary-search-tree-value `solution.py` defines `TreeNode`, the solution, a level-order tree builder (`_build`), and a full `unittest` test suite in a single file.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/closest-value-self-contained-file.json"},{"id":"closest-value-tie-break-favors-smaller","text":"When two node values are equidistant from the target, `closestValue` returns the numerically smaller value, enforced by a compound condition that prefers the smaller candidate on equal distance.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/closest-value-tie-break-favors-smaller.json"},{"id":"closure-dfs-pattern","text":"Tree solutions use closure-based DFS where the inner `dfs` function captures a `result` list from the enclosing scope, avoiding return-value plumbing while keeping the recursion signature clean.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/closure-dfs-pattern.json"},{"id":"closure-over-enclosing-scope-pattern","text":"Recursive helpers and inner functions capture variables (e.g., target values, the input string) from the enclosing method scope rather than accepting them as parameters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/closure-over-enclosing-scope-pattern.json"},{"id":"coherence-through-elimination-not-enforcement","text":"The repo exhibits architectural coherence primarily through elimination of prerequisites rather than enforcement of conventions: construction-based correctness removes the need for runtime validation, and submission-optimized isolation removes the need for cross-module coordination — together these patterns explain the characteristically lean function bodies, with this convergence emerging from LeetCode's problem structure rather than top-down design.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/coherence-through-elimination-not-enforcement.json"},{"id":"collocated-tests-pattern","text":"Some solution files contain both the implementation and a `unittest.TestCase` subclass with a `__main__` guard, in addition to the separate `test_solution.py` files used by the repo's test harness","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/collocated-tests-pattern.json"},{"id":"common-chars-assumes-nonempty-input","text":"`commonChars` indexes `words[0]` unconditionally and will raise `IndexError` on an empty list, relying on LeetCode's non-empty guarantee.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/common-chars-assumes-nonempty-input.json"},{"id":"common-chars-space-bounded-by-alphabet","text":"The Counter in `commonChars` is bounded by at most 26 keys (lowercase English letters), making space complexity O(1) regardless of input size.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/common-chars-space-bounded-by-alphabet.json"},{"id":"common-digit-always-optimal","text":"When both digit arrays share a digit, the smallest shared digit is always the answer, because any single-digit value (1-9) is strictly less than any two-digit value (11-99).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/common-digit-always-optimal.json"},{"id":"complement-count-one-pass","text":"For problems with exactly two valid target patterns (e.g., alternating binary strings), the repo counts mismatches against one pattern and derives the other as `len - count`, requiring only a single pass.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/complement-count-one-pass.json"},{"id":"complement-mask-matches-bit-length","text":"The XOR mask is exactly `n.bit_length()` bits wide (`(1 << n.bit_length()) - 1`), so only significant bits are flipped — no fixed 32-bit or 64-bit width assumption.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/complement-mask-matches-bit-length.json"},{"id":"complement-no-special-case-needed","text":"The XOR-with-mask algorithm handles all valid inputs (1 to 2^31 - 1) without branching; edge cases like single-bit numbers (e.g., `1 ^ 1 = 0`) resolve correctly through the general formula.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/complement-no-special-case-needed.json"},{"id":"complement-pure-bitwise","text":"`find_complement` uses only `bit_length()`, bit shift, and XOR — no `bin()` string conversion or iteration — achieving O(1) time and space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/complement-pure-bitwise.json"},{"id":"complement-zero-out-of-domain","text":"The `find_complement` docstring constrains `num >= 1`; passing 0 yields a degenerate result (mask is 0, output is 0) because `bit_length()` returns 0 for zero.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/complement-zero-out-of-domain.json"},{"id":"complement-zero-special-case","text":"`bitwiseComplement(0)` returns 1 via an explicit early check because `int.bit_length()` returns 0 for zero, which would make the general XOR-mask formula produce `(1 << 0) - 1 = 0` instead of 1.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/complement-zero-special-case.json"},{"id":"complete-stasis-requires-naming-invisibility","text":"The system's absorbing-state stasis — where orthogonal stabilization confines defects and the static equilibrium prevents displacement — holds only while naming defects remain invisible at the test harness boundary; a misnamed module export that causes import failures would breach dimensional confinement by converting an engineering defect into a runtime failure, introducing a feedback path capable of destabilizing the equilibrium.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/complete-stasis-requires-naming-invisibility.json"},{"id":"concat-array-no-mutation","text":"The concatenation solution uses Python's `+` operator on lists, which always allocates a new list; the input `nums` is never modified.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/concat-array-no-mutation.json"},{"id":"concat-array-wrong-method-name","text":"The concatenation-of-array solution method is named `maxValue` but should be `getConcatenation` per LeetCode 1929's expected interface — a copy-paste naming error.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/concat-array-wrong-method-name.json"},{"id":"confusing-number-leading-zeros","text":"Rotated numbers with leading zeros (e.g., 10 rotates to 01) are handled correctly because integer arithmetic silently drops leading zeros — no special-case logic needed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/confusing-number-leading-zeros.json"},{"id":"confusing-number-rotate-dict-dual-purpose","text":"The `rotate` dict serves as both a validity whitelist (membership test for rotatable digits) and a transformation function (mapping each digit to its rotation), avoiding separate validation and transformation steps.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/confusing-number-rotate-dict-dual-purpose.json"},{"id":"confusing-number-single-pass","text":"The solution extracts digits right-to-left and rebuilds the rotated number left-to-right in one pass, simultaneously reversing digit order and applying the rotation mapping in O(d) time.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/confusing-number-single-pass.json"},{"id":"confusing-number-valid-digits","text":"Only digits 0, 1, 6, 8, 9 survive 180-degree rotation; any other digit in the input causes an immediate `False` return via the `rotate` dict membership check.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/confusing-number-valid-digits.json"},{"id":"consecutive-late-reset-on-non-l","text":"Both `'A'` and `'P'` branches reset `consecutive_lates` to 0 — absences break a late streak, matching the problem's \"consecutive\" requirement","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/consecutive-late-reset-on-non-l.json"},{"id":"consecutive-requires-both-checks","text":"The consecutive-array check requires both a uniqueness test (`len(set) == n`) and a range test (`max - min + 1 == n`); either alone has false positives (`[1,1,3]` passes range-only, `[1,2,4]` passes uniqueness-only).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/consecutive-requires-both-checks.json"},{"id":"consistent-string-set-lookup","text":"`countConsistentStrings` converts `allowed` to a set exactly once, ensuring O(1) per-character membership checks rather than O(k) linear scans","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/consistent-string-set-lookup.json"},{"id":"constant-space-lowercase-constraint","text":"The first-unique-character solution is O(1) space because the problem constrains input to lowercase English letters, capping the Counter at 26 keys regardless of string length.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/constant-space-lowercase-constraint.json"},{"id":"construct2d-no-mutation","text":"`construct2DArray` never modifies the input list; all slices produce new list objects, so the output shares no mutable state with the input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/construct2d-no-mutation.json"},{"id":"construct2d-row-major-order","text":"Elements are placed into the 2D array in row-major order: `original[0..n-1]` becomes row 0, `original[n..2n-1]` becomes row 1, etc.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/construct2d-row-major-order.json"},{"id":"construction-and-isolation-jointly-eliminate-defensive-code","text":"Construction-based correctness eliminates runtime validation (no defensive checks at function boundaries), while submission-optimized isolation eliminates integration safeguards (no cross-module contracts to enforce) — together they remove both categories of defensive code that engineering discipline would normally require, explaining the repo's characteristically lean function bodies.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/construction-and-isolation-jointly-eliminate-defensive-code.json"},{"id":"construction-correctness-universal-for-valid-inputs","text":"The combined construction techniques (exact arithmetic, sentinel initialization, streaming invariants, ordering independence) achieve correct output for every input within LeetCode's stated constraints.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/construction-correctness-universal-for-valid-inputs.json"},{"id":"contains-duplicate-greedy-update","text":"Unconditionally overwriting `last_seen[num] = i` after each check is correct because any future occurrence at index `m > i` will be closer to `i` than to any earlier index — older occurrences can never produce a shorter distance.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/contains-duplicate-greedy-update.json"},{"id":"contains-pattern-bounds-safe-loop","text":"The loop bound `n - m*k + 1` in contains_pattern guarantees all slice accesses stay within array bounds without explicit bounds checking; when m*k > n the range is empty and the function returns False.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/contains-pattern-bounds-safe-loop.json"},{"id":"contains-pattern-brute-force-slicing","text":"contains_pattern uses brute-force enumeration with list slice comparison — extracting candidate patterns and checking k-1 consecutive blocks via all() — which is O(n*m*k) but acceptable for n <= 100.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/contains-pattern-brute-force-slicing.json"},{"id":"contribution-counting-replaces-enumeration","text":"`sumOddLengthSubarrays` uses per-element contribution counting — computing how many odd-length subarrays include each index — to achieve O(n) instead of O(n^2) subarray enumeration","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/contribution-counting-replaces-enumeration.json"},{"id":"convergence-attractor-coincides-with-normal-form","text":"The normal form of the solution space (streaming, an algebraic property) coincides with its convergence attractor (the strategy with strongest uncoordinated adoption, an empirical property): abstraction cost predicts convergence strength, and the normal form has zero abstraction cost, so the algebraic minimum is also the dynamic fixed point.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/convergence-attractor-coincides-with-normal-form.json"},{"id":"convergence-implies-individual-correctness","text":"Uncoordinated convergence on streaming and pipeline paradigms should produce solutions that are individually correct within their problem's input domain, because the converged-upon strategies embed correctness via construction rather than validation.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/convergence-implies-individual-correctness.json"},{"id":"convergence-without-coordination-at-every-level","text":"The repo exhibits emergent convergence at both the algorithmic level (two paradigms cover the solution space) and the correctness level (construction techniques replace validation), despite zero top-down coordination — LeetCode's problem structure alone is sufficient to drive architectural convergence across independent solutions.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/convergence-without-coordination-at-every-level.json"},{"id":"convert-mutate-join-string-idiom","text":"String manipulation problems (`reverse-only-letters`, `reverse-string-ii`) use the convert-mutate-join pattern: `list(s)` for mutability, in-place modification, then `\"\".join()` — the standard Python workaround for string immutability.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/convert-mutate-join-string-idiom.json"},{"id":"copy-paste-naming-bugs-in-solutions","text":"Some solution files have function names from other problems (e.g., `concatenated_binary` for the ascending subarray sum problem), indicating a systematic copy-paste issue during solution authoring.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/copy-paste-naming-bugs-in-solutions.json"},{"id":"copy-paste-naming-errors-cosmetic-only","text":"Method name mismatches caused by copy-paste across solution files are purely cosmetic — they affect readability but not runtime correctness or test outcomes.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/copy-paste-naming-errors-cosmetic-only.json"},{"id":"correctness-and-efficiency-unified-by-construction","text":"Some structural mechanisms serve both correctness and efficiency rather than addressing them as separate concerns: sentinel initialization can prevent boundary bugs while also eliminating first-iteration branching, and exact arithmetic can prevent precision errors while also avoiding float conversion overhead. However, the antecedents identify these as construction techniques for correctness and work-elimination strategies for efficiency respectively — the dual-purpose nature is an observed overlap rather than a demonstrated unifying principle, and the greedy-algorithm claim (simultaneous optimality guarantee and early exit) is not supported by either antecedent.","truth_value":"OUT","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/correctness-and-efficiency-unified-by-construction.json"},{"id":"correctness-and-quality-independently-dual-stabilized","text":"Both the correctness profile and the quality profile are independently stabilized by redundant dual mechanisms: correctness through paradigmatic convergence and construction techniques, quality through structural inseparability and self-reinforcing equilibrium — making the overall system resistant to perturbation in two orthogonal dimensions simultaneously.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/correctness-and-quality-independently-dual-stabilized.json"},{"id":"correctness-by-construction-not-validation","text":"Solutions achieve correctness through three construction techniques — exact arithmetic prevents precision errors, sentinel initialization eliminates boundary-condition branches, and LeetCode's input contract removes invalid-input scenarios — rather than through any form of runtime defensive checking.","truth_value":"IN","justification_count":1,"dependent_count":9,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/correctness-by-construction-not-validation.json"},{"id":"correctness-decoupled-from-engineering-quality","text":"The repo achieves a structural decoupling of correctness from engineering quality: correctness is established through dual independent mechanisms (paradigmatic convergence + construction techniques) that are immune to the engineering defects (naming drift, convention inconsistency, tooling unreliability) pervading the codebase — the two dimensions vary independently.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/correctness-decoupled-from-engineering-quality.json"},{"id":"correctness-quality-orthogonal-stability","text":"The system maintains stability in two fully orthogonal dimensions: correctness is locked by dual independent mechanisms (convergence + construction) regardless of engineering quality, and quality is in stasis at every granularity regardless of correctness mechanisms — the two dimensions are structurally decoupled, so perturbation in either cannot propagate to the other.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/correctness-quality-orthogonal-stability.json"},{"id":"correctness-through-dual-mechanisms","text":"The repo achieves within-domain correctness through two independent and mutually reinforcing mechanisms: top-down paradigmatic convergence (uncoordinated adoption of sound streaming and pipeline paradigms predicts that individual solutions should be correct) and bottom-up structural completeness (sentinel initialization, early exit, and construction techniques ensure crash-free behavior for all valid inputs including edge cases) — the convergence mechanism explains WHY solutions tend to be correct, while the construction mechanism explains HOW.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/correctness-through-dual-mechanisms.json"},{"id":"count-asterisks-linear-scan","text":"`count_stars_except_between_pair` processes input in a single O(n) pass with O(1) auxiliary space using a toggle-flag state machine.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/count-asterisks-linear-scan.json"},{"id":"count-asterisks-toggle-pairing","text":"Pipe characters in `count_stars_except_between_pair` are paired sequentially by position (1st with 2nd, 3rd with 4th) via a boolean toggle — no nesting or matching logic; the even-pipe-count precondition is trusted, not validated.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/count-asterisks-toggle-pairing.json"},{"id":"count-balls-alias-is-identity","text":"`maxWidthOfVerticalArea` is a direct class-level reference to `countBalls` (same code object), not a wrapper — likely a copy-paste artifact from a different LeetCode problem's template.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/count-balls-alias-is-identity.json"},{"id":"count-filter-reduce-idiom","text":"Multiple solutions use a three-step \"count-filter-reduce\" pattern: `Counter(nums)` → list comprehension filter → aggregation function (`max`, `sum`, etc.), each in O(n).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/count-filter-reduce-idiom.json"},{"id":"count-letters-linear-time","text":"`count_letters` runs in O(n) time because each character is consumed by exactly one iteration of the inner while loop across the entire execution","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/count-letters-linear-time.json"},{"id":"count-prefixes-duplicates-counted","text":"`countPrefixes` counts duplicate entries in `words` independently — no deduplication is applied — matching the LeetCode problem specification that identical words each contribute separately.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/count-prefixes-duplicates-counted.json"},{"id":"count-segments-uses-no-arg-split","text":"`count_segments` relies on `str.split()` without a delimiter argument, which collapses all consecutive whitespace and strips leading/trailing whitespace — distinct from `s.split(' ')` which would give wrong counts","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/count-segments-uses-no-arg-split.json"},{"id":"counter-algebra-grounds-hash-pipeline-universality","text":"Counter's algebraic completeness — encompassing construction from iterables, frequency measurement with zero-default, comparison via subtraction, and containment via drop-nonpositive semantics — is the specific mechanism that makes hash-based preprocessing universal: every hash-then-stream solution's preprocessing phase reduces to a composition of Counter's algebraic operations, and Counter's closure under these operations guarantees the preprocessing output is always a valid input to the streaming phase.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/counter-algebra-grounds-hash-pipeline-universality.json"},{"id":"counter-all-pattern","text":"divide-array-into-equal-pairs uses `Counter` + `all()` with a generator expression — `all()` short-circuits on the first odd count, giving O(n) time and O(k) space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-all-pattern.json"},{"id":"counter-before-scan-invariant","text":"The frequency map is fully built before the uniqueness scan begins; no character is evaluated against a partial count, ensuring \"unique\" means globally unique, not \"unseen so far.\"","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-before-scan-invariant.json"},{"id":"counter-deadlock-detection","text":"In `countStudents`, deadlock is detected by `count[s] == 0` — no remaining student wants the current top sandwich — and the return value is the sum of all remaining counts.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-deadlock-detection.json"},{"id":"counter-default-zero","text":"`Counter[str(i)]` returns 0 for digits not present in `num`, which is load-bearing for correctness when the expected count is also 0 — a plain `dict` would raise `KeyError`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-default-zero.json"},{"id":"counter-default-zero-drives-correctness","text":"`max_number_of_balloons` relies on `Counter.__missing__` returning 0 for absent keys; no explicit key-existence checks are needed, and missing characters naturally yield 0.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-default-zero-drives-correctness.json"},{"id":"counter-dominant-frequency-tool","text":"`Counter` from `collections` is the dominant tool across this repo for pair-counting and frequency-analysis problems, used by `max_number_of_balloons`, `countBalls`, and `count_pairs_leftovers` among others.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-dominant-frequency-tool.json"},{"id":"counter-elements-expands-by-count","text":"`Counter.elements()` yields each key repeated by its count, converting a frequency map back to a flat iterable.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-elements-expands-by-count.json"},{"id":"counter-filter-idiom","text":"Frequency-based problems use `collections.Counter` plus a generator expression to filter and aggregate, avoiding intermediate list allocation — a recurring pattern across the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-filter-idiom.json"},{"id":"counter-intersection-is-elementwise-min","text":"`Counter.__iand__` (`&=`) keeps the minimum count of each key present in both operands, implementing multi-set intersection.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-intersection-is-elementwise-min.json"},{"id":"counter-is-complete-multiset-algebra","text":"Counter provides a complete algebraic toolkit for multiset problems: construction (from iterables), measurement (frequency queries with zero-default), comparison (subtraction as containment test), and combination (intersection as element-wise min), making it the single abstraction sufficient to cover the entire multiset problem class without supplementary data structures.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/counter-is-complete-multiset-algebra.json"},{"id":"counter-max-frequency-pattern","text":"`best_poker_hand` uses `max(Counter(ranks).values())` for duplicate detection — this idiom recurs across multiple LeetCode solutions in the repo for frequency-based classification.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-max-frequency-pattern.json"},{"id":"counter-max-keys-bounded-by-digit-sum","text":"The Counter produced by `countBalls` has at most 45 entries (max digit sum for a 5-digit number in [1, 100000]), making space O(1) regardless of input range size.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-max-keys-bounded-by-digit-sum.json"},{"id":"counter-missing-key-returns-zero","text":"The `countWords` solution relies on `Counter.__missing__` returning 0 for absent keys — `c2[w] == 1` implicitly rejects words not in `words2` without an explicit membership check.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-missing-key-returns-zero.json"},{"id":"counter-most-common-double-unwrap","text":"`most_common(1)[0][0]` is the standard idiom across this repo's frequency-based solutions to extract the mode element from a `Counter` — first `[0]` selects the top `(element, count)` tuple, second `[0]` extracts the element.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-most-common-double-unwrap.json"},{"id":"counter-outlier-pattern","text":"Using `Counter` to find a unique element among a group reduces the problem from O(n^2) pairwise comparison to O(n) frequency lookup — this pattern recurs across solutions like `majority-element` and `single-number` variants","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-outlier-pattern.json"},{"id":"counter-over-simulation-pattern","text":"`countStudents` replaces O(n^2) queue simulation with O(n) frequency counting via `Counter`, recognizing that queue position determines eating order but not eating possibility.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-over-simulation-pattern.json"},{"id":"counter-pattern-dominates-frequency-problems","text":"Frequency-counting problems in this repo (`most-common-word`, `most-frequent-even-element`, `most-frequent-number-following-key`) consistently use `collections.Counter` with generator-based filtering rather than manual dict accumulation or `defaultdict(int)`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-pattern-dominates-frequency-problems.json"},{"id":"counter-set-len-one-idiom","text":"`len(set(Counter(s).values())) == 1` is the canonical Python idiom for \"all character frequencies are equal\" and is used across multiple solutions in this repo for uniformity checks.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-set-len-one-idiom.json"},{"id":"counter-sub-empty-means-containment","text":"`not (A - Counter(B))` is true iff B contains at least as many of every key as A; this Counter subtraction idiom (which drops zero/negative counts) is the sole correctness mechanism for the completing-word check.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-sub-empty-means-containment.json"},{"id":"counter-subtraction-as-subset-check","text":"`countCharacters` uses `not (Counter(word) - chars_count)` as a sub-multiset containment check — Counter subtraction drops zero/negative counts, so emptiness means every character in the word is available with sufficient multiplicity.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-subtraction-as-subset-check.json"},{"id":"counter-subtraction-drops-nonpositive","text":"`Counter.__sub__` discards keys with zero or negative counts; an empty result after `A - B` means `A` is a sub-multiset of `B`.","truth_value":"IN","justification_count":0,"dependent_count":2,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-subtraction-drops-nonpositive.json"},{"id":"counter-subtraction-is-multiset-containment-test","text":"Counter subtraction serves as a multiset containment test across the repo: the drop-nonpositive semantics of `Counter.__sub__` mean that an empty result after `A - B` is equivalent to B containing at least as many of every element as A, and `not (A - B)` is the idiomatic one-expression sub-multiset check — replacing explicit key-by-key iteration with a single algebraic operation.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"derived","url":"/public/leetcode-expert/belief/counter-subtraction-is-multiset-containment-test.json"},{"id":"counter-then-deduplicate-idiom","text":"Frequency-based problems follow a two-step pattern: build a frequency map with `Counter`, then apply a predicate (uniqueness, equality, sorting) over the counts.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-then-deduplicate-idiom.json"},{"id":"counter-two-pass-frequency-pipeline","text":"Frequency-based problems follow a standard two-pass pipeline: Counter construction in O(n) followed by a linear scan over the frequency map, with the scan phase specializing across three modes — uniqueness finding (first/kth element with count==1), extremal extraction (max frequency), and group counting (how many keys match a frequency predicate).","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"derived","url":"/public/leetcode-expert/belief/counter-two-pass-frequency-pipeline.json"},{"id":"counter-two-pass-max-then-count","text":"`countLargestGroup` uses a two-pass pattern over Counter values — first `max()` to find the largest group size, then a second pass to count groups matching that max — rather than a single-pass or heap approach.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-two-pass-max-then-count.json"},{"id":"counter-two-pass-uniqueness-pattern","text":"The Counter + linear-rescan pattern (count occurrences first, then iterate in original order to find the kth/first unique element) is a recurring idiom across this repo's uniqueness problems.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-two-pass-uniqueness-pattern.json"},{"id":"counter-universal-frequency-primitive","text":"Counter from collections is the dominant abstraction in this repo for frequency counting, pair-counting, and multiset comparison, with its zero-default behavior, subtraction semantics, and filtering patterns consistently preferred over manual dict accumulation across the surveyed solutions.","truth_value":"IN","justification_count":1,"dependent_count":5,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/counter-universal-frequency-primitive.json"},{"id":"counter-zero-default-for-missing-keys","text":"Frequency-comparison solutions rely on `Counter.__getitem__` returning 0 for absent keys, allowing direct subtraction (`freq1[c] - freq2[c]`) without `.get()` or `defaultdict`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counter-zero-default-for-missing-keys.json"},{"id":"counting-beats-sorting-for-single-target","text":"When a problem asks for indices of a single target value in a sorted array, counting elements less-than and equal-to the target gives O(n) time vs O(n log n) for actually sorting, since equal elements are always contiguous in sorted order.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counting-beats-sorting-for-single-target.json"},{"id":"counting-bits-dp-recurrence","text":"`countBits` computes popcount via `ans[i] = ans[i >> 1] + (i & 1)`, decomposing each value's popcount into its right-shifted prefix plus its LSB, achieving O(1) per element.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counting-bits-dp-recurrence.json"},{"id":"counting-bits-zero-init-is-base-case","text":"The `[0] * (n + 1)` initialization serves double duty: it allocates the output array and establishes the base case `ans[0] = 0` without a separate assignment.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counting-bits-zero-init-is-base-case.json"},{"id":"counting-elements-iterates-arr-not-set","text":"`count_elements` iterates the original list (not the set) so duplicates contribute independently to the count — `[1, 1, 2]` returns 2, not 1.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counting-elements-iterates-arr-not-set.json"},{"id":"counting-elements-successor-only","text":"`count_elements` checks strictly `x + 1 in s`; predecessor existence (`x - 1`) does not contribute to the count.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counting-elements-successor-only.json"},{"id":"counting-vs-simulation-for-origin-return","text":"`judgeCircle` determines origin return by counting opposing moves (`L==R` and `U==D`) rather than simulating coordinates, exploiting the mathematical insight that horizontal and vertical axes are independent.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/counting-vs-simulation-for-origin-return.json"},{"id":"cousins-bfs-resets-per-level","text":"`isCousins` resets `x_parent` and `y_parent` to `None` at the start of each BFS level, ensuring it never falsely compares nodes found at different depths.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/cousins-bfs-resets-per-level.json"},{"id":"cousins-early-exit-on-depth-mismatch","text":"If only one of `x` or `y` is found at a BFS level, `isCousins` returns `False` immediately without visiting deeper levels, since different depths means they cannot be cousins.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/cousins-early-exit-on-depth-mismatch.json"},{"id":"cousins-parent-identity-comparison","text":"`isCousins` compares parents with `!=` (object identity) rather than value equality, which is correct because `TreeNode` has no `__eq__` override — two nodes with the same value at different positions are distinct objects.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/cousins-parent-identity-comparison.json"},{"id":"covered-array-size-assumes-constraint","text":"The hardcoded array size 51 in the range-coverage solution relies on the problem constraint that all values are in [1, 50]; inputs outside this range cause IndexError or silent corruption.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/covered-array-size-assumes-constraint.json"},{"id":"crawler-log-depth-clamped-at-zero","text":"`minOperations` enforces `depth >= 0` via `max(0, depth - 1)` on `\"../\"` operations — navigating above root is a no-op, matching filesystem semantics.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/crawler-log-depth-clamped-at-zero.json"},{"id":"crawler-log-depth-is-answer","text":"`minOperations` returns the raw depth counter directly, relying on the invariant that each child entry adds exactly 1 depth and each `\"../\"` removes exactly 1.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/crawler-log-depth-is-answer.json"},{"id":"crawler-log-implicit-child-entry","text":"Any log string that isn't `\"../\"` or `\"./\"` is treated as entering a child folder — there is no validation of the folder name, so malformed strings silently increment depth.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/crawler-log-implicit-child-entry.json"},{"id":"cross-product-avoids-division-by-zero","text":"The collinearity check in `check-if-it-is-a-straight-line` uses cross-product multiplication `(x-x0)*dy - (y-y0)*dx == 0` rather than slope division, making it correct for vertical lines and exact for integer coordinates without epsilon tolerance.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/cross-product-avoids-division-by-zero.json"},{"id":"cross-product-for-collinearity","text":"Collinearity checks use the cross product (`(x2-x1)*(y3-y1) - (y2-y1)*(x3-x1) != 0`) instead of slope comparison, avoiding division-by-zero edge cases and floating-point precision issues.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/cross-product-for-collinearity.json"},{"id":"current-stays-after-skip","text":"When `delete_duplicates` finds a duplicate and skips it via `current.next = current.next.next`, the `current` pointer does not advance — this is required to handle runs of 3+ identical values.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/current-stays-after-skip.json"},{"id":"cursor-streaming-unifies-input-multiplicity","text":"Cursor-based streaming — monotonic pointer progression with state accumulation — is a unified framework that handles arbitrary input multiplicity: two-pointer handles single-input problems (convergence, compaction, inward sweep) while merge-scan handles dual-input problems (sorted intersection, alternating merge), varying only cursor count and advancement rules while preserving the core streaming invariants of monotonic progress and O(n) termination.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/cursor-streaming-unifies-input-multiplicity.json"},{"id":"cycle-detection-uses-identity-not-equality","text":"Cycle detection in linked-list-cycle uses `is` (object identity), not `==` (value equality) — two distinct nodes with the same `val` never produce a false positive.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/cycle-detection-uses-identity-not-equality.json"},{"id":"date-problems-mixed-stdlib-manual","text":"Date problems in the repo use inconsistent strategies: `day-of-the-week` delegates to `datetime.date.weekday()`, while `day-of-the-year` performs all calendar math manually with a lookup table and no `datetime` import.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/date-problems-mixed-stdlib-manual.json"},{"id":"date-to-day-string-slicing","text":"`_date_to_day` uses fixed-position slicing (`[:2]`, `[3:5]`) rather than delimiter splitting, requiring strictly zero-padded `\"MM-DD\"` format input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/date-to-day-string-slicing.json"},{"id":"day-of-week-trailing-space","text":"`day_of_the_week` returns day names with a trailing space (e.g., `\"Monday \"` not `\"Monday\"`), which is load-bearing for test compatibility with LeetCode's expected output format.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/day-of-week-trailing-space.json"},{"id":"days-in-month-immutable-constant","text":"`DAYS_IN_MONTH` is a module-level list that is never mutated at runtime; leap-year handling uses conditional addition (`+1`) rather than modifying the table.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/days-in-month-immutable-constant.json"},{"id":"days-in-month-table-1-indexed","text":"The `days_in_month` lookup table in `daysBetweenDates` uses index 0 as a dummy sentinel (value 0) so months 1–12 map directly to their natural positions without offset arithmetic","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/days-in-month-table-1-indexed.json"},{"id":"days-list-rebuilt-per-call","text":"In `number_of_days`, the 12-element month-days lookup table is a local variable allocated on every call, not a module-level constant — functionally correct but not cached","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/days-list-rebuilt-per-call.json"},{"id":"days-together-inclusive-endpoints","text":"The `+ 1` in the overlap formula `max(0, min(a1, b1) - max(a0, b0) + 1)` means both arrival and departure days count as days spent together — this is a closed-interval convention.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/days-together-inclusive-endpoints.json"},{"id":"de-facto-treenode-infra-efficient","text":"The TreeNode infrastructure (shared via inline copies across 400+ test files) provides both correct and efficient tree construction from level-order arrays.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/de-facto-treenode-infra-efficient.json"},{"id":"decode-message-first-occurrence-wins","text":"The substitution cipher is built by mapping each letter to its first occurrence position in the key; duplicate letters are skipped via a `not in table` guard, making the mapping order-dependent and deterministic.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/decode-message-first-occurrence-wins.json"},{"id":"defaultdict-set-for-group-membership","text":"`countPoints` uses `defaultdict(set)` to accumulate colors per rod, which automatically deduplicates repeated color placements — a pattern also used in pangram-checking and consistent-string problems across the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/defaultdict-set-for-group-membership.json"},{"id":"defaults-enable-streaming-self-sufficiency","text":"Counter's zero-default for missing keys and sentinel initialization for loop state are not independent convenience features but structurally coupled components of the streaming paradigm: both encode boundary conditions into initial state so that the streaming loop body requires no special-case logic — well-chosen defaults are the mechanism that makes streaming self-sufficient rather than requiring explicit setup.","truth_value":"OUT","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/defaults-enable-streaming-self-sufficiency.json"},{"id":"defaults-encode-domain-knowledge-at-every-layer","text":"Solutions rely on well-chosen default values at both the data-structure level (Counter's zero-default for missing keys enables implicit frequency counting) and the algorithm level (sentinel initialization for loop boundaries eliminates first-iteration special cases), using the same principle — absence of data carries semantic meaning — at different abstraction layers.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/defaults-encode-domain-knowledge-at-every-layer.json"},{"id":"defect-confinement-from-orthogonal-stabilization","text":"Engineering defects are permanently confined to their originating dimension as a structural consequence of orthogonal stabilization: triple stabilization guarantees that no perturbation in the quality dimension can cascade into correctness or immunity failures, and the equilibrium property of harmless defect permanence confirms that this confinement is self-maintaining — defects neither propagate across dimensions nor accumulate toward a phase transition within their own dimension.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/defect-confinement-from-orthogonal-stabilization.json"},{"id":"defects-permanent-but-structurally-harmless","text":"Engineering defects occupy a paradoxical equilibrium: they are permanently frozen (no mechanism can remediate them under the isolation architecture) and structurally harmless (inseparable from the quality inversion that makes algorithmic quality high), so defects function as permanent features of the architecture rather than obstacles to correctness.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/defects-permanent-but-structurally-harmless.json"},{"id":"defense-investment-tracks-judge-reward-signal","text":"The selective defense pattern (invest in efficiency-improving conditions like early exit, skip robustness-improving conditions like input validation) is a specific instantiation of the quality equilibrium: the LeetCode judge rewards algorithmic efficiency but is indifferent to engineering robustness, so defensive investment follows the reward gradient exactly.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/defense-investment-tracks-judge-reward-signal.json"},{"id":"defuse-the-bomb-brute-force-complexity","text":"The defuse-the-bomb solution runs in O(n * |k|) time by re-summing the window from scratch at every position, rather than using a sliding window or prefix sum for O(n).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/defuse-the-bomb-brute-force-complexity.json"},{"id":"defuse-the-bomb-self-exclusion","text":"The summation loop starts at `j = 1`, ensuring `code[i]` is never included in its own replacement value — a correctness invariant of the decryption rule.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/defuse-the-bomb-self-exclusion.json"},{"id":"degree-single-pass-three-dicts","text":"The degree-of-an-array solution populates `count`, `first`, and `last` dictionaries in a single O(n) enumeration, then reduces over degree-tied elements to find the minimum span — no second scan of the input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/degree-single-pass-three-dicts.json"},{"id":"degree-span-minimum-over-ties","text":"The degree-of-an-array return value considers all elements tied at the maximum frequency, not just the first one found — `min(last[n] - first[n] + 1 for n in count if count[n] == degree)`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/degree-span-minimum-over-ties.json"},{"id":"delete-cols-assumes-uniform-length","text":"`minDeletionSize` uses `len(strs[0])` for the column count and indexes all other strings at the same positions — ragged input causes silent wrong results or `IndexError`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/delete-cols-assumes-uniform-length.json"},{"id":"delete-cols-early-exit","text":"The inner loop in `minDeletionSize` breaks on the first out-of-order pair per column, avoiding redundant comparisons after a violation is found.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/delete-cols-early-exit.json"},{"id":"delete-cols-native-char-compare","text":"Column sortedness is checked via Python's native `<` on single characters, which is correct only for uniform-case single-byte alphabets (the problem guarantees lowercase a-z).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/delete-cols-native-char-compare.json"},{"id":"delete-duplicates-requires-sorted-input","text":"Correctness of `delete_duplicates` depends on non-decreasing order; unsorted input produces silently wrong results since only adjacent nodes are compared.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/delete-duplicates-requires-sorted-input.json"},{"id":"delete-duplicates-returns-same-head","text":"`delete_duplicates` always returns the exact same `head` object it received (or `None` for empty input); it never allocates or replaces the head node.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/delete-duplicates-returns-same-head.json"},{"id":"delete-nodes-head-never-changes","text":"`deleteNodes` always returns the original `head` pointer unchanged because the first m nodes are always kept and m >= 1 is guaranteed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/delete-nodes-head-never-changes.json"},{"id":"delete-nodes-keep-loop-off-by-one","text":"The keep-phase iterates `m - 1` times (not `m`) because `current` already points to the first node being kept — an easy-to-misread boundary.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/delete-nodes-keep-loop-off-by-one.json"},{"id":"delete-nodes-tolerates-short-lists","text":"Both the keep and delete phases exit early via null checks if the list is exhausted before completing `m` or `n` steps — no crash on short inputs.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/delete-nodes-tolerates-short-lists.json"},{"id":"delete-nodes-zero-allocation","text":"The delete-N-after-M algorithm creates no new `ListNode` instances — it only rewires `.next` pointers on existing nodes, using O(1) extra space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/delete-nodes-zero-allocation.json"},{"id":"delta-array-off-by-one-correct","text":"In `maxAliveYear`, the death-year decrement at `delta[death - 1950]` correctly models exclusive death semantics: a person born in 1990 who dies in 2000 contributes to years 1990–1999 only.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/delta-array-off-by-one-correct.json"},{"id":"depth-zero-marks-primitive-boundaries","text":"In `removeOuterParentheses`, the depth counter returns to exactly 0 at the end of each primitive decomposition component and nowhere else within it — this structural property is what the algorithm exploits to avoid explicit delimiter detection.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/depth-zero-marks-primitive-boundaries.json"},{"id":"deque-never-empty-during-eviction","text":"In the recent-calls solution, the `while self.q[0] < t - 3000` loop cannot raise IndexError because the just-appended `t` always satisfies the window boundary, preventing full drain","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/deque-never-empty-during-eviction.json"},{"id":"deque-sliding-window-pattern","text":"Sliding window problems use `collections.deque` with front-eviction for O(1) amortized operations, relying on the invariant that inputs arrive in sorted order so stale entries are always at the front","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/deque-sliding-window-pattern.json"},{"id":"destcity-empty-input-guard","text":"destCity raises ValueError on empty input; all other preconditions (valid path structure, linear chain) are trusted from the problem statement without validation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/destcity-empty-input-guard.json"},{"id":"destcity-linear-time-and-space","text":"destCity runs in O(n) time and O(n) space with two passes over the paths list: one to build the source set, one to find the non-source destination.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/destcity-linear-time-and-space.json"},{"id":"destcity-set-difference-approach","text":"destCity solves the terminal-city problem via set membership — builds a set of source cities, then finds the first destination absent from it — avoiding graph construction entirely.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/destcity-set-difference-approach.json"},{"id":"detect-capital-counting-reduction","text":"detectCapitalUse counts uppercase characters in a single O(n) pass via generator expression, then derives all three valid patterns (all-upper, all-lower, first-only-upper) from that single count.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/detect-capital-counting-reduction.json"},{"id":"detect-capital-no-empty-guard","text":"detectCapitalUse accesses word[0] without a length check and will raise IndexError on empty input, relying on LeetCode's guarantee that len(word) >= 1.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/detect-capital-no-empty-guard.json"},{"id":"dfs-null-guard-at-callsite","text":"In tree DFS solutions, the inner recursive function is only called on non-None nodes — null checks happen at the call site before recursing into children, not inside the recursive function body.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/dfs-null-guard-at-callsite.json"},{"id":"dfs-short-circuits-via-and-chain","text":"Tree DFS solutions use Python's `and` short-circuit evaluation (`node.val == target and dfs(left) and dfs(right)`) to stop traversal immediately on the first failing condition.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/dfs-short-circuits-via-and-chain.json"},{"id":"di-string-match-greedy-correctness","text":"Placing the current minimum on 'I' and current maximum on 'D' always produces a valid permutation without backtracking; correctness follows from the fact that any remaining unused value is strictly greater than the current min and strictly less than the current max.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/di-string-match-greedy-correctness.json"},{"id":"di-string-match-loop-postcondition","text":"After the for-loop in DI String Match, `low == high` holds unconditionally (the loop consumes n values from a pool of n+1), so the final append always places exactly the one remaining unused value.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/di-string-match-loop-postcondition.json"},{"id":"diagonal-sum-linear-time","text":"The solution runs in O(n) time with a single pass over row indices, not O(n^2) over the full matrix.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/diagonal-sum-linear-time.json"},{"id":"diagonal-sum-n1-correctness","text":"For a 1x1 matrix, the loop adds the element twice and the odd-correction subtracts it once, yielding the correct result through the general path rather than special-case code.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/diagonal-sum-n1-correctness.json"},{"id":"diagonal-sum-no-input-validation","text":"The function assumes `mat` is a non-empty square matrix and performs no shape or type validation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/diagonal-sum-no-input-validation.json"},{"id":"diagonal-sum-overcounting-correction","text":"The center element is double-counted by the loop when n is odd, and the post-loop subtraction is the sole mechanism that corrects this.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/diagonal-sum-overcounting-correction.json"},{"id":"diameter-not-necessarily-through-root","text":"The diameter algorithm correctly finds longest paths that don't pass through the root by checking `left_height + right_height` at every node during the DFS, not just at the root.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/diameter-not-necessarily-through-root.json"},{"id":"diameter-returns-edges-not-nodes","text":"`diameter_of_binary_tree` returns the number of edges on the longest path, not the number of nodes; a single-node tree returns 0, not 1.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/diameter-returns-edges-not-nodes.json"},{"id":"dict-dispatch-over-conditionals","text":"`countMatches` maps string keys to positional indices via a dictionary literal (`{\"type\": 0, \"color\": 1, \"name\": 2}[ruleKey]`) rather than an if/elif chain — a pattern worth checking for reuse in other key-to-index solutions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/dict-dispatch-over-conditionals.json"},{"id":"diet-plan-no-input-validation","text":"`dietPlanPerformance` performs no validation; if `k > len(calories)` the loop never executes and produces a single (possibly incorrect) evaluation rather than raising an error.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/diet-plan-no-input-validation.json"},{"id":"diet-plan-sliding-window-o-n","text":"The diet plan solution runs in O(n) time and O(1) space by computing the first window sum once, then incrementally adding the entering element and subtracting the leaving element.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/diet-plan-sliding-window-o-n.json"},{"id":"diet-plan-threshold-exclusive","text":"Scores change only when the window sum is strictly less than `lower` or strictly greater than `upper`; sums exactly equal to either threshold produce no score change.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/diet-plan-threshold-exclusive.json"},{"id":"diff-tuple-hashable-for-counter","text":"The difference array in `odd-string-difference` is returned as a tuple (not list) specifically so it can be used as a `Counter` key — switching to list would break the frequency counting","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/diff-tuple-hashable-for-counter.json"},{"id":"difference-array-technique","text":"`maxAliveYear` uses the difference-array (sweep-line) pattern: record +1 at birth and -1 at death, then prefix-sum to reconstruct population, achieving O(n + R) instead of O(n * R).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/difference-array-technique.json"},{"id":"digit-accumulation-is-greedy","text":"Consecutive digits in `abbr` are always parsed as a single number via a greedy inner `while` loop (e.g., `\"12\"` means skip 12, not skip 1 then skip 2).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-accumulation-is-greedy.json"},{"id":"digit-count-alias-is-bound-method","text":"`rearrange_array` is a bound method on a throwaway `Solution()` instance, not a standalone function; this is the repo convention for exposing a uniform entry point to tests","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-count-alias-is-bound-method.json"},{"id":"digit-count-misnamed-alias","text":"The alias `rearrange_array` has no semantic relationship to the digit-count problem; it's likely a copy-paste artifact from the project's code generation pipeline","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-count-misnamed-alias.json"},{"id":"digit-extraction-modular-idiom","text":"The `n % 10` / `n //= 10` loop for digit extraction is a recurring idiom across dozens of solutions in this repo (e.g., `self-dividing-numbers`, `alternating-digit-sum`, `add-digits`, `subtract-the-product-and-sum-of-digits-of-an-integer`)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-extraction-modular-idiom.json"},{"id":"digit-extraction-prefers-mod-arithmetic","text":"Multiple solutions (`sum-of-digits-in-base-k`, `sum-of-digits-in-the-minimum-number`) extract digits via `% 10` / `// 10` loops rather than string conversion, avoiding allocation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-extraction-prefers-mod-arithmetic.json"},{"id":"digit-extraction-uses-modular-arithmetic","text":"Digit extraction across the repo uses `% 10` / `//= 10` modular arithmetic exclusively, avoiding `str()` conversion and intermediate string allocations.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-extraction-uses-modular-arithmetic.json"},{"id":"digit-operations-handle-all-nonneg-inputs","text":"String-based digit manipulation solutions correctly handle all non-negative integer inputs including zero and multi-digit numbers.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-operations-handle-all-nonneg-inputs.json"},{"id":"digit-remapping-greedy-targets-positional-extremes","text":"Digit remapping achieves both its minimum and maximum through a single greedy digit substitution targeting the most positionally impactful digit — the leading digit maps to 0 for minimum (maximum positional weight), the leftmost non-9 digit maps to 9 for maximum (highest available gain) — sharing the same structural principle (leftmost-significant substitution) despite targeting opposite extremes.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/digit-remapping-greedy-targets-positional-extremes.json"},{"id":"digit-sum-min-returns-binary","text":"`sum_of_digits` returns exactly 0 or 1 (even/odd parity of the minimum element's digit sum), never any other value.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-sum-min-returns-binary.json"},{"id":"digit-sum-no-validation","text":"`digitSum` performs no input validation; non-digit characters raise `ValueError` from `int(c)`, and `k=0` raises `ValueError` from `range(0, len(s), 0)`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-sum-no-validation.json"},{"id":"digit-sum-pure-function","text":"`digitSum` has no side effects — it rebinds `s` each iteration rather than mutating it, and does not modify `self` or external state.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-sum-pure-function.json"},{"id":"digit-sum-terminates","text":"Each iteration of the `while len(s) > k` loop produces a strictly shorter string (summing `d` digits yields at most `ceil(log10(9d+1))` characters, which is less than `d` for `d >= 2`), guaranteeing termination for valid inputs.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-sum-terminates.json"},{"id":"digit-sum-via-str-conversion","text":"`countBalls` computes digit sums by casting to string and summing character values (`sum(int(d) for d in str(i))`), not by arithmetic divmod.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digit-sum-via-str-conversion.json"},{"id":"digital-root-zero-special-case","text":"The digital root formula `1 + (n-1) % 9` requires an explicit `num == 0` guard because `(-1) % 9 == 8` in Python, which would return 9 instead of 0.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digital-root-zero-special-case.json"},{"id":"digits-dividing-num-no-zero-guard","text":"`digits_dividing_num` will raise `ZeroDivisionError` if any digit of the input is zero, since there is no guard before the `num % digit` expression","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digits-dividing-num-no-zero-guard.json"},{"id":"digits-dividing-num-order-independent","text":"Digits are processed right-to-left but the result is order-independent since each digit's divisibility is checked against the unchanged original `num`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digits-dividing-num-order-independent.json"},{"id":"digits-dividing-num-preserves-input","text":"The original `num` parameter is never modified during digit extraction; a separate variable `n` is consumed by the `n % 10` / `n //= 10` loop","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/digits-dividing-num-preserves-input.json"},{"id":"distance-value-empty-arr2-correct","text":"When `arr2` is empty, `findTheDistanceValue` correctly returns `len(arr1)` because `bisect_left` returns 0 and both boundary guards fail, so no element is marked too close.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/distance-value-empty-arr2-correct.json"},{"id":"distance-value-mutates-arr2","text":"`findTheDistanceValue` mutates the input `arr2` in-place via `.sort()` rather than using `sorted()`, reordering the caller's list as a side effect.","truth_value":"OUT","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/distance-value-mutates-arr2.json"},{"id":"distance-value-sort-bisect-complexity","text":"`findTheDistanceValue` runs in O(m log m + n log m) time via sort + binary search, versus O(n*m) for brute-force nested loop.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/distance-value-sort-bisect-complexity.json"},{"id":"distinct-averages-mutates-input","text":"`distinctAverages` calls `nums.sort()` which mutates the caller's list in-place; no defensive copy is made.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/distinct-averages-mutates-input.json"},{"id":"distinct-elements-enables-first-element-argmax","text":"With distinct elements, the lexicographically largest subarray of length k always starts at the position of the maximum value in `nums[0:n-k+1]` — no need to compare subsequent elements.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/distinct-elements-enables-first-element-argmax.json"},{"id":"distinct-numbers-o1-mathematical-reduction","text":"`distinct_numbers(n)` is an O(1) closed-form solution: returns 1 if `n == 1`, else `n - 1`, based on the insight that `x % (x-1) == 1` cascades from `n` down to `2`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/distinct-numbers-o1-mathematical-reduction.json"},{"id":"distinct-numbers-steady-state-cascade","text":"For `n >= 2`, the board stabilizes to `{2, 3, ..., n}` because each `x % (x-1) == 1` adds the next smaller number, halting at 2 since `2 % 1 == 0`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/distinct-numbers-steady-state-cascade.json"},{"id":"distribute-candies-greedy-min","text":"The answer to \"distribute candies\" is always `min(n//2, len(set(candyType)))` — the tighter of two independent upper bounds (eating quota vs. distinct types available), a constraint-as-min greedy pattern.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/distribute-candies-greedy-min.json"},{"id":"distribute-candies-to-people-index-mapping","text":"The circular person assignment `(give - 1) % num_people` depends on `give` being 1-based; changing it to 0-based would require removing the `- 1` or the mapping breaks by off-by-one.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/distribute-candies-to-people-index-mapping.json"},{"id":"distribute-candies-to-people-no-overcounting","text":"`min(give, candies)` ensures total distributed never exceeds the original candy count, even though `candies -= give` can drive the counter negative before the loop guard catches it.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/distribute-candies-to-people-no-overcounting.json"},{"id":"distribute-candies-to-people-sqrt-time","text":"The distribution simulation runs O(sqrt(candies)) iterations because the sum 1+2+...+k reaches `candies` when k ≈ sqrt(2*candies), making it sublinear in the candy count.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/distribute-candies-to-people-sqrt-time.json"},{"id":"divisible-pairs-loop-guarantees-uniqueness","text":"The inner loop `j in range(i + 1, n)` ensures each unordered pair `(i, j)` is visited exactly once with `i < j` always satisfied, preventing duplicates by construction.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/divisible-pairs-loop-guarantees-uniqueness.json"},{"id":"divisible-pairs-value-check-short-circuits-modulo","text":"Python's `and` short-circuits, so the `(i * j) % k == 0` modulo is only evaluated when `nums[i] == nums[j]` — the cheaper equality check gates the arithmetic.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/divisible-pairs-value-check-short-circuits-modulo.json"},{"id":"divisor-game-parity-invariant","text":"Alice wins the Divisor Game if and only if n is even; the proof relies on Alice always subtracting 1 from even n to hand Bob an odd number, maintaining the invariant. The solution is O(1).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/divisor-game-parity-invariant.json"},{"id":"docstrings-capture-problem-constraints","text":"Docstrings in solution files document LeetCode problem constraints (e.g., input ranges) rather than implementation details, preserving the original problem spec alongside the code.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/docstrings-capture-problem-constraints.json"},{"id":"domain-constraints-sufficient-for-algorithmic-not-engineering-convergence","text":"Domain constraints from the problem space are sufficient to produce algorithmic convergence (a closed three-strategy taxonomy emerges without coordination) but insufficient for engineering convergence (naming, testing, and structure all drift without enforcement) — algorithmic consistency is pulled by the domain, engineering consistency must be pushed by process.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/domain-constraints-sufficient-for-algorithmic-not-engineering-convergence.json"},{"id":"domain-determines-complete-system-character","text":"The LeetCode domain is a primary explanatory factor for two systematic properties of the codebase: (1) the quality equilibrium, where the judge reward signal selects for algorithmic investment over engineering robustness and structural constraints make this profile a stable attractor, and (2) the complete taxonomic structure, where both the three-strategy partition and the dual classification-optimization pipeline emerge from problem-space constraints alone. Together these suggest that domain constraints account for major systematic patterns in the codebase, though this does not preclude additional influences from individual developer decisions or coordination mechanisms.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/domain-determines-complete-system-character.json"},{"id":"domain-is-fixed-point-of-quality-dynamics","text":"The LeetCode domain constitutes a fixed point of quality dynamics: the judge reward signal selects for algorithmic investment over engineering robustness, while the domain's structural constraints make this investment profile a stable attractor — the system not only converges to this quality profile but cannot leave it through any internal evolutionary pressure.","truth_value":"IN","justification_count":1,"dependent_count":4,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/domain-is-fixed-point-of-quality-dynamics.json"},{"id":"domain-selects-stable-quality-attractor","text":"The repo's quality profile (high algorithmic sophistication, low engineering discipline) is a stable attractor selected by the domain itself: LeetCode's problem structure produces a closed strategy taxonomy that converges without coordination, and only algorithmic quality is rewarded by the judge — making any perturbation toward engineering investment self-correcting back to the current equilibrium.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/domain-selects-stable-quality-attractor.json"},{"id":"domain-sufficient-for-complete-taxonomic-structure","text":"Domain constraints from the problem space are sufficient to produce algorithmic convergence — including the closed three-strategy partition of the solution space — without coordination. The pipeline decomposition that emerges from these constraints additionally serves a dual role as both classification criterion and optimization mechanism. However, while the taxonomic structure and its dual classification-optimization character arise naturally from problem structure, engineering-level consistency (naming, testing, code structure) requires active process enforcement beyond what domain constraints alone provide.","truth_value":"OUT","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/domain-sufficient-for-complete-taxonomic-structure.json"},{"id":"dominance-via-second-max-sufficiency","text":"Checking `max_val >= 2 * second_max` is sufficient to verify dominance over all elements, because if the max is at least twice the second-largest, it is at least twice every smaller element — used in `largest-number-at-least-twice-of-others`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/dominance-via-second-max-sufficiency.json"},{"id":"dominant-pipeline-mutation-has-zero-observable-consequence","text":"The sort-then-two-pointer pipeline's primary side effect — in-place sort mutation of the input array — has zero observable consequence because the single-call LeetCode context ensures no caller ever inspects the mutated ordering, making the most prevalent form of input modification in the entire codebase functionally invisible.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/dominant-pipeline-mutation-has-zero-observable-consequence.json"},{"id":"double-mod-deficit-formula","text":"The expression `(k - n % k) % k` is the standard formula for \"units to add to make n a multiple of k\" — the outer mod collapses the already-aligned case from k to 0.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/double-mod-deficit-formula.json"},{"id":"double-reversal-method-name-mismatch","text":"`a-number-after-a-double-reversal/solution.py` names its method `minOperations` instead of the expected `isSameAfterReversals` — a copy-paste naming error.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/double-reversal-method-name-mismatch.json"},{"id":"doubling-loop-always-terminates","text":"The while loop in `find_final_value` always terminates because `original` strictly increases (doubles) each iteration and the lookup set has a finite maximum value.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/doubling-loop-always-terminates.json"},{"id":"dp-bounded-lookback-reduces-to-streaming","text":"Dynamic programming with bounded lookback reduces to the streaming paradigm's dominant shape: replacing an O(n) DP table with O(1) rolling variables transforms a DP recurrence into a single-pass scan with scalar accumulators — proving that streaming's coverage extends beyond pure accumulation problems to subsume a class of dynamic programming problems.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/dp-bounded-lookback-reduces-to-streaming.json"},{"id":"dp-rolling-reduction-correct-unless-degenerate-input","text":"The DP-to-rolling-variable reduction extends the O(1)-space running accumulator pattern from streaming to dynamic programming, collapsing O(n) DP tables to O(1) rolling variables while preserving recurrence correctness for all inputs within LeetCode constraints.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"derived","url":"/public/leetcode-expert/belief/dp-rolling-reduction-correct-unless-degenerate-input.json"},{"id":"dp-to-streaming-via-rolling-variable-reduction","text":"The min-cost-climbing-stairs solution demonstrates the general DP-to-streaming reduction: an O(n) DP table with bounded lookback (each cell depends on only the previous two) collapses to O(1) rolling variables while preserving the recurrence's loop invariant, with the final answer requiring a min over the last two states because the top is reachable from either.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/dp-to-streaming-via-rolling-variable-reduction.json"},{"id":"dsu-pattern-in-sorting-solutions","text":"`sort_names_by_height` uses the decorate-sort-undecorate pattern (`zip` + `sorted` + comprehension unpacking), which is the idiomatic Python approach for sorting one list by another and recurs across sorting problems in this repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/dsu-pattern-in-sorting-solutions.json"},{"id":"dual-description-proves-unique-canonical-form","text":"The solution space possesses a provably unique canonical form: elimination and streaming independently arrive at the same extremal minimality (elimination via constructive proof through mathematical reduction, streaming via convergence-attractor coincidence with algebraic normal form), and their demonstrated duality means any alternative characterization must reduce to this one — two independent proof paths converging on the same object establishes uniqueness, not merely equivalence.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/dual-description-proves-unique-canonical-form.json"},{"id":"dual-impl-pattern-tree-problems","text":"Tree problems in this repo sometimes provide both recursive and iterative implementations, with tests asserting both produce identical results for all inputs.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/dual-impl-pattern-tree-problems.json"},{"id":"dual-interface-pattern","text":"Some solution files provide both a `Solution` class method and a standalone function with identical logic, giving callers a choice of interface.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/dual-interface-pattern.json"},{"id":"dummy-head-sentinel-pattern","text":"`remove_elements` and `from_list` both use a dummy sentinel node (`ListNode(next=head)`) so that operations at the head position require no special-case branching — this pattern recurs across linked list solutions in the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/dummy-head-sentinel-pattern.json"},{"id":"dummy-sentinel-pattern","text":"The dummy/sentinel head pattern (allocate a throwaway node, build via `tail.next`, return `dummy.next`) is the standard linked-list construction idiom in this repo, used in both solution algorithms and test helpers like `from_list`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/dummy-sentinel-pattern.json"},{"id":"duplicate-zeros-boundary-zero-special-case","text":"When the last surviving element is a zero that lands exactly at position n, it receives only one copy to avoid array overrun — this edge case is handled before the main copy loop.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/duplicate-zeros-boundary-zero-special-case.json"},{"id":"duplicate-zeros-right-to-left-prevents-overwrite","text":"duplicate-zeros uses a two-pass right-to-left copy: first pass counts surviving zeros to find the write-head start, second pass copies backward so `j >= i` always holds and writes never destroy unread source data.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/duplicate-zeros-right-to-left-prevents-overwrite.json"},{"id":"duplicates-are-irrelevant","text":"Converting `nums` to a set discards count information, which is correct because the problem only requires existence checks, not frequency — duplicate values in the input do not affect the result.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/duplicates-are-irrelevant.json"},{"id":"duplication-cost-free-when-implementations-correct","text":"Per-problem code duplication (TreeNode definitions, tree builders, test helpers) carries zero maintenance cost as long as every copy is correct — there is no shared module to fix once, but there is also nothing to break.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/duplication-cost-free-when-implementations-correct.json"},{"id":"duplication-over-shared-infrastructure","text":"Data structures and helpers are systematically duplicated per problem directory rather than factored into shared modules, trading DRY for zero coupling across 400+ solutions.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/duplication-over-shared-infrastructure.json"},{"id":"early-exit-accumulator-pattern","text":"`checkRecord` returns `False` immediately upon hitting 2 absences or 3 consecutive lates, never scanning characters beyond the first disqualifying condition","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/early-exit-accumulator-pattern.json"},{"id":"early-exit-and-sentinel-jointly-eliminate-boundary-code","text":"Early-exit patterns eliminate branch code for post-violation states (computation end), while sentinel initialization eliminates branch code for first-iteration special cases (computation start) — together they remove boundary-handling logic from both ends of the computation, leaving only the core invariant-maintaining loop body.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/early-exit-and-sentinel-jointly-eliminate-boundary-code.json"},{"id":"early-exit-bounds-diffs","text":"The `len(diffs) > 2` guard inside the loop guarantees that `diffs` has at most 2 elements when the post-loop branches execute, making the final match safe without bounds checking","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/early-exit-bounds-diffs.json"},{"id":"early-exit-correctness","text":"The `if j > min_sum: break` in `findRestaurant` is correct because all index map values are non-negative, guaranteeing `idx_sum >= j`; once `j` exceeds the current best sum, no future candidate can improve the answer.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/early-exit-correctness.json"},{"id":"early-exit-on-impossible-partition","text":"The decomposable-substrings solution short-circuits to `False` on the first character run with `length % 3 == 1`, since no valid tiling of 2s and 3s can cover that remainder without exceeding the exactly-one-two constraint.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/early-exit-on-impossible-partition.json"},{"id":"early-exit-on-overshoot","text":"The length check `len(prefix) > len(s)` guarantees the prefix-building loop terminates as soon as the accumulated string exceeds the target, bounding runtime to O(len(s))","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/early-exit-on-overshoot.json"},{"id":"early-exit-optimizations-pervasive","text":"Solutions systematically use early-exit and short-circuit patterns to avoid unnecessary computation, returning on first-found violations, matches, or threshold crossings.","truth_value":"IN","justification_count":1,"dependent_count":4,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/early-exit-optimizations-pervasive.json"},{"id":"early-return-on-first-match","text":"`containsNearbyDuplicate` returns `True` on the first duplicate found within distance `k`, short-circuiting the rest of the scan.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/early-return-on-first-match.json"},{"id":"edge-case-inputs-crash-free","text":"Solutions handle degenerate inputs (empty strings, zero, single-element collections) without runtime crashes.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/edge-case-inputs-crash-free.json"},{"id":"element-sum-gte-digit-sum","text":"For positive integers, element sum is always >= digit sum (a multi-digit number always exceeds the sum of its digits), so the `abs()` call in the solution is a no-op guard rather than a functional requirement.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/element-sum-gte-digit-sum.json"},{"id":"elimination-and-reduction-are-isomorphic","text":"The three elimination axes and the three-tier reduction hierarchy are isomorphic characterizations of the same structural phenomenon: computation elimination maps to mathematical reduction (closed-form replaces iteration), validation elimination maps to streaming's self-sufficiency (no prerequisites to eliminate), and coupling elimination maps to the preprocessing adapter pattern (isolation removes inter-solution dependencies that would otherwise require coordination).","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/elimination-and-reduction-are-isomorphic.json"},{"id":"elimination-and-streaming-are-dual-descriptions","text":"The elimination principle (removing validation, coupling, and complexity at the architectural level) and the streaming paradigm (retaining only minimal single-pass computation at the algorithmic level) are dual descriptions of the same structural phenomenon: the three elimination axes map onto the three reduction tiers via their shared isomorphism, and streaming's universality-minimality coincidence is the computational realization of elimination's architectural minimality.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/elimination-and-streaming-are-dual-descriptions.json"},{"id":"elimination-explains-defect-confinement-mechanism","text":"Defect confinement is a direct structural consequence of the elimination principle's operation through duality: elimination removes the coupling channels (validation paths, shared imports, cross-module state) through which engineering defects could propagate to runtime behavior, and since streaming — elimination's dual — requires none of these channels, the confinement is not merely observed but mechanistically explained by the same force that shapes the solution space.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/elimination-explains-defect-confinement-mechanism.json"},{"id":"elimination-has-constructive-minimality-proof","text":"The elimination principle possesses a constructive proof of its own extremal minimality: mathematical reduction collapses streaming's scan to constant-time evaluation (proving streaming is not yet minimal), and since elimination and reduction are isomorphic, the mathematical solutions serve as constructive witnesses that the elimination framework reaches a unique minimal fixed point — the point where no further elimination is possible because the computation itself has been reduced to a single evaluation.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/elimination-has-constructive-minimality-proof.json"},{"id":"elimination-is-universal-structural-explanation","text":"Elimination (of requirements, of coupling, of validation) is the universal structural explanation for both the repo's strengths and weaknesses: the same construction-plus-isolation pattern that creates algorithmic coherence without coordination also makes the quality inversion structurally inseparable — algorithmic sophistication and engineering neglect are not independent phenomena but two faces of requirement elimination.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/elimination-is-universal-structural-explanation.json"},{"id":"elimination-operates-through-three-complementary-axes","text":"The elimination principle that explains the repo's character operates through three complementary axes targeting different categories of conventionally-required code: structural elimination (construction-based correctness removes validation and boundary logic), architectural elimination (per-problem isolation removes coupling and coordination), and computational elimination (mathematical reduction removes iterative simulation) — each axis is independently sufficient for its category and jointly they account for the repo's entire deviation from standard engineering practice.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/elimination-operates-through-three-complementary-axes.json"},{"id":"elimination-unifies-structural-and-quality-explanations","text":"Elimination operates as a single generative principle from which the system's complete character follows across both dimensions: in the quality dimension, elimination removes coupling channels through duality, explaining why defects remain permanently confined to their originating dimension; in the structural dimension, elimination's dual descriptions (streaming and reduction) independently arrive at the same extremal minimality, proving canonical form uniqueness. The system's structure and its quality profile are both consequences of the same underlying principle.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/elimination-unifies-structural-and-quality-explanations.json"},{"id":"else-branch-assumes-twenty","text":"In lemonade-change, any bill value that isn't 5 or 10 falls through to the else branch and is treated as a $20 with no validation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/else-branch-assumes-twenty.json"},{"id":"empty-broken-letters-returns-all-words","text":"When `brokenLetters` is empty, `canBeTypedWords` returns the total word count because an empty set is disjoint with every word.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/empty-broken-letters-returns-all-words.json"},{"id":"empty-collection-as-error-signal","text":"Solutions return empty collections (e.g., `[]`) for invalid inputs rather than raising exceptions, following LeetCode's convention of using the return type as the error signal.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/empty-collection-as-error-signal.json"},{"id":"empty-input-returns-zero","text":"`max_value` returns 0 for an empty operations list without error, consistent with the \"start at 0\" specification.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/empty-input-returns-zero.json"},{"id":"empty-input-returns-zero-majority","text":"`majority_element([])` returns `0` without raising, because the loop never executes and `candidate` retains its initial value of `0`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/empty-input-returns-zero-majority.json"},{"id":"empty-prefix-never-compared","text":"`is_prefix_string` checks equality after appending each word, so the empty string is never compared; this is safe given LeetCode's `1 <= s.length` constraint but would incorrectly return `False` for `s = \"\"`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/empty-prefix-never-compared.json"},{"id":"empty-ransom-note-always-constructible","text":"`can_construct(\"\", magazine)` returns `True` for any `magazine` (including empty string), because `Counter(\"\") - Counter(anything)` is empty.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/empty-ransom-note-always-constructible.json"},{"id":"empty-string-always-matches-substring","text":"An empty string `\"\"` in `patterns` always increments the count in `numOfStrings`, because `\"\" in word` is `True` for any string `word`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/empty-string-always-matches-substring.json"},{"id":"empty-string-returns-zero","text":"`count_letters(\"\")` returns 0 without any special-case code, handled implicitly by the outer while-loop guard","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/empty-string-returns-zero.json"},{"id":"empty-target-raises","text":"`maxNumberOfCopies(s, \"\")` raises `ValueError` because `min()` receives an empty generator when `Counter(target)` is empty.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/empty-target-raises.json"},{"id":"empty-word-always-consistent","text":"An empty string `\"\"` counts as consistent because `all()` returns `True` on an empty iterable — this is Python semantics, not special-case code","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/empty-word-always-consistent.json"},{"id":"endpoint-preservation-invariant","text":"The missing-number-in-AP algorithm's correctness depends on the guarantee that the removed element is never the first or last element, so `arr[0]` and `arr[-1]` are the true endpoints of the original progression.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/endpoint-preservation-invariant.json"},{"id":"energy-experience-independence","text":"The minimum training hours solution decomposes into two independent subproblems — energy (single sum check) and experience (sequential simulation) — and sums their training costs.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/energy-experience-independence.json"},{"id":"engineering-debt-permanently-frozen","text":"Engineering inconsistencies (naming drift, dual test conventions, style divergence) are permanently frozen because the submission-optimized architecture provides no feedback signal for engineering quality — the quality inversion is a stable equilibrium that can only be broken if naming drift causes observable runtime failures, creating a feedback channel that the current architecture lacks.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/engineering-debt-permanently-frozen.json"},{"id":"enumerate-and-filter-over-generate","text":"The finding-3-digit-even-numbers solution iterates the answer space (450 even 3-digit numbers) rather than generating permutations from input, avoiding combinatorial explosion and deduplication.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/enumerate-and-filter-over-generate.json"},{"id":"eof-detected-by-short-read","text":"In the read4 solution, EOF is detected solely by `read4` returning fewer than 4 characters; there is no separate EOF flag or sentinel.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/eof-detected-by-short-read.json"},{"id":"epoch-projection-date-comparison","text":"`daysBetweenDates` projects both dates onto an absolute day count from a fixed epoch, reducing date comparison to integer subtraction — a standard technique that avoids case-splitting on month lengths and year boundaries","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/epoch-projection-date-comparison.json"},{"id":"equilibrium-is-absorbing-state","text":"The system occupies an absorbing state of its quality dynamics: orthogonal stabilization confines defects to their origin dimension (no cross-dimensional migration), while the fully characterized static equilibrium prevents any force from displacing the system along any dimension, jointly guaranteeing that no trajectory — neither improvement nor degradation — leads out of the current quality profile.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/equilibrium-is-absorbing-state.json"},{"id":"evaltree-and-is-fallthrough-default","text":"`evalTree` checks `val == 2` for OR and falls through to AND for any other value — there is no explicit `val == 3` check, so any non-2 internal node val is silently treated as AND.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/evaltree-and-is-fallthrough-default.json"},{"id":"evaltree-leaf-detection-left-only","text":"`evalTree` detects leaf nodes by checking only `root.left is None`, never checking `root.right` — this is correct only under the full binary tree invariant where every non-leaf has exactly two children.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/evaltree-leaf-detection-left-only.json"},{"id":"evaltree-no-short-circuit-benefit","text":"`evalTree` evaluates both subtrees via recursive calls before applying OR/AND, so Python's short-circuit operators provide no performance benefit — both branches are always fully traversed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/evaltree-no-short-circuit-benefit.json"},{"id":"even-case-uses-two-chars","text":"When n is even, the output contains exactly two distinct characters with counts (n-1, 1), both odd","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/even-case-uses-two-chars.json"},{"id":"exact-arithmetic-prevents-all-precision-errors","text":"The combination of stdlib-delegated exact data structures (Counter for exact frequencies, set for exact membership) and construction-based exact arithmetic (isqrt, integer division, sentinel initialization) should prevent all precision-related errors across the repo.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/exact-arithmetic-prevents-all-precision-errors.json"},{"id":"exact-consumption-invariant","text":"`validWordAbbreviation` returns `True` only when both pointers `i` and `j` reach exactly the end of `word` and `abbr` respectively; partial consumption of either string is always `False`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/exact-consumption-invariant.json"},{"id":"exactness-over-performance-at-every-layer","text":"Solutions systematically choose exact representations — integer arithmetic over floating-point, string-based digit extraction over modular arithmetic, isqrt over sqrt — prioritizing correctness guarantees over micro-optimization at every computational layer.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/exactness-over-performance-at-every-layer.json"},{"id":"excel-column-bijective-base-26","text":"Excel column numbering is bijective base-26 (digits 1–26, no zero), not standard base-26 — this is why `convert_to_title` needs `columnNumber -= 1` each iteration and why `title_to_number` uses `ord(c) - ord('A') + 1`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/excel-column-bijective-base-26.json"},{"id":"excel-column-horner-method","text":"`title_to_number` evaluates the column string as a base-26 polynomial using Horner's method: process left-to-right, accumulating `result * 26 + digit_value` per character in a single O(n) pass.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/excel-column-horner-method.json"},{"id":"excel-column-title-lsb-first-then-reverse","text":"`convert_to_title` builds the output string least-significant-digit-first (appending to a list), then reverses at the end — this avoids O(n²) cost from repeated string prepend.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/excel-column-title-lsb-first-then-reverse.json"},{"id":"exhausted-iterator-returns-space","text":"When the compressed string is fully consumed, `StringIterator.next()` returns `' '` (space) indefinitely, matching the LeetCode spec's sentinel value.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/exhausted-iterator-returns-space.json"},{"id":"experience-requires-simulation","text":"Unlike energy (which reduces to `max(0, sum(energy) + 1 - initialEnergy)`), experience must be simulated sequentially because wins compound the player's running experience total.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/experience-requires-simulation.json"},{"id":"extend-or-reset-canonical-consecutive-pattern","text":"The single-pass \"extend current run or reset counter\" idiom is the canonical approach for all consecutive-element problems, with in-loop max updates eliminating post-loop fixup.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/extend-or-reset-canonical-consecutive-pattern.json"},{"id":"extend-or-reset-pattern","text":"Multiple solutions (`findLengthOfLCIS`, `checkZeroOnes`) use the same single-pass \"extend or reset\" pattern: maintain a running counter for the current window, extend when the condition holds, reset when it doesn't","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/extend-or-reset-pattern.json"},{"id":"fair-candy-swap-delta-formula","text":"The swap requirement `a - b = (sumA - sumB) / 2` reduces a two-variable search to a one-variable lookup; integer division is safe because the difference is always even when a valid swap exists.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fair-candy-swap-delta-formula.json"},{"id":"fair-candy-swap-set-complement-search","text":"Fair Candy Swap uses the same set-based complement search pattern as Two Sum: build a hash set from one collection, then scan the other checking for computed complements — O(n+m) time, O(m) space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fair-candy-swap-set-complement-search.json"},{"id":"fallback-removes-last-occurrence","text":"When no greedy opportunity exists (every occurrence of `digit` is followed by an equal-or-smaller digit or is terminal), the algorithm removes the rightmost occurrence to preserve the most significant larger digits.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fallback-removes-last-occurrence.json"},{"id":"fancy-string-lookback-two","text":"The make-fancy-string skip decision depends only on the last two characters of the result list, making it a fixed-window greedy algorithm with O(n) time.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fancy-string-lookback-two.json"},{"id":"fast-null-guard-sufficient-for-both-pointers","text":"The `while fast and fast.next` guard in `hasCycle` is sufficient for both pointers because `slow` never advances past `fast` in a non-cyclic list.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fast-null-guard-sufficient-for-both-pointers.json"},{"id":"faulty-sensor-indeterminate-when-suffix-trivial","text":"When the first mismatch is at or beyond index `n-1`, `badSensor` returns `-1` because both shift hypotheses are vacuously satisfiable on the empty/trivial suffix.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/faulty-sensor-indeterminate-when-suffix-trivial.json"},{"id":"faulty-sensor-mutual-exclusion-decides","text":"`badSensor` returns a definitive answer (1 or 2) only when exactly one shift hypothesis matches; if both or neither hold, it returns `-1`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/faulty-sensor-mutual-exclusion-decides.json"},{"id":"faulty-sensor-slice-comparison-is-o-n","text":"The two slice equality checks in `badSensor` each copy and compare up to `n` elements, making the algorithm O(n) time and O(n) space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/faulty-sensor-slice-comparison-is-o-n.json"},{"id":"fill-cups-closed-form","text":"`min_seconds` computes the answer as `max(max(amount), ceil(sum(amount)/2))` in O(1) time rather than simulating the greedy filling process, because both lower bounds are provably achievable.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fill-cups-closed-form.json"},{"id":"final-min-required","text":"The `result += min(prev, curr)` after the loop in `count_binary_substrings` is load-bearing — removing it undercounts by the contribution of the last two character groups.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/final-min-required.json"},{"id":"final-prices-monotone-stack-linear-time","text":"`finalPrices` achieves O(n) time via a monotone stack where each index is pushed and popped at most once.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/final-prices-monotone-stack-linear-time.json"},{"id":"final-prices-no-input-mutation","text":"`finalPrices` copies the input list before modifying it, so the caller's original list is never changed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/final-prices-no-input-mutation.json"},{"id":"final-prices-stack-holds-unresolved-indices","text":"During iteration, the monotone stack contains indices of items that have not yet found a discount — items still waiting for a `prices[j] <= prices[i]` with `j > i`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/final-prices-stack-holds-unresolved-indices.json"},{"id":"final-prices-uses-geq-not-gt","text":"The stack pops on `>=` (not `>`), meaning equal prices qualify as discounts — matching the problem's \"less than or equal\" condition.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/final-prices-uses-geq-not-gt.json"},{"id":"find-center-minimum-two-edges","text":"`find_center` unconditionally indexes `edges[0]` and `edges[1]`, requiring at least two edges (3+ nodes); fewer edges raises `IndexError`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/find-center-minimum-two-edges.json"},{"id":"find-difference-output-always-two-lists","text":"`findDifference` always returns a list of exactly two sub-lists, each containing only distinct values, regardless of input duplicates or overlap.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/find-difference-output-always-two-lists.json"},{"id":"find-difference-output-order-undefined","text":"The order of elements within each output sub-list of `findDifference` is not deterministic — it follows set iteration order.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/find-difference-output-order-undefined.json"},{"id":"find-difference-reduce-no-initial-value","text":"`findTheDifference` calls `reduce` without an initial value, so it raises `TypeError` if both `s` and `t` are empty (empty sequence with no initial value).","truth_value":"OUT","justification_count":0,"dependent_count":3,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/find-difference-reduce-no-initial-value.json"},{"id":"find-difference-set-minus-idiom","text":"`findDifference` uses Python's set `-` operator for symmetric difference — converts both inputs to sets, then computes `set1 - set2` and `set2 - set1`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/find-difference-set-minus-idiom.json"},{"id":"find-difference-xor-no-extra-space","text":"`findTheDifference` uses O(1) auxiliary space — the generator feeding `reduce` is lazy, so no list or counter is materialized.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/find-difference-xor-no-extra-space.json"},{"id":"find-k-iterates-deduplicated-set","text":"`find_K` iterates over `num_set` (the deduplicated set) rather than the original `nums` list, avoiding redundant membership checks on duplicate values.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/find-k-iterates-deduplicated-set.json"},{"id":"find-special-integer-fallback-unreachable","text":"The `return arr[-1]` at the end of `find_special_integer` is dead code under valid input (the problem guarantees exactly one element exceeding 25%), but makes the function total.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/find-special-integer-fallback-unreachable.json"},{"id":"find-special-integer-linear-scan","text":"`find_special_integer` uses an O(n) gap-check scan with O(1) space instead of counting or hashing — it exploits sorted order to avoid maintaining frequency state.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/find-special-integer-linear-scan.json"},{"id":"find-union-closure-encapsulation","text":"The Union-Find implementation defines `find` and `union` as closures over `parent` and `rank` arrays rather than using a class, keeping state local to a single invocation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/find-union-closure-encapsulation.json"},{"id":"finding-3digit-constant-candidate-space","text":"The algorithm examines exactly 450 candidate numbers regardless of input size, making runtime O(1) in the length of `digits`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/finding-3digit-constant-candidate-space.json"},{"id":"finding-3digit-multiplicity-enforced","text":"The `Counter` comparison `freq[d] >= needed[d]` ensures each digit is used at most as many times as it appears in the input array.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/finding-3digit-multiplicity-enforced.json"},{"id":"finding-3digit-output-sorted-by-construction","text":"The output list is sorted without an explicit sort call, guaranteed by ascending iteration over `range(100, 999, 2)`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/finding-3digit-output-sorted-by-construction.json"},{"id":"findmode-mode-replacement-strategy","text":"When `cur_count` exceeds `max_count`, the `modes` list is replaced entirely (not appended to), ensuring only values matching the true maximum frequency survive.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/findmode-mode-replacement-strategy.json"},{"id":"findmode-nonlocal-state-pattern","text":"`findMode` uses `nonlocal` to share four mutable variables (`modes`, `max_count`, `cur_count`, `prev`) between the outer function and the `inorder` closure, avoiding parameter threading.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/findmode-nonlocal-state-pattern.json"},{"id":"findmode-requires-valid-bst","text":"The mode-finding algorithm produces incorrect results on non-BST trees because it relies on in-order traversal yielding sorted values to group equal elements consecutively.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/findmode-requires-valid-bst.json"},{"id":"findmode-single-pass-no-hashmap","text":"`findMode` computes all BST modes in a single in-order traversal using run-length counting on the sorted sequence — no hash map or second pass required.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/findmode-single-pass-no-hashmap.json"},{"id":"findtilt-single-pass-postorder","text":"`findTilt` computes total tilt in a single O(n) postorder traversal by having `subtree_sum` return the value sum upward while accumulating tilt into a `nonlocal` closure variable as a side effect.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/findtilt-single-pass-postorder.json"},{"id":"first-bad-version-assumes-monotonic-input","text":"The solution produces correct results only if the predicate is monotonic (all good versions precede all bad versions); non-monotonic input causes undefined behavior, not an error.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/first-bad-version-assumes-monotonic-input.json"},{"id":"first-bad-version-injectable-predicate","text":"The `isBadVersion` predicate is passed as a parameter rather than inherited from a base class, decoupling the solution from LeetCode's `VersionControl` convention and enabling direct unit testing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/first-bad-version-injectable-predicate.json"},{"id":"first-bad-version-left-equals-right-at-exit","text":"The binary search loop exits exactly when `left == right`, so the return value is deterministic regardless of which variable is returned.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/first-bad-version-left-equals-right-at-exit.json"},{"id":"first-bad-version-log-n-api-calls","text":"`first_bad_version` makes at most `ceil(log2(n))` calls to `isBadVersion`, the minimum possible for a comparison-based search.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/first-bad-version-log-n-api-calls.json"},{"id":"first-match-is-minimum-in-sorted-scan","text":"In the two-pointer scan of two sorted arrays, the first equality found is necessarily the smallest common value because both pointers start at index 0 and only advance forward.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/first-match-is-minimum-in-sorted-scan.json"},{"id":"first-occurrence-hashmap-pattern","text":"The first-occurrence hash map (record earliest index per key, compute distance on later hits) is a recurring O(n) pattern across the repo, used in largest-substring-between-two-equal-characters, contains-duplicate-ii, check-distances-between-same-letters, and degree-of-an-array.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/first-occurrence-hashmap-pattern.json"},{"id":"first-palindrome-returns-empty-string-on-no-match","text":"`firstPalindrome` returns `\"\"` (not `None`) when no palindromic string exists, and handles an empty input list correctly by falling through the loop.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/first-palindrome-returns-empty-string-on-no-match.json"},{"id":"first-palindrome-short-circuits","text":"`firstPalindrome` returns immediately on the first palindrome found rather than scanning the entire list.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/first-palindrome-short-circuits.json"},{"id":"first-seen-never-overwritten","text":"In `maxLengthBetweenEqualCharacters`, `first_seen[c]` is written exactly once per distinct character; subsequent occurrences take the `if` branch and compute the gap without updating the stored index.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/first-seen-never-overwritten.json"},{"id":"first-unique-char-two-pass-frequency","text":"The first-unique-character solution uses a two-pass approach: pass 1 builds a complete `Counter` over the entire string, pass 2 scans in original order to find the first character with count exactly 1.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/first-unique-char-two-pass-frequency.json"},{"id":"first-violation-sufficiency","text":"`canBeIncreasing` only examines the first violation of strict monotonicity because any valid single removal must resolve it; if neither of the two candidate removals at that point fixes the array, no single removal anywhere can.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/first-violation-sufficiency.json"},{"id":"fixed-point-correctness-requires-distinct-values","text":"The fixed-point pruning logic depends on `arr[j] - j` being strictly increasing; duplicate values break this monotonicity invariant and could cause the algorithm to miss valid fixed points.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fixed-point-correctness-requires-distinct-values.json"},{"id":"fixed-point-single-branch-collapse","text":"The `arr[mid] > mid` and `arr[mid] == mid` cases share the same search direction (left), collapsed into a single `arr[mid] >= mid` branch that differs only in whether `result` is updated.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fixed-point-single-branch-collapse.json"},{"id":"fixed-point-uses-leftmost-binary-search","text":"The fixed-point algorithm always continues searching left after finding a match (`hi = mid - 1` with `result` update), guaranteeing the smallest fixed point is returned rather than an arbitrary one.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fixed-point-uses-leftmost-binary-search.json"},{"id":"fixed-range-assumption","text":"`maxAliveYear` hardcodes the year range [1950, 2050] as a 101-element delta array; inputs outside this range raise `IndexError`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fixed-range-assumption.json"},{"id":"fizzbuzz-1-indexed","text":"FizzBuzz output is 1-indexed: `result[0]` corresponds to integer 1 and `result[n-1]` to integer `n`, enforced by `range(1, n + 1)`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fizzbuzz-1-indexed.json"},{"id":"fizzbuzz-check-order","text":"The `% 15` divisibility check must precede `% 3` and `% 5` checks in fizz-buzz; reordering produces incorrect output for multiples of 15.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fizzbuzz-check-order.json"},{"id":"fizzbuzz-output-length","text":"`fizzBuzz(n)` always returns a list of exactly `n` elements for any `n >= 1`; for `n <= 0` it returns an empty list.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fizzbuzz-output-length.json"},{"id":"flip-game-length-invariant","text":"Every string returned by `generate_possible_next_moves` has the same length as the input string, since `\"--\"` replaces exactly two characters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/flip-game-length-invariant.json"},{"id":"flip-game-no-mutation","text":"`generate_possible_next_moves` never modifies the input `currentState`; all results are independent string copies built via slicing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/flip-game-no-mutation.json"},{"id":"flip-game-output-ordering","text":"`generate_possible_next_moves` returns results ordered by the position of the flipped `++` pair, ascending left to right, as a natural consequence of the sequential scan.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/flip-game-output-ordering.json"},{"id":"flip-game-quadratic-worst-case","text":"`generate_possible_next_moves` is O(n) in comparisons but O(n^2) worst-case overall due to O(n) string copying per match.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/flip-game-quadratic-worst-case.json"},{"id":"flipping-image-in-place","text":"`flipAndInvertImage` mutates and returns the same `image` object with O(1) extra space; it allocates no new lists.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/flipping-image-in-place.json"},{"id":"flood-fill-color-as-visited","text":"Flood fill uses the color mutation itself as the visited marker instead of maintaining an explicit `visited` set — once a pixel is recolored, it no longer matches `original` and won't be revisited.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/flood-fill-color-as-visited.json"},{"id":"flood-fill-color-guard-termination","text":"The `original == color` early return in `floodFill` is necessary to prevent infinite recursion; without it, coloring a pixel to the same value it already has would never distinguish visited from unvisited neighbors.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/flood-fill-color-guard-termination.json"},{"id":"flood-fill-four-directional","text":"Flood fill connectivity is 4-directional (up/down/left/right); diagonal pixels are never considered neighbors.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/flood-fill-four-directional.json"},{"id":"flood-fill-linear-time","text":"Each pixel is visited at most once in flood fill, giving O(m*n) time and O(m*n) worst-case stack depth for pathological grid shapes like spirals.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/flood-fill-linear-time.json"},{"id":"floor-division-semantics","text":"The average-even-divisible-by-three solution uses Python's `//` operator for the floor division required by the problem spec; this is correct because both `total` and `count` are non-negative.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/floor-division-semantics.json"},{"id":"floyd-cycle-detection-o1-space","text":"`hasCycle` uses Floyd's tortoise-and-hare algorithm with O(1) auxiliary space — only two pointer variables, no visited set.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/floyd-cycle-detection-o1-space.json"},{"id":"flush-beats-all","text":"In `best_poker_hand`, flush is checked before rank-based hands via early return, giving it top priority in the classification cascade.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/flush-beats-all.json"},{"id":"following-key-no-terminal-guard","text":"`most_frequent_number_following_key_in_an_array` raises `IndexError` if `key` only appears at the terminal position — the `range(len-1)` bound correctly skips it, but if no earlier occurrence exists the `Counter` is empty and `most_common(1)[0][0]` fails.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/following-key-no-terminal-guard.json"},{"id":"format-range-single-vs-arrow","text":"`_format_range(a, b)` returns `\"a\"` when endpoints are equal and `\"a->b\"` otherwise; it is only ever called with `a <= b`, guaranteed by the gap-detection guards.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/format-range-single-vs-arrow.json"},{"id":"four-rotations-are-exhaustive","text":"Checking 0°, 90°, 180°, 270° covers all distinct rotations of a square matrix because the rotation group is cyclic of order 4 (Z₄); 360° ≡ 0° so no further checks are needed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/four-rotations-are-exhaustive.json"},{"id":"frequency-map-pair-counting-avoids-quadratic","text":"Pair-counting solutions (e.g., absolute-difference-k) use `Counter` to reduce O(n^2) index enumeration to O(n) frequency multiplication — checking only `v + k` (not `v - k`) to prevent double-counting.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/frequency-map-pair-counting-avoids-quadratic.json"},{"id":"frequency-ratio-bottleneck-pattern","text":"\"How many X can I build from Y\" problems use the pattern: count supply and demand per character, take `min(supply // demand)` across all required characters. Used by `rearrange-characters-to-make-target-string` and `maximum-number-of-balloons`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/frequency-ratio-bottleneck-pattern.json"},{"id":"frequency-sort-uses-composite-tuple-key","text":"The sort key `(freq[x], -x)` encodes both criteria in a single tuple, relying on Python's lexicographic tuple comparison rather than chaining separate sorts.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/frequency-sort-uses-composite-tuple-key.json"},{"id":"frozenset-as-grouping-key","text":"`frozenset(word)` is used as a hashable dictionary/Counter key to group strings by their distinct character sets, enabling O(n) grouping instead of O(n^2) pairwise comparison for set-equality predicates.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/frozenset-as-grouping-key.json"},{"id":"function-misnaming-is-systematic","text":"At least two solutions (`sort_array` in chips problem, `max_difference` alias in candies problem) have names unrelated to their purpose, suggesting the repo's code generation or scaffolding pipeline systematically produces misnamed functions.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/function-misnaming-is-systematic.json"},{"id":"function-name-mismatch-min-operations-sum","text":"In the digit-splitting solution, the function is named `min_operations` (likely from a LeetCode template) but computes a minimum *sum*, not a count of operations.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/function-name-mismatch-min-operations-sum.json"},{"id":"function-name-mismatches-are-systematic","text":"Solutions sometimes have function names unrelated to the problem they solve (e.g., `max_tasks` for \"count even digit sum\", `balanced_string` for \"count negatives in matrix\") — this is a recurring artifact of the code generation pipeline, not a one-off typo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/function-name-mismatches-are-systematic.json"},{"id":"function-name-mismatches-behavior","text":"`get_max_occurrences` in `greatest-english-letter-in-upper-and-lower-case/solution.py` does not count occurrences — it finds the greatest letter appearing in both cases; the name is likely a repo-wide template artifact.","truth_value":"OUT","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/function-name-mismatches-behavior.json"},{"id":"function-name-mismatches-exist","text":"Some solutions have function names that don't match the LeetCode problem's expected method name (e.g., `canDistribute` instead of `minOperations`), likely from copy-paste during problem setup.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/function-name-mismatches-exist.json"},{"id":"fused-reverse-invert","text":"`flipAndInvertImage` performs horizontal flip and bit inversion in a single two-pointer pass per row via simultaneous swap-and-XOR, not two separate passes.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/fused-reverse-invert.json"},{"id":"gap-formula-excludes-endpoints","text":"The expression `i - first_seen[c] - 1` counts characters strictly between positions `first_seen[c]` and `i`, excluding both boundary characters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/gap-formula-excludes-endpoints.json"},{"id":"gauss-sum-for-range-problems","text":"The closed-form sum `n*(n+1)//2` is a recurring idiom across this repo for problems involving missing or duplicate numbers in a 1-to-n range, avoiding a second pass to compute the expected sum.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/gauss-sum-for-range-problems.json"},{"id":"gcd-determines-valid-partition","text":"A deck of cards can be partitioned into equal-sized groups of matching values if and only if the GCD of all value frequencies is >= 2 — the solution computes this in a single `reduce(gcd, counts)` fold.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/gcd-determines-valid-partition.json"},{"id":"gcd-of-extremes-not-pairwise","text":"`findGCD` computes `gcd(min(nums), max(nums))` — the GCD of only the smallest and largest elements, not a pairwise reduction across all elements.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/gcd-of-extremes-not-pairwise.json"},{"id":"gcd-reduces-common-factor-counting","text":"`common_factors(a, b)` converts the two-variable problem into divisor-counting on `gcd(a, b)`, since the set of common factors of (a, b) equals the set of divisors of gcd(a, b)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/gcd-reduces-common-factor-counting.json"},{"id":"gcd-strings-commutativity-check","text":"`str1 + str2 == str2 + str1` is both necessary and sufficient for the existence of a common divisor string — this is the key mathematical insight (related to the Fine and Wilf theorem)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/gcd-strings-commutativity-check.json"},{"id":"gcd-strings-length-determines-answer","text":"When a common divisor exists, its length equals `gcd(len(str1), len(str2))` and the answer is simply `str1[:that_length]`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/gcd-strings-length-determines-answer.json"},{"id":"generated-array-n0-guard-required","text":"The `n == 0` early return is necessary; without it, `nums[1] = 1` raises IndexError on a length-1 list","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/generated-array-n0-guard-required.json"},{"id":"generated-array-recurrence-correctness","text":"For odd index `i >= 3`, `nums[i // 2 + 1]` is always in bounds because `i // 2 + 1 <= i` and the array has length `n + 1`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/generated-array-recurrence-correctness.json"},{"id":"generated-array-single-pass-dp","text":"The solution computes all values in one forward pass because every dependency index (`i // 2`, `i // 2 + 1`) is strictly less than the current index for `i >= 2`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/generated-array-single-pass-dp.json"},{"id":"generation-errors-amplified-by-isolation","text":"The automated generation pipeline introduces systematic naming errors (mismatched function names, stale aliases), and the per-problem isolation architecture ensures these errors are never detected or corrected — the pipeline creates defects and the architecture hides them, forming a defect-accumulation cycle with no corrective feedback loop.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/generation-errors-amplified-by-isolation.json"},{"id":"generation-errors-remain-invisible","text":"Naming errors introduced by the automated generation pipeline remain invisible at runtime because the submission-optimized architecture isolates each solution — but this containment depends on the test harness correctly routing to the intended function despite the naming drift.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/generation-errors-remain-invisible.json"},{"id":"generation-pipeline-is-naming-error-root-cause","text":"The automated code generation pipeline is the root cause of systematic naming errors across the repo — it produces both misnamed functions (names carried from unrelated problems via copy-paste templates) and vestigial aliases (dead references from prior solution scaffolding), creating a class of defects that is structurally different from manual typos because it affects function identity rather than spelling.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/generation-pipeline-is-naming-error-root-cause.json"},{"id":"generator-boolean-counting-pattern","text":"The repo uses `sum(predicate(x) for x in iterable)` as an idiom for counting matches, exploiting Python's `True == 1` / `False == 0` arithmetic to avoid materializing a filtered list.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/generator-boolean-counting-pattern.json"},{"id":"generator-inside-min-pattern","text":"Multiple solutions use generator expressions (lazy, O(1) auxiliary space) inside `min()` rather than list comprehensions — a recurring idiom across the repo for single-pass optimization problems.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/generator-inside-min-pattern.json"},{"id":"generator-over-list-for-aggregation","text":"`maximumWealth` uses `max(sum(row) for row in accounts)` with a generator expression (not a list comprehension), achieving O(1) auxiliary space by avoiding materialization of intermediate results.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/generator-over-list-for-aggregation.json"},{"id":"generator-sum-counting-idiom","text":"Multiple solutions use `sum(1 for ... if ...)` or `sum(... for ...)` as the standard idiom for counting matches — O(1) auxiliary space, no intermediate list allocation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/generator-sum-counting-idiom.json"},{"id":"generator-sum-counting-pattern","text":"Solutions use `sum(1 for x in seq if cond)` as the standard counting idiom rather than `len([...])` or manual accumulators — avoids intermediate list allocation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/generator-sum-counting-pattern.json"},{"id":"getheight-sentinel-neg1","text":"`getHeight` in balanced-binary-tree returns exactly `-1` as a sentinel for any unbalanced subtree and never any other negative value; non-negative returns represent actual heights.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/getheight-sentinel-neg1.json"},{"id":"getlucky-convergence-by-k3","text":"For valid inputs (up to 1000 lowercase letters), `getLucky` stabilizes to a single digit by the third transform at most, making k > 3 effectively a no-op.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/getlucky-convergence-by-k3.json"},{"id":"getlucky-first-sum-on-string","text":"`getLucky` computes the first digit-sum directly from the concatenated numeric string, avoiding conversion to a potentially thousands-of-digits integer; subsequent sums operate on small integers.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/getlucky-first-sum-on-string.json"},{"id":"getlucky-k-minus-one-loop","text":"The transform loop in `getLucky` runs `k - 1` iterations because the initial sum on `num_str` counts as the first of `k` total transforms.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/getlucky-k-minus-one-loop.json"},{"id":"goal-parser-num-ways-misnomer","text":"`num_ways` is named incorrectly; it returns a transformed string, not a count — the name likely comes from copy-paste from another problem template","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/goal-parser-num-ways-misnomer.json"},{"id":"goal-parser-replace-order-safe","text":"The two `str.replace()` calls are order-independent because `\"()\"` and `\"(al)\"` are non-overlapping substrings in any valid Goal Parser input","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/goal-parser-replace-order-safe.json"},{"id":"goat-latin-assumes-nonempty-words","text":"The function accesses `word[0]` without a length check, relying on the LeetCode guarantee that the input contains no empty tokens from splitting","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/goat-latin-assumes-nonempty-words.json"},{"id":"goat-latin-consonant-rotation-preserves-case","text":"When moving a consonant to the end of a word, the original casing of that character is preserved — no `.lower()` or `.upper()` is applied","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/goat-latin-consonant-rotation-preserves-case.json"},{"id":"goat-latin-index-is-1-based","text":"`enumerate(sentence.split(), 1)` produces 1-based indices, meaning the first word gets exactly one trailing `\"a\"` — an off-by-one here would silently produce wrong answers","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/goat-latin-index-is-1-based.json"},{"id":"goat-latin-vowel-check-is-case-insensitive","text":"The vowel set includes both upper and lowercase variants (`\"aeiouAEIOU\"`), so the first-character check works regardless of word casing","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/goat-latin-vowel-check-is-case-insensitive.json"},{"id":"good-triplets-empty-range-handles-small-arrays","text":"When `len(arr) < 3`, `range(n - 2)` produces an empty range, so `countGoodTriplets` returns 0 without error — no special-casing needed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/good-triplets-empty-range-handles-small-arrays.json"},{"id":"good-triplets-pruning-order-skips-innermost-loop","text":"The `a`-constraint is checked between the second and third loops: a failed `(i, j)` pair skips all `k` iterations, while `b` and `c` constraints are only checked in the innermost loop.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/good-triplets-pruning-order-skips-innermost-loop.json"},{"id":"graph-path-exists-batch-no-early-exit","text":"All edges are processed via `union` before the single `find(source) == find(destination)` query — the algorithm does not short-circuit if source and destination merge mid-loop.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/graph-path-exists-batch-no-early-exit.json"},{"id":"greedy-algorithms-provably-optimal","text":"Greedy strategies across the repo are accompanied by explicit correctness arguments — prefix-free code uniqueness, leftmost-digit positional weight, exchange arguments — not treated as heuristics.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/greedy-algorithms-provably-optimal.json"},{"id":"greedy-consecutive-triples-sufficiency","text":"After sorting descending, only consecutive triples need checking for the largest-perimeter-triangle problem; non-adjacent triples can never produce a larger valid perimeter than the first valid consecutive triple.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-consecutive-triples-sufficiency.json"},{"id":"greedy-early-exit-correctness","text":"In `max_number_after_remove_digit`, removing the first occurrence of `digit` that is immediately followed by a strictly larger digit always yields the lexicographically maximum result.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-early-exit-correctness.json"},{"id":"greedy-flip-negatives-first","text":"The k-negations algorithm sorts to place negatives first and greedily flips them; this is optimal because flipping a negative yields +2|x| gain versus flipping a positive which yields -2|x| loss.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-flip-negatives-first.json"},{"id":"greedy-optimality-requires-nonnegative-domain","text":"Greedy algorithms in the repo are provably optimal across their problem domains, but this universal optimality claim is contingent on non-negative input values — at least one greedy sort-then-pair strategy (max_product_difference) is correct only for positive inputs, where magnitude ordering coincides with value ordering.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"derived","url":"/public/leetcode-expert/belief/greedy-optimality-requires-nonnegative-domain.json"},{"id":"greedy-output-stack-pattern","text":"Multiple solutions use a \"greedy output stack\" pattern — building output character-by-character, appending or skipping based on a bounded lookback window into the result so far (e.g., fancy-string checks last 2, decrypt-string peeks ahead 2).","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-output-stack-pattern.json"},{"id":"greedy-scan-correct-for-prefix-free-codes","text":"The greedy left-to-right scan in the 1-bit/2-bit characters problem produces the unique valid decoding because `{0, 10, 11}` is a prefix-free code — no backtracking or DP is needed.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-scan-correct-for-prefix-free-codes.json"},{"id":"greedy-single-fork-for-one-deletion","text":"Valid Palindrome II handles the \"at most one deletion\" constraint by forking exactly once on the first mismatch (try skipping left or right), with no backtracking, keeping total work at O(n).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-single-fork-for-one-deletion.json"},{"id":"greedy-single-pass-virtual-state-pattern","text":"`min_operations` (array increasing) tracks a virtual `prev` value instead of mutating the input array, keeping the function pure while achieving O(n) time and O(1) space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-single-pass-virtual-state-pattern.json"},{"id":"greedy-skip-optimality","text":"Skipping 3 positions on each `'X'` produces the minimum move count because covering the leftmost uncovered `'X'` first maximizes coverage reach and never wastes a move.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-skip-optimality.json"},{"id":"greedy-sort-descending-skip-every-third","text":"`minimumCost` sorts candy prices descending and sums elements where `i % 3 != 2`, skipping every third element as the free candy — the canonical greedy for \"buy 2 get 1 free\" minimization.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-sort-descending-skip-every-third.json"},{"id":"greedy-sort-mutates-input","text":"`maximum-units-on-a-truck/solution.py` uses `boxTypes.sort()` which mutates the caller's list in-place rather than using `sorted()` for a non-destructive copy.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-sort-mutates-input.json"},{"id":"greedy-sort-then-scan-pattern","text":"Multiple solutions (array-partition, assign-cookies) share the same structural pattern: sort the input, then make a single linear pass to extract the answer — a recurring idiom for greedy problems in this repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-sort-then-scan-pattern.json"},{"id":"greedy-stack-extends-streaming-to-output-construction","text":"The greedy output stack extends single-pass streaming from scalar accumulation to structured output construction: the stack serves as a bounded accumulator enabling per-element include/revise/skip decisions while maintaining output invariants — generalizing streaming's extend-or-reset pattern from scalar state to sequence-building state.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/greedy-stack-extends-streaming-to-output-construction.json"},{"id":"greedy-three-chars-always-sufficient","text":"When replacing `?` to avoid consecutive repeats, trying candidates from `'abc'` always yields a valid choice because a position has at most 2 neighbors and 3 candidates guarantees one is conflict-free (pigeonhole principle).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-three-chars-always-sufficient.json"},{"id":"greedy-with-early-exit-maximizes-pruning","text":"Greedy algorithms in the repo are systematically paired with early-exit conditions — returning on first violation, terminating on deadlock detection, short-circuiting on zero — so that provably-optimal local choices combine with aggressive pruning to minimize both time complexity and actual executed instructions.","truth_value":"OUT","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/greedy-with-early-exit-maximizes-pruning.json"},{"id":"greedy-with-post-hoc-correction","text":"The distribute-money solution computes an optimistic greedy answer then applies two corrections for constraint violations (surplus absorption and $4 avoidance), a pattern idiomatic for LeetCode distribution problems.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-with-post-hoc-correction.json"},{"id":"greedy-zero-crossing-optimal-for-balanced-splits","text":"Splitting at every zero-crossing of the balance counter provably maximizes the number of balanced substrings; deferring a split can never create more splits later.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/greedy-zero-crossing-optimal-for-balanced-splits.json"},{"id":"grid-as-strings-idiom","text":"String-grid problems in this repo index directly into strings with `strs[i][j]` rather than converting to a 2D array, avoiding allocation at the cost of assuming uniform string length.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/grid-as-strings-idiom.json"},{"id":"group-contribution-sweep-pattern","text":"`countTriplets` uses a \"left * current * right\" sweep over Counter groups to count valid triplets in O(n) time, maintaining the invariant `left + c + right == len(nums)` at every iteration.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/group-contribution-sweep-pattern.json"},{"id":"groupby-for-consecutive-runs","text":"Solutions involving consecutive identical characters (e.g., decomposable substrings) use `itertools.groupby` for run-length encoding rather than manual loop-and-counter approaches.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/groupby-for-consecutive-runs.json"},{"id":"guard-clause-then-expression-pattern","text":"Easy-difficulty solutions follow a guard-clause-then-expression pattern: validate the input constraint up front, then return the entire transformation as a single expression.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/guard-clause-then-expression-pattern.json"},{"id":"guess-api-inverted-semantics","text":"`guess()` returns `-1` when the guess is too high (not too low), which is the opposite of what a standard comparison function would return — the branching logic must account for this inversion.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/guess-api-inverted-semantics.json"},{"id":"halves-alike-case-insensitive-via-prebuilt-set","text":"The halves-alike solution handles mixed-case vowel matching by storing all 10 case variants (`\"aeiouAEIOU\"`) in a set, avoiding a `.lower()` call on the input string.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/halves-alike-case-insensitive-via-prebuilt-set.json"},{"id":"hamming-xor-popcount","text":"`hammingDistance` computes Hamming distance as popcount of XOR (`bin(x ^ y).count('1')`); any change to either the XOR or the popcount step would break correctness.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hamming-xor-popcount.json"},{"id":"happy-number-fast-starts-ahead","text":"The fast pointer is initialized one step ahead (`get_next(n)`) while slow starts at `n` — this offset is critical for Floyd's algorithm to detect cycles correctly when the starting value itself is part of a cycle.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/happy-number-fast-starts-ahead.json"},{"id":"happy-number-floyds-o1-space","text":"`is_happy` uses Floyd's cycle detection (tortoise and hare) with O(1) space rather than a hash set, making it the same pattern used in `linked-list-cycle`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/happy-number-floyds-o1-space.json"},{"id":"happy-number-get-next-fixed-point","text":"`get_next(1)` returns 1, making 1 a fixed point — this is what causes the fast pointer to stop when a happy number is found and is essential to the algorithm's termination condition.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/happy-number-get-next-fixed-point.json"},{"id":"harmless-defect-permanence-is-equilibrium-property","text":"The permanence of structurally harmless defects is an equilibrium property, not a system failing: the same dual locking mechanisms that stabilize the quality profile (domain attractor + self-reinforcing incentive structure) also guarantee that frozen defects remain in their harmless state — preventing both remediation (which would require engineering investment the incentive structure discourages) and escalation (which would require cross-solution coupling the isolation architecture prevents).","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/harmless-defect-permanence-is-equilibrium-property.json"},{"id":"has-next-is-side-effect-free","text":"`StringIterator.hasNext()` only checks `_count > 0` and never modifies state or triggers parsing — verified by a dedicated test case.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/has-next-is-side-effect-free.json"},{"id":"hash-lookahead-greedy-correct","text":"In the decrypt-string solution, the 3-char token (`XX#`) is always checked before the 1-char token, which is the only correct parse order since `#` at position `i+2` unambiguously signals a double-digit encoding.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hash-lookahead-greedy-correct.json"},{"id":"hash-pipeline-algebraically-and-empirically-grounded","text":"The hash-then-stream pipeline's universality claim is both algebraically grounded (Counter provides a complete multiset algebra covering construction, measurement, comparison, and decomposition) and empirically validated by two complementary exemplar families (palindrome problems exercising Counter's full multiset operations, Two Sum problems spanning the lookup strategy space from hash maps through sorted arrays), making it the strongest-evidenced pipeline instantiation in the taxonomy.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/hash-pipeline-algebraically-and-empirically-grounded.json"},{"id":"hash-pipeline-demonstrated-by-dual-exemplar-families","text":"The hash-then-stream pipeline's universal scope is demonstrated by two complementary exemplar families: palindrome problems exercise Counter's full multiset algebra for aggregate frequency-parity reduction, while Two Sum problems exercise point-lookup semantics through hash map complement queries — together covering both fundamental query modes (aggregate frequency and exact membership) of the hash preprocessing phase.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/hash-pipeline-demonstrated-by-dual-exemplar-families.json"},{"id":"hash-preprocessing-universal-first-step","text":"Hash-based data structures (Counter for frequencies, set for membership) serve as the universal O(n) preprocessing layer, with nearly every lookup-heavy or frequency-dependent problem beginning with one of these two constructions before a linear scan.","truth_value":"IN","justification_count":1,"dependent_count":5,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/hash-preprocessing-universal-first-step.json"},{"id":"hash-set-dimension-reduction","text":"For triplet-constraint problems, precomputing a hash set of valid values for one dimension (e.g., perfect squares up to n^2) reduces an O(n^3) brute force to O(n^2) by replacing the innermost loop with an O(1) set membership check.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hash-set-dimension-reduction.json"},{"id":"hash-structures-prime-bucket-sizing","text":"Both hash structure implementations use prime bucket counts (1009 for HashMap, 769 for HashSet) to reduce collision clustering under modular hashing compared to power-of-two sizes.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hash-structures-prime-bucket-sizing.json"},{"id":"hash-structures-silent-remove","text":"Both MyHashMap.remove and MyHashSet.remove are silent no-ops when the key is absent — neither raises an exception nor returns an error signal.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hash-structures-silent-remove.json"},{"id":"hashmap-get-returns-negative-one","text":"MyHashMap.get returns integer -1 for absent keys (LeetCode convention), not None or KeyError.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hashmap-get-returns-negative-one.json"},{"id":"hashmap-mutable-pair-lists","text":"MyHashMap stores entries as mutable `[key, value]` lists (not tuples), enabling in-place value updates via `pair[1] = value` without remove-and-reinsert.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hashmap-mutable-pair-lists.json"},{"id":"hashmap-no-duplicate-keys","text":"MyHashMap.put scans the target bucket for an existing key before appending, guaranteeing at most one entry per key across the entire map.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hashmap-no-duplicate-keys.json"},{"id":"hashmap-separate-chaining-1009-buckets","text":"MyHashMap uses separate chaining with a fixed array of 1009 buckets (a prime), giving O(n/1009) amortized cost per operation with no dynamic resizing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hashmap-separate-chaining-1009-buckets.json"},{"id":"hashset-colocated-tests","text":"design-hashset/solution.py contains both the MyHashSet implementation and its TestMyHashSet unittest class in the same file, following the repo's co-located test convention.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hashset-colocated-tests.json"},{"id":"hashset-no-duplicates-invariant","text":"MyHashSet.add checks `key not in bucket` before appending, guaranteeing each key appears exactly once across the entire structure.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hashset-no-duplicates-invariant.json"},{"id":"hashset-separate-chaining-769-buckets","text":"MyHashSet uses separate chaining with 769 buckets (a prime), giving O(n/769) average-case per operation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hashset-separate-chaining-769-buckets.json"},{"id":"heapify-over-repeated-push","text":"Solutions prefer `heapq.heapify()` (O(n)) for initial heap construction rather than n individual `heappush` calls (O(n log n)).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/heapify-over-repeated-push.json"},{"id":"height-checker-counting-sort","text":"`height_checker` uses counting sort (O(n+k), k=100) rather than comparison sort, exploiting the constraint that heights are in [1, 100].","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/height-checker-counting-sort.json"},{"id":"height-checker-j-monotonic","text":"The cursor `j` only advances forward across the outer loop, so total inner `while` iterations are O(k) amortized across all elements — the nested loop is not O(n*k).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/height-checker-j-monotonic.json"},{"id":"height-checker-no-sorted-array-materialized","text":"The sorted order is never stored as a list; comparison happens inline by walking the frequency array with a monotonically advancing cursor `j`, fusing the sort and compare steps.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/height-checker-no-sorted-array-materialized.json"},{"id":"height-zero-for-none","text":"The empty tree (`None`) is defined as having height 0 in balanced-binary-tree, making `max(left, right) + 1` produce height 1 for a single leaf node — a foundational invariant the recursion depends on.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/height-zero-for-none.json"},{"id":"hexspeak-no-negative-handling","text":"`to_hexspeak` does not handle negative integers; `hex()` on a negative int produces `\"-0x...\"`, so the `[2:]` slice would retain the `x` and produce an invalid result rather than raising an error.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hexspeak-no-negative-handling.json"},{"id":"hexspeak-replace-order-independent","text":"The two `.replace(\"0\",\"O\").replace(\"1\",\"I\")` calls in `to_hexspeak` produce the same result regardless of order, because `hex()` output contains only `0-9a-f` — no `O` or `I` characters exist before substitution.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hexspeak-replace-order-independent.json"},{"id":"hexspeak-string-input-contract","text":"`to_hexspeak` takes `num` as a string (not int) matching the LeetCode signature, converting internally via `int(num)` with no input validation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hexspeak-string-input-contract.json"},{"id":"hexspeak-valid-set-complete","text":"The valid Hexspeak character set `{A,B,C,D,E,F,I,O}` is exactly the six hex letter-digits plus substitutions for `0→O` and `1→I`; digits `2-9` are the only rejection trigger.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hexspeak-valid-set-complete.json"},{"id":"highest-altitude-misnamed-function","text":"The highest-altitude solution function is named `min_operations` despite solving a prefix-sum maximum problem — a naming bug likely from the code generation pipeline.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/highest-altitude-misnamed-function.json"},{"id":"highest-altitude-single-pass","text":"The highest-altitude solution uses a running accumulator with tracking max in O(n) time and O(1) space, rather than materializing the prefix-sum array.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/highest-altitude-single-pass.json"},{"id":"highest-altitude-starts-at-zero","text":"`min_operations` (the highest-altitude solver) includes altitude 0 as a candidate for the maximum by initializing `max_alt = 0`, correctly accounting for the starting point.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/highest-altitude-starts-at-zero.json"},{"id":"highest-island-naming-error","text":"`substrings-of-size-three-with-distinct-characters/solution.py` has its method named `highest_island` instead of `countGoodSubstrings` — a copy-paste error from a different problem","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/highest-island-naming-error.json"},{"id":"hills-valleys-boundary-exclusion","text":"The counting loop iterates indices `1` through `len(deduped) - 2`, so the first and last elements are never counted as hills or valleys — they lack a second neighbor.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hills-valleys-boundary-exclusion.json"},{"id":"hills-valleys-dedup-eliminates-plateaus","text":"After deduplication, `deduped[i] != deduped[i+1]` for all valid `i`, guaranteeing every interior element is unambiguously a hill, valley, or neither — plateau cases cannot occur.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hills-valleys-dedup-eliminates-plateaus.json"},{"id":"hills-valleys-two-pass-tradeoff","text":"`count_hills_and_valleys` uses O(n) auxiliary space for the `deduped` list (two-pass: dedup then scan); a single-pass approach tracking `prev_different` could reduce to O(1) space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/hills-valleys-two-pass-tradeoff.json"},{"id":"horner-method-for-linked-list-binary","text":"Binary-to-integer conversion from linked lists uses Horner's method (`result = result * 2 + node.val`), processing MSB-first in a single pass with O(1) space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/horner-method-for-linked-list-binary.json"},{"id":"identity-not-equality","text":"`getTargetCopy` uses `is` (identity) rather than `==` (equality) to locate the target node, making it correct even when the tree contains duplicate values.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/identity-not-equality.json"},{"id":"image-smoother-boundary-clamping","text":"Edge and corner cells are handled implicitly via `max(0, i-1)` / `min(m, i+2)` bounds rather than explicit conditional branches, allowing the window to naturally shrink at borders.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/image-smoother-boundary-clamping.json"},{"id":"image-smoother-constant-work-per-cell","text":"The inner double loop iterates at most 9 times per cell (3×3 window), making overall complexity O(m·n) rather than O(m·n·k²).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/image-smoother-constant-work-per-cell.json"},{"id":"image-smoother-floor-division-safe","text":"The window always includes cell `(i,j)` itself, so `count` is always ≥1 and the `total // count` floor division never raises `ZeroDivisionError`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/image-smoother-floor-division-safe.json"},{"id":"image-smoother-out-of-place","text":"`imageSmoother` allocates a separate result matrix and never writes to the input, so reads always reflect original pixel values and avoid read-after-write corruption.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/image-smoother-out-of-place.json"},{"id":"immunity-complete-across-all-observed-defect-classes","text":"Architectural immunity covers all observed defect classes comprehensively: naming errors from the generation pipeline, convention drift from isolation, and tooling confusion from the test harness are all structurally invisible at runtime, with no observed defect class that could escalate from engineering nuisance to runtime failure.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/immunity-complete-across-all-observed-defect-classes.json"},{"id":"immunity-self-reinforced-by-quality-equilibrium","text":"The architecture's immunity to its own engineering defects is not merely passive but actively maintained by the quality equilibrium: defects are structurally harmless (isolation prevents functional impact), the judge-optimized selection dynamics provide no incentive to remediate them, and this combination means defects are positively stabilized by the system's own dynamics rather than merely tolerated.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/immunity-self-reinforced-by-quality-equilibrium.json"},{"id":"immutable-string-list-copy-for-swap","text":"Python string immutability forces solutions that swap characters (e.g., `reverseVowels`) to convert to `list(s)`, perform O(1) swaps, then `\"\".join()` back — avoiding O(n^2) string concatenation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/immutable-string-list-copy-for-swap.json"},{"id":"imported-by-cross-refs-misleading","text":"The \"Imported By\" lists in code exploration prompts reflect shared test harness structure across the repo, not real import edges between solution modules.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-cross-refs-misleading.json"},{"id":"imported-by-is-test-harness-artifact","text":"The \"Imported By\" cross-references that appear across solution files are artifacts of the shared test runner infrastructure (likely `run_tests.py` or conftest); solutions do not actually import from each other.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-is-test-harness-artifact.json"},{"id":"imported-by-list-artifact","text":"The \"Imported By\" lists showing ~400+ test files across the repo are misleading artifacts of the analysis tooling — they reflect shared test harness structure (likely a conftest or re-export pattern), not actual direct imports of each solution module.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-list-artifact.json"},{"id":"imported-by-list-is-misleading","text":"The \"Imported By\" metadata on solution files lists hundreds of test files that don't actually import the solution — they share a common test harness pattern. Each solution's genuine consumer is only its own `test_solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-list-is-misleading.json"},{"id":"imported-by-list-is-test-harness-artifact","text":"The large \"Imported By\" lists shown in file context across the repo are artifacts of a shared test runner/harness that indexes all solution modules; they do not represent actual cross-solution dependencies.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-list-is-test-harness-artifact.json"},{"id":"imported-by-list-misleading","text":"The \"Imported By\" lists shown in the exploration prompt are artifacts of the repo's test infrastructure — each problem's `test_solution.py` imports its own `solution.py`, not other problems' solutions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-list-misleading.json"},{"id":"imported-by-lists-are-artifacts","text":"The \"Imported By\" metadata listing hundreds of test files is a repo-wide cross-reference artifact, not actual import dependencies; each solution is only directly imported by its own `test_solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-lists-are-artifacts.json"},{"id":"imported-by-lists-are-misleading","text":"The \"Imported By\" metadata across solution files inflates actual dependency counts — most listed test files share a common `from solution import Solution` pattern and don't depend on the specific module. True importers are only the co-located `test_solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-lists-are-misleading.json"},{"id":"imported-by-lists-are-noisy","text":"The \"Imported By\" metadata for solution files includes hundreds of unrelated test files due to the test harness's broad import scanning; only the co-located `test_solution.py` is a real consumer.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-lists-are-noisy.json"},{"id":"imported-by-lists-are-static-analysis-artifacts","text":"The \"Imported By\" lists showing 300+ test files are artifacts of the repo's shared test harness / test runner discovery, not real import relationships; each solution is only directly imported by its own `test_solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-lists-are-static-analysis-artifacts.json"},{"id":"imported-by-lists-are-tooling-artifact","text":"The \"Imported By\" lists in the dependency analysis are misleading — hundreds of test files appear as importers of each solution, but each `test_solution.py` only imports from its own directory's `solution.py`; the cross-references are an artifact of shared import patterns or broken static analysis.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-lists-are-tooling-artifact.json"},{"id":"imported-by-lists-misleading","text":"The tooling's \"Imported By\" lists show hundreds of test files across the repo, but these reflect shared test infrastructure naming patterns, not actual logical dependencies on the listed solution.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-lists-misleading.json"},{"id":"imported-by-metadata-is-misleading","text":"Across the repo, the \"Imported By\" metadata for solution files incorrectly lists hundreds of unrelated test files because they all import a local `solution.py` via the same relative path — only the test file in the same problem directory is a real consumer","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-metadata-is-misleading.json"},{"id":"imported-by-metadata-is-unreliable","text":"The \"Imported By\" lists in the code exploration tooling are artifacts of repo-wide test infrastructure (shared conftest or runner), not real dependency relationships — only the co-located `test_solution.py` actually imports each solution.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-metadata-is-unreliable.json"},{"id":"imported-by-metadata-systematically-unreliable","text":"The \"Imported By\" dependency metadata is a pure artifact of the test harness's broad import pattern, not indicative of actual code coupling between solutions.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/imported-by-metadata-systematically-unreliable.json"},{"id":"imported-by-metadata-unreliable","text":"The \"Imported By\" lists in code-expert analysis are artifacts of the repo's shared test harness or runner — they show every test file in the repo, not actual cross-problem imports. Each solution is only genuinely imported by its own `test_solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/imported-by-metadata-unreliable.json"},{"id":"in-place-grid-mutation","text":"`maxValueAfterOperations` calls `row.sort()` on each row of the input grid, destroying the original ordering — callers lose their data.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/in-place-grid-mutation.json"},{"id":"in-place-mutation-return-convention","text":"Multiple solutions (flood-fill, flipping-an-image) mutate the input data structure in-place and return the same reference, following LeetCode's convention where the caller already holds the reference.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/in-place-mutation-return-convention.json"},{"id":"in-place-mutation-with-return-convention","text":"Solutions routinely mutate input data structures (arrays, linked lists, matrices) in-place and return the same reference, blending imperative mutation with functional return-value style.","truth_value":"IN","justification_count":1,"dependent_count":4,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/in-place-mutation-with-return-convention.json"},{"id":"in-place-sort-mutation","text":"Multiple solutions (`max_product_difference`, `maximumProduct`) mutate the caller's list via `nums.sort()` rather than using `sorted()` — callers must copy if they need the original order.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/in-place-sort-mutation.json"},{"id":"in-place-sort-mutation-pattern","text":"Multiple solutions (`trimMean`, `can_attend_meetings`) mutate input arrays via `list.sort()` in-place; this is a recurring pattern in the repo where LeetCode's single-call contract makes input preservation unnecessary.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/in-place-sort-mutation-pattern.json"},{"id":"inclusive-interval-output","text":"Each returned interval `[start, end]` from `largeGroupPositions` is inclusive on both ends, matching LeetCode's expected format.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/inclusive-interval-output.json"},{"id":"inclusive-range-contract","text":"`countPrimeSetBits(left, right)` treats both `left` and `right` as inclusive bounds, using `range(left, right + 1)` to match the LeetCode problem specification","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/inclusive-range-contract.json"},{"id":"inconsistency-is-invisible-because-submission-optimized","text":"Engineering inconsistencies (naming drift, dual test conventions, style divergence) persist indefinitely because the submission-optimized architecture both causes them (isolation removes forcing functions) and hides them (each solution is tested in isolation, so cross-solution inconsistencies never surface as failures).","truth_value":"IN","justification_count":1,"dependent_count":5,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/inconsistency-is-invisible-because-submission-optimized.json"},{"id":"increasing-bst-dummy-head-pattern","text":"Uses a dummy sentinel node to avoid special-casing the first insertion, the same idiom used in linked-list merge problems — build off a throwaway head and return head.right.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/increasing-bst-dummy-head-pattern.json"},{"id":"increasing-bst-is-destructive","text":"increasingBST mutates the input tree in place; after the call, the original BST structure no longer exists — every node's .left is None and .right points to its in-order successor.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/increasing-bst-is-destructive.json"},{"id":"increasing-bst-linear-time","text":"The algorithm visits each node exactly once via in-order traversal, giving O(n) time and O(h) stack space where h is tree height.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/increasing-bst-linear-time.json"},{"id":"increasing-bst-nulls-left-pointers","text":"Every visited node has .left set to None after processing; without this, the restructured tree would contain cycles or stale references.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/increasing-bst-nulls-left-pointers.json"},{"id":"increasing-bst-uses-instance-state","text":"The mutable cursor is stored as self.current on the Solution instance, making concurrent calls on the same instance unsafe due to shared mutable state.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/increasing-bst-uses-instance-state.json"},{"id":"increment-before-test-pattern","text":"The outer-parenthesis stripping algorithm increments/decrements depth *before* testing the inclusion condition, which is what makes `> 1` (for open) and `> 0` (for close) the correct thresholds — reversing the order would produce wrong results.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/increment-before-test-pattern.json"},{"id":"incremental-counting-equals-combination-sum","text":"The single-pass idiom `count += seen[num]; seen[num] += 1` used in `numIdenticalPairs` is mathematically equivalent to summing `C(freq, 2)` for each distinct value but avoids a second pass over the frequency map.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/incremental-counting-equals-combination-sum.json"},{"id":"index-bounds-over-slicing-in-divide-and-conquer","text":"Divide-and-conquer solutions recurse on index bounds `(left, right)` rather than creating sublists, avoiding O(n log n) total copying and keeping space to O(log n) stack frames.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/index-bounds-over-slicing-in-divide-and-conquer.json"},{"id":"index-pairs-brute-force-complexity","text":"indexPairs runs in O(W × N × L) time where W = len(words), N = len(text), L = max word length, due to nested loops with slice comparison. No trie or Aho-Corasick; appropriate for constraints ≤ 100.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/index-pairs-brute-force-complexity.json"},{"id":"index-pairs-duplicate-words-produce-duplicate-results","text":"If the same word appears twice in the words list, each match position is reported twice in the output — no deduplication is performed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/index-pairs-duplicate-words-produce-duplicate-results.json"},{"id":"index-pairs-sort-guarantees-order","text":"Output ordering relies on Python's lexicographic list comparison in list.sort(), which sorts [i, j] pairs by i first then j.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/index-pairs-sort-guarantees-order.json"},{"id":"index-pairs-wrapper-misnamed","text":"has_all_codes_in_range is incorrectly named; it wraps indexPairs, not the \"check if all codes in range\" problem (LeetCode 1461). Likely a scaffolding artifact.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/index-pairs-wrapper-misnamed.json"},{"id":"inline-comparison-over-max-builtin","text":"The repo prefers inline `if depth > max_depth` comparisons over `max_depth = max(max_depth, depth)` calls in tight loops, avoiding a function-call overhead per iteration.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/inline-comparison-over-max-builtin.json"},{"id":"inline-tests-colocated","text":"Solution and unit tests are colocated in the same file, with a `unittest.TestCase` subclass defined alongside the `Solution` class.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/inline-tests-colocated.json"},{"id":"inline-tests-colocated-with-solution","text":"Some solution files (e.g., `apply-operations-to-an-array/solution.py`) bundle `unittest.TestCase` classes directly alongside the solution function, in addition to the separate `test_solution.py` file.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/inline-tests-colocated-with-solution.json"},{"id":"inline-tests-with-unittest","text":"Some solution files include a `unittest.TestCase` subclass and `__main__` block alongside the solution, making them independently runnable via `python -m unittest` or direct execution.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/inline-tests-with-unittest.json"},{"id":"inorder-bst-yields-sorted","text":"The minimum-distance-between-bst-nodes solution relies on in-order traversal visiting BST nodes in ascending value order, reducing the problem to adjacent-pair difference comparison.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/inorder-bst-yields-sorted.json"},{"id":"inorder-name-misnomer","text":"The function is named `inorder` but performs string rotation; this appears to be a template artifact rather than an intentional name.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/inorder-name-misnomer.json"},{"id":"inorder-state-via-instance-vars","text":"BST inorder traversal solutions in this repo use instance variables (e.g., `self.prev`, `self.min_diff`) for running state across recursive calls rather than nonlocal closures or return-value threading.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/inorder-state-via-instance-vars.json"},{"id":"input-mutation-convention-coherent","text":"The in-place mutation with return convention forms a coherent repo-wide pattern, but inconsistent mutation behavior across solutions undermines it — some solutions mutate in-place for space efficiency while others create copies for the same category of operation, with no systematic policy governing which approach to use.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"derived","url":"/public/leetcode-expert/belief/input-mutation-convention-coherent.json"},{"id":"inscribed-square-side-is-min-dimension","text":"The rectangle-to-square solution (problem 1725) relies on the geometric identity that the largest square inscribable in rectangle `[l, w]` has side `min(l, w)`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/inscribed-square-side-is-min-dimension.json"},{"id":"integer-accumulators-precision-safe","text":"Scalar streaming accumulators achieve exact results for all inputs within LeetCode's constraint bounds because Python's arbitrary-precision integers prevent overflow and the repo systematically chooses integer arithmetic over floating-point — but this precision guarantee breaks for any solution that introduces floating-point division into the accumulation chain.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"derived","url":"/public/leetcode-expert/belief/integer-accumulators-precision-safe.json"},{"id":"integer-arithmetic-avoids-float-precision","text":"Solutions systematically choose integer operations — math.isqrt over math.sqrt, integer division over float division, sum comparison over average comparison — to avoid floating-point precision loss that could produce incorrect results for large inputs.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/integer-arithmetic-avoids-float-precision.json"},{"id":"intersect-ii-counter-decrement-streams-nums2","text":"`intersect` builds a Counter from `nums1` only, then consumes `nums2` in a single pass — only `nums1` must fit in memory, making this suitable for streaming `nums2` from disk.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/intersect-ii-counter-decrement-streams-nums2.json"},{"id":"intersect-ii-output-follows-nums2-order","text":"The output of `intersect` reflects the iteration order of `nums2`, not `nums1`, because elements are appended as `nums2` is walked.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/intersect-ii-output-follows-nums2-order.json"},{"id":"intersect-ii-preserves-min-frequency","text":"Each element appears in the output of `intersect` exactly `min(count_in_nums1, count_in_nums2)` times, enforced by a `> 0` guard that prevents the counter from going negative.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/intersect-ii-preserves-min-frequency.json"},{"id":"intersection-349-set-idiom-nondeterministic-order","text":"`Solution.intersection` (problem 349) uses Python's `set & set` operator, so output element order is nondeterministic and may vary across Python versions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/intersection-349-set-idiom-nondeterministic-order.json"},{"id":"intersection-assumes-nonempty-input","text":"intersection() accesses nums[0] unconditionally; passing an empty list raises IndexError. The LeetCode constraint guarantees at least one sub-array.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/intersection-assumes-nonempty-input.json"},{"id":"intersection-returns-sorted","text":"intersection() always returns elements in ascending order, enforced by sorted() on the final line.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/intersection-returns-sorted.json"},{"id":"intersection-uses-in-place-narrowing","text":"The result set only shrinks across iterations via &=; no element can appear in the output that wasn't in nums[0].","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/intersection-uses-in-place-narrowing.json"},{"id":"interval-overlap-formula","text":"The `max(0, min(end1, end2) - max(start1, start2) + 1)` idiom for closed-interval overlap length appears in `days_together` and is a cross-cutting pattern used across multiple solutions in the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/interval-overlap-formula.json"},{"id":"invariant-based-testing-for-bst","text":"BST-related tests verify structural properties (BST ordering, height-balance, in-order traversal matching input) rather than asserting a specific tree shape, making tests robust to multiple valid constructions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/invariant-based-testing-for-bst.json"},{"id":"invert-tree-double-application-is-identity","text":"`invert_tree` is idempotent over two calls: `invert_tree(invert_tree(root))` restores the original tree structure.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/invert-tree-double-application-is-identity.json"},{"id":"invert-tree-mutates-in-place","text":"`invert_tree` swaps child pointers on existing nodes rather than allocating new ones; the returned root is the same object as the input root.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/invert-tree-mutates-in-place.json"},{"id":"invert-tree-tuple-swap-prevents-clobber","text":"The simultaneous assignment `root.left, root.right = invert_tree(root.right), invert_tree(root.left)` evaluates both recursive calls before either assignment executes, preventing the bug where overwriting `root.left` first would lose the original left subtree before the right-side recursion reads it.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/invert-tree-tuple-swap-prevents-clobber.json"},{"id":"is-prime-covers-0-to-20","text":"`is_prime` uses a hardcoded set `{2,3,5,7,11,13,17,19}` that is correct for all integers 0–20, sufficient for inputs up to `2^20 - 1` (the problem's upper bound); extending beyond 20-bit inputs would require adding primes up to the new bit width","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/is-prime-covers-0-to-20.json"},{"id":"is-prime-trial-division-bound","text":"`is_prime` in prime-arrangements checks divisors only up to `int(k**0.5) + 1`, making it O(sqrt(k)) per call — sufficient for the n<=100 constraint but would need a sieve for larger inputs.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/is-prime-trial-division-bound.json"},{"id":"is-same-tree-null-guards-before-value-access","text":"`is_same_tree` checks both-None and one-None cases before any `.val` access, guaranteeing no `AttributeError` on `None` nodes.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/is-same-tree-null-guards-before-value-access.json"},{"id":"is-same-tree-short-circuits-on-mismatch","text":"`is_same_tree` evaluates `p.val == q.val and recurse(left) and recurse(right)` with short-circuit evaluation, bailing on the first structural or value mismatch without visiting remaining nodes.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/is-same-tree-short-circuits-on-mismatch.json"},{"id":"isdigit-filters-non-numeric-tokens","text":"`areNumbersAscending` uses `str.isdigit()` to skip non-numeric words entirely; safe for ASCII-only LeetCode inputs but would accept Unicode digit characters in general Python 3","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/isdigit-filters-non-numeric-tokens.json"},{"id":"island-perimeter-boundary-guard","text":"The `r > 0` and `c > 0` guards are the only bounds checks needed because the algorithm only examines up and left neighbors, never down or right.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/island-perimeter-boundary-guard.json"},{"id":"island-perimeter-single-pass","text":"The island perimeter algorithm computes the result in a single row-major scan with no auxiliary data structures, running in O(rows × cols) time and O(1) extra space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/island-perimeter-single-pass.json"},{"id":"island-perimeter-subtract-two","text":"Each shared edge between two land cells removes exactly 2 from the perimeter total; checking only up and left neighbors (not all four) guarantees each adjacency is counted exactly once because the scan is top-to-bottom, left-to-right.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/island-perimeter-subtract-two.json"},{"id":"isolation-cascades-to-tooling-unreliability","text":"The zero-coupling isolation architecture has second-order effects beyond style inconsistency: dependency-tracking tools produce systematically misleading output because the only cross-file references are test-harness imports, not true solution dependencies.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/isolation-cascades-to-tooling-unreliability.json"},{"id":"isolation-creates-undetectable-inconsistency","text":"Zero-coupling isolation both causes inconsistency (no forcing function for conventions) and makes it undetectable (dependency tools produce misleading metadata from the test harness), creating a feedback loop where style divergence accumulates silently and no automated tool can surface it.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/isolation-creates-undetectable-inconsistency.json"},{"id":"isolation-enables-style-drift","text":"The complete absence of cross-problem imports removes any forcing function for consistent conventions, directly enabling the class-vs-function divergence and method name mismatches observed across the repo.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/isolation-enables-style-drift.json"},{"id":"isolation-side-effects-invisible-at-runtime","text":"The second-order effects of per-problem isolation (tooling unreliability, undetectable naming drift, convention divergence) are invisible at runtime because each solution is executed and judged independently in the LeetCode submission context.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/isolation-side-effects-invisible-at-runtime.json"},{"id":"isomorphic-dual-map-bijection","text":"`is_isomorphic` enforces a bijection (not just a function) by maintaining two synchronized dictionaries — `s_to_t` and `t_to_s` — updated atomically for each new character pair.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/isomorphic-dual-map-bijection.json"},{"id":"isomorphic-early-return","text":"The function returns `False` at the first conflict detected during iteration; it never scans the full input when a violation exists at position `i`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/isomorphic-early-return.json"},{"id":"isomorphic-no-length-validation","text":"`is_isomorphic` assumes `len(s) == len(t)` without validation; `zip` silently truncates to the shorter string, so unequal-length inputs produce silently wrong results rather than errors.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/isomorphic-no-length-validation.json"},{"id":"isqrt-over-sqrt-for-exactness","text":"`isThreeDivisors` uses `math.isqrt` instead of `int(math.sqrt(n))` to avoid floating-point rounding errors in the perfect-square test; `isqrt` returns the exact integer square root.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/isqrt-over-sqrt-for-exactness.json"},{"id":"isqrt-over-sqrt-for-large-inputs","text":"Solutions needing integer square roots use `math.isqrt` instead of `int(math.sqrt(...))` to avoid floating-point precision errors, especially for inputs near 2^31-1.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/isqrt-over-sqrt-for-large-inputs.json"},{"id":"isqrt-preferred-over-float-sqrt","text":"`math.isqrt` is used instead of `int(math.sqrt(...))` to avoid incorrect results for large integers where float precision is insufficient (near 2^53).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/isqrt-preferred-over-float-sqrt.json"},{"id":"iterates-only-c1-keys","text":"`countWords` only iterates over `c1`'s keys, never `c2`'s — words exclusive to `words2` are never examined, which is correct since common words must appear in both arrays.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/iterates-only-c1-keys.json"},{"id":"iterative-not-recursive-tree-traversal","text":"Both n-ary tree traversal solutions (preorder and postorder) use explicit stack loops rather than recursion, avoiding Python's default 1000-frame recursion limit on deep trees.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/iterative-not-recursive-tree-traversal.json"},{"id":"iterative-over-recursive-tree-traversal","text":"Tree traversal solutions consistently use explicit stacks rather than recursion, avoiding Python's ~1000-frame recursion limit and handling arbitrarily deep trees.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/iterative-over-recursive-tree-traversal.json"},{"id":"iterative-reversal-O1-space","text":"`reverse_list` uses exactly three local pointer variables (`prev`, `curr`, `next_node`) regardless of list length, making it O(1) auxiliary space.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/iterative-reversal-O1-space.json"},{"id":"jewels-stones-case-sensitive","text":"Jewel matching is case-sensitive; `'a'` and `'A'` are treated as distinct jewel types, preserved by the set conversion.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/jewels-stones-case-sensitive.json"},{"id":"jewels-stones-duplicate-safe","text":"Duplicate characters in `jewels` are silently handled by set deduplication without affecting correctness, since the problem only asks about membership, not frequency.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/jewels-stones-duplicate-safe.json"},{"id":"jewels-stones-linear-time","text":"`num_jewels_in_stones` runs in O(J + S) time and O(J) space by converting `jewels` to a set for O(1) membership testing, then iterating `stones` with a generator expression.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/jewels-stones-linear-time.json"},{"id":"judge-circle-short-circuit","text":"`judgeCircle` makes 2–4 linear passes: it checks L/R counts first and short-circuits to `False` via Python `and` before counting U/D if horizontal balance already fails.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/judge-circle-short-circuit.json"},{"id":"k-beauty-string-sliding-window","text":"`divisor_substrings` uses string conversion and slicing (`str(num)[i:i+k]`) for digit extraction rather than modular arithmetic, which is the standard idiom for digit-substring problems in this repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-beauty-string-sliding-window.json"},{"id":"k-beauty-window-count-formula","text":"The sliding window iterates exactly `len(str(num)) - k + 1` times, which is the complete set of contiguous length-k substrings; if `k` exceeds the digit count, the range is empty and the function safely returns 0.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-beauty-window-count-formula.json"},{"id":"k-beauty-zero-guard-before-modulo","text":"`divisor_substrings` guards `sub != 0` before computing `num % sub`, preventing `ZeroDivisionError` when substrings like `\"00\"` parse to zero via `int()`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-beauty-zero-guard-before-modulo.json"},{"id":"k-distant-brute-force-complexity","text":"Worst-case time is O(n*k) when every element equals `key`, acceptable for the problem's n,k <= 1000 constraints.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-distant-brute-force-complexity.json"},{"id":"k-distant-clamping-prevents-oob","text":"`max(0, j-k)` and `min(n, j+k+1)` guarantee all generated indices stay within `[0, n)`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-distant-clamping-prevents-oob.json"},{"id":"k-distant-output-always-sorted","text":"The return value is always in ascending order because `sorted()` is applied to the set before returning.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-distant-output-always-sorted.json"},{"id":"k-distant-uses-set-dedup","text":"Overlapping ranges from multiple key positions are deduplicated via a Python `set`, avoiding interval-merging logic.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-distant-uses-set-dedup.json"},{"id":"k-equals-n-returns-whole-array","text":"In `largestSubarray`, when `k == len(nums)` the scan loop range is empty and the method correctly returns the entire array without special-casing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-equals-n-returns-whole-array.json"},{"id":"k-length-apart-consecutive-sufficiency","text":"`kLengthApart` only checks consecutive pairs of 1s; if all consecutive pairs satisfy the minimum distance, all pairs do (transitivity of minimum spacing in a linear scan).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-length-apart-consecutive-sufficiency.json"},{"id":"k-length-apart-gap-is-exclusive","text":"The gap expression `i - last - 1` in `kLengthApart` counts elements strictly between two 1-positions, not including the endpoints — so 1s at indices 2 and 5 yield a gap of 2.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-length-apart-gap-is-exclusive.json"},{"id":"k-length-apart-sentinel-minus-one","text":"`kLengthApart` initializes `last = -1` as a sentinel so the first 1 encountered never triggers a gap violation, avoiding a separate boolean flag.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-length-apart-sentinel-minus-one.json"},{"id":"k-negations-alias-is-misnomer","text":"The `is_univalued` alias for `largest_sum_after_k_negations` has no semantic relationship to this problem; it exists solely to satisfy the repo's test harness uniform-import convention.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-negations-alias-is-misnomer.json"},{"id":"k-negations-in-place-mutation","text":"`largest_sum_after_k_negations` mutates the input list via `sort()` and element assignment; callers that need the original array must copy before calling.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/k-negations-in-place-mutation.json"},{"id":"kelvin-is-index-zero","text":"`convert_temperature` returns `[kelvin, fahrenheit]` — Kelvin at index 0, Fahrenheit at index 1; swapping breaks the LeetCode judge contract.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kelvin-is-index-zero.json"},{"id":"kernighan-bit-clear-loop","text":"`hamming_weight` uses Brian Kernighan's `n &= n - 1` trick, iterating exactly k times for k set bits rather than a fixed 32 iterations","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kernighan-bit-clear-loop.json"},{"id":"keyboard-row-case-insensitive-match","text":"`find_words` lowercases each word for row lookup but returns the original-cased word — matching is case-insensitive, output is case-preserving.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/keyboard-row-case-insensitive-match.json"},{"id":"keyboard-row-no-input-validation","text":"Non-alphabetic characters in input words cause an unhandled `KeyError` from the `row_map` lookup; the function trusts the LeetCode constraint of alpha-only input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/keyboard-row-no-input-validation.json"},{"id":"keyboard-row-row-map-covers-26-letters","text":"`row_map` maps exactly the 26 lowercase English letters to row indices 0, 1, or 2; any non-alphabetic character causes a `KeyError`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/keyboard-row-row-map-covers-26-letters.json"},{"id":"keyboard-row-single-pass-filtering","text":"`find_words` is O(n*m) where n is word count and m is max word length — one pass through each word with constant-time dict lookups and a set-size check.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/keyboard-row-single-pass-filtering.json"},{"id":"kids-candies-empty-input-crashes","text":"Passing an empty `candies` list raises `ValueError` from `max()`; the problem constraints (`n >= 2`) prevent this under valid input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kids-candies-empty-input-crashes.json"},{"id":"kids-candies-gte-not-gt","text":"The comparison uses `>=` (not `>`), so a kid already at the global max always returns `True` regardless of `extraCandies`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kids-candies-gte-not-gt.json"},{"id":"kids-candies-linear-time","text":"`kidsWithCandies` runs in O(n) time and O(n) space, making exactly two passes over the input: one for `max`, one for the comprehension.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kids-candies-linear-time.json"},{"id":"kids-candies-no-mutation","text":"`kidsWithCandies` never modifies the input `candies` list; it returns a new boolean list.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kids-candies-no-mutation.json"},{"id":"kmp-empty-needle-returns-zero","text":"When `needle` is empty, `strStr` returns 0 without special-case code — a natural consequence of `j == m` when both are 0.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kmp-empty-needle-returns-zero.json"},{"id":"kmp-first-match-semantics","text":"`strStr` returns immediately on the first complete match (`j == m`), guaranteeing the leftmost occurrence index is returned.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kmp-first-match-semantics.json"},{"id":"kmp-implemented-over-builtin","text":"`strStr` implements KMP (Knuth-Morris-Pratt) manually rather than using Python's built-in `str.find()`, making the O(n + m) algorithmic intent explicit.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kmp-implemented-over-builtin.json"},{"id":"kmp-lps-fallback-invariant","text":"In the KMP implementation, the LPS array satisfies `0 <= lps[i] < i+1` for all `i`, and on mismatch the fallback `length = lps[length - 1]` guarantees forward progress — every search iteration either advances the haystack pointer or decreases the pattern pointer.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kmp-lps-fallback-invariant.json"},{"id":"kth-distinct-is-one-indexed","text":"The parameter `k` is 1-indexed; passing `k=1` returns the first distinct string, matching LeetCode's contract.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-distinct-is-one-indexed.json"},{"id":"kth-distinct-linear-time","text":"`kth_distinct` is O(n) time and O(n) space: one pass to build the Counter, one pass to scan for the kth unique element.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-distinct-linear-time.json"},{"id":"kth-distinct-preserves-insertion-order","text":"The second pass iterates `arr` in its original order, so \"kth distinct\" respects the position strings first appear, not alphabetical or any other ordering.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-distinct-preserves-insertion-order.json"},{"id":"kth-distinct-returns-empty-on-insufficient-distincts","text":"`kth_distinct` returns `\"\"` (not `None` or an exception) when fewer than `k` strings have count == 1.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-distinct-returns-empty-on-insufficient-distincts.json"},{"id":"kth-largest-add-is-log-k","text":"Each `add` call performs at most one push and one pop on a heap of size k, giving O(log k) time regardless of total stream length.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-largest-add-is-log-k.json"},{"id":"kth-largest-defensive-copy","text":"The `KthLargest` constructor copies `nums` via `nums[:]` before heapifying, so the caller's list is never modified by `heapify`'s in-place rearrangement.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-largest-defensive-copy.json"},{"id":"kth-largest-heap-size-invariant","text":"After `__init__` and every `add` call, `len(self.heap) <= self.k` holds unconditionally — the bounded min-heap never grows past k elements.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-largest-heap-size-invariant.json"},{"id":"kth-largest-root-is-answer","text":"`self.heap[0]` equals the kth largest element across all values ever provided (init + all add calls), assuming at least k values have been seen.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-largest-root-is-answer.json"},{"id":"kth-missing-binary-search-ologn","text":"`findKthPositive` runs in O(log n) time via binary search on the missing-count function `arr[i] - (i + 1)`, not the naive O(n) linear scan.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-missing-binary-search-ologn.json"},{"id":"kth-missing-formula-k-plus-left","text":"The final answer `k + left` works because `left` counts how many array elements appear before the kth missing number, each shifting the answer position up by one.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-missing-formula-k-plus-left.json"},{"id":"kth-missing-monotonic-invariant","text":"The binary search is valid because `arr[i] - (i + 1)` (count of missing positives before index i) is monotonically non-decreasing for a strictly increasing array of positive integers.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-missing-monotonic-invariant.json"},{"id":"kth-missing-right-bound-len-arr","text":"The right boundary is `len(arr)` (not `len(arr) - 1`) so the search correctly handles cases where all k missing numbers fall after every element in the array.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/kth-missing-right-bound-len-arr.json"},{"id":"l-geq-w-by-construction","text":"`L >= W` is enforced structurally, not by a conditional: since `w <= sqrt(area)`, `area // w >= sqrt(area) >= w` always holds.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/l-geq-w-by-construction.json"},{"id":"language-causally-determines-convergence-landscape","text":"Python's language-level defaults are a primary determinant of the convergence landscape: they privilege streaming by making it self-sufficient (Counter's zero-default, set's O(1) membership, arbitrary-precision integers require no external infrastructure), and this self-sufficiency aligns with the adoption-barrier gradient that makes convergence strength predictable from prerequisite count — suggesting the convergence pattern is substantially shaped by the host language's built-in semantics, not solely by the problem domain.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/language-causally-determines-convergence-landscape.json"},{"id":"language-defaults-determine-strategy-privilege","text":"Python's language-level defaults — particularly Counter's zero-default for missing keys and sentinel initialization for loop state — are a primary mechanism that makes streaming self-sufficient by encoding boundary conditions into initial state, removing the need for special-case logic in loop bodies. Because streaming is the privileged default strategy (self-sufficient, covering the largest problem subset with the tightest resource bounds), these defaults help explain why streaming occupies its dominant position in the solution taxonomy: the language's built-in semantics align with the prerequisites of the strategy that needs the least external support.","truth_value":"OUT","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/language-defaults-determine-strategy-privilege.json"},{"id":"language-produces-quality-inversion-through-streaming","text":"Python's language defaults produce the quality inversion through a specific three-step causal chain: language features determine which strategies are self-sufficient, streaming is privileged because it requires no abstractions beyond what the language provides natively, and streaming's dominance is the specific mechanism through which algorithmic quality outpaces engineering quality — making the quality inversion a downstream consequence of language design rather than developer choice.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/language-produces-quality-inversion-through-streaming.json"},{"id":"large-group-threshold-is-3","text":"A group is \"large\" if and only if it contains 3 or more consecutive identical characters; groups of length 1 or 2 are excluded from the result.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/large-group-threshold-is-3.json"},{"id":"largest-perimeter-triangle-mutates-input","text":"`largest_perimeter_triangle()` sorts the input list in-place via `nums.sort()`; callers who need the original order must copy before calling.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/largest-perimeter-triangle-mutates-input.json"},{"id":"largest-squares-at-array-extremes","text":"In a sorted array with negatives, the largest-magnitude elements (and thus largest squares) are always at the two ends, which is the invariant the two-pointer approach exploits","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/largest-squares-at-array-extremes.json"},{"id":"last-seen-stores-latest-index","text":"`last_seen[num]` always holds the most recent index where `num` appeared — the unconditional overwrite after each check maintains this invariant, which is what makes it safe to discard older indices.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/last-seen-stores-latest-index.json"},{"id":"lazy-single-pair-parsing","text":"`StringIterator` parses at most one `(char, count)` pair at a time via a cursor — it never pre-processes the entire compressed string, keeping memory O(1) even for counts up to 10^9.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lazy-single-pair-parsing.json"},{"id":"lc2099-function-misnamed-copypaste","text":"`find-subsequence-of-length-k-with-the-largest-sum/solution.py` exports a function named `count_patterns_in_word` that actually selects a max-sum subsequence — a copy-paste naming error from another solution, suggesting batch generation of solution files.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lc2099-function-misnamed-copypaste.json"},{"id":"lcis-assumes-nonempty","text":"`findLengthOfLCIS` initializes `max_len = 1` with no empty-array guard, returning 1 for empty input — correct only under LeetCode's `len >= 1` constraint","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lcis-assumes-nonempty.json"},{"id":"lcis-contiguous-not-subsequence","text":"Despite the problem title saying \"subsequence,\" `findLengthOfLCIS` finds a contiguous subarray — the problem name is historically misleading on LeetCode","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lcis-contiguous-not-subsequence.json"},{"id":"lcis-inline-max-update","text":"`findLengthOfLCIS` updates `max_len` only inside the increasing branch (when `cur_len` grows), not after every iteration, avoiding redundant comparisons","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lcis-inline-max-update.json"},{"id":"lcis-strictly-increasing","text":"`findLengthOfLCIS` breaks the streak on equal elements (uses `>`, not `>=`), so `[1, 1, 1]` returns 1","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lcis-strictly-increasing.json"},{"id":"lcp-early-termination","text":"`longest_common_prefix` terminates as soon as any single string diverges or ends, never examining characters past the common prefix length","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lcp-early-termination.json"},{"id":"lcp-empty-input-returns-empty","text":"An empty input list to `longest_common_prefix` returns `\"\"` without accessing any element","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lcp-empty-input-returns-empty.json"},{"id":"lcp-first-element-pivot","text":"`longest_common_prefix` uses `strs[0]` as the reference string and checks all remaining strings against it, avoiding an upfront `min(len(s))` computation","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lcp-first-element-pivot.json"},{"id":"lcp-inner-loop-slices","text":"`longest_common_prefix` iterates `strs[1:]` in the inner loop, allocating a new list slice on each outer iteration; a `range(1, len(strs))` index loop would avoid this","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lcp-inner-loop-slices.json"},{"id":"lcp-vertical-scan","text":"`longest_common_prefix` scans characters column-by-column across all strings (vertical scanning), not by comparing pairs of strings sequentially","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lcp-vertical-scan.json"},{"id":"leading-zero-rejection","text":"Any numeric segment in `abbr` starting with `'0'` causes `validWordAbbreviation` to immediately return `False`, including standalone `0` (semantically meaningless \"skip zero characters\").","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leading-zero-rejection.json"},{"id":"leap-day-count-uses-y-minus-1","text":"`_days_from_epoch` counts leap days for completed years `1..(y-1)`, not `1..y`, because the current year's leap day is handled separately via the `month > 2` correction","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leap-day-count-uses-y-minus-1.json"},{"id":"leap-year-adjustment-only-after-feb","text":"`dayOfYear` adds 1 for leap years only when `month > 2`, correctly handling that Feb 29 itself is already counted by the `day` component when the date is in February.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leap-year-adjustment-only-after-feb.json"},{"id":"leetcode-bank-closed-form","text":"`totalMoney` computes the answer in O(1) time and space using arithmetic series formulas rather than simulating day-by-day deposits.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-bank-closed-form.json"},{"id":"leetcode-imported-by-lists-misleading","text":"The tooling's \"Imported By\" cross-reference lists are misleadingly large — each problem's `test_solution.py` imports only its own directory's `solution.py`, not other problems' solutions","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-imported-by-lists-misleading.json"},{"id":"leetcode-judge-optimized-not-reusable","text":"Design decisions — no input validation, in-place mutation of arguments, per-directory duplication of data structures — collectively optimize solutions for single-run correctness on LeetCode's online judge rather than for reuse, composability, or library consumption.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/leetcode-judge-optimized-not-reusable.json"},{"id":"leetcode-no-input-validation-convention","text":"Solutions assume inputs satisfy LeetCode's stated constraints and perform zero validation or error handling — invalid inputs either raise unhandled exceptions or produce wrong output silently.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-no-input-validation-convention.json"},{"id":"leetcode-repo-mixed-function-style","text":"Solutions inconsistently use either a `Solution` class with methods or bare module-level functions — both patterns coexist in the repo","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-repo-mixed-function-style.json"},{"id":"leetcode-solution-class-convention","text":"Every problem directory contains a `solution.py` with a `Solution` class exposing a single public method, following LeetCode's standard interface pattern.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-solution-class-convention.json"},{"id":"leetcode-solutions-assume-valid-input","text":"Solutions throughout the repo omit input validation (bounds checking, type checks, empty-state guards), relying on LeetCode's guaranteed-valid-input contract. Invalid inputs may raise uncaught exceptions or produce silently wrong results.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-solutions-assume-valid-input.json"},{"id":"leetcode-solutions-no-input-validation","text":"Solutions across the repo perform no input validation — they trust LeetCode's guaranteed constraints and raise unhandled exceptions on malformed input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-solutions-no-input-validation.json"},{"id":"leetcode-solutions-no-validation-convention","text":"All LeetCode solutions in this repo omit input validation, trusting the caller to satisfy the problem's stated constraints; this is a deliberate convention matching LeetCode's guaranteed-valid-input contract.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-solutions-no-validation-convention.json"},{"id":"leetcode-solutions-omit-input-validation","text":"Solutions in this repo consistently perform no input validation (no bounds checking, type checking, or constraint verification), relying entirely on LeetCode's problem guarantees enforced by the judge.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-solutions-omit-input-validation.json"},{"id":"leetcode-solutions-skip-input-validation","text":"All solution functions rely on LeetCode's input constraints rather than performing their own bounds checking; invalid inputs produce undefined behavior (empty strings, IndexError, etc.)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-solutions-skip-input-validation.json"},{"id":"leetcode-solutions-trust-constraints","text":"Solutions in this repo perform no input validation (no bounds checks, no type checks, no empty-input guards); they rely on LeetCode's guaranteed preconditions, and invalid inputs cause raw Python exceptions (`IndexError`, `ValueError`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-solutions-trust-constraints.json"},{"id":"leetcode-solutions-trust-input-constraints","text":"Solutions in this repo universally omit input validation (null checks, range checks, format checks), relying on LeetCode's guarantee that inputs satisfy stated constraints. This is by design, not an oversight.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-solutions-trust-input-constraints.json"},{"id":"leetcode-solutions-trust-input-contracts","text":"Across all solutions in the repo, functions perform no input validation and raise no exceptions — they trust callers to satisfy LeetCode problem constraints. Invalid inputs (empty arrays, wrong types, violated invariants) produce silent wrong results or unguarded crashes.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-solutions-trust-input-contracts.json"},{"id":"leetcode-solutions-trust-input-convention","text":"Solutions across the repo generally perform no input validation beyond problem-specific guards (e.g., empty-input check in destCity), trusting LeetCode's constraints for type safety, value ranges, and structural guarantees.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leetcode-solutions-trust-input-convention.json"},{"id":"left-biased-binary-search-pattern","text":"First-bad-version uses left-biased binary search: when `isBadVersion(mid)` is true, `right = mid` (not `mid - 1`) because `mid` itself may be the answer; when false, `left = mid + 1` since `mid` is definitively excluded.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/left-biased-binary-search-pattern.json"},{"id":"left-leaf-root-never-counted","text":"A single-node tree returns 0 from `sum_of_left_leaves` because the root is seeded with `is_left=False` — the root cannot be a \"left leaf\" regardless of its children.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/left-leaf-root-never-counted.json"},{"id":"left-mid-bias-on-even-length","text":"`(left + right) // 2` selects the left-middle element for even-length ranges, producing a left-leaning balanced BST; choosing `(left + right + 1) // 2` would also be valid.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/left-mid-bias-on-even-length.json"},{"id":"leftovers-equals-odd-frequency-count","text":"The `leftovers` value returned by `count_pairs_leftovers` equals the number of distinct values in `nums` that appear an odd number of times, since each contributes exactly `count % 2 == 1`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/leftovers-equals-odd-frequency-count.json"},{"id":"lemonade-change-early-return","text":"The lemonade-change solution short-circuits with `False` at the first customer who can't receive correct change, skipping the rest of the queue.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lemonade-change-early-return.json"},{"id":"lemonade-greedy-order-is-critical","text":"For $20 bills, the lemonade-change solution must prefer $10+$5 over $5×3 — this ordering is required for correctness, not just an optimization.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lemonade-greedy-order-is-critical.json"},{"id":"length-of-last-word-no-empty-guard","text":"`length_of_last_word` assumes `s` contains at least one word; passing an empty or all-whitespace string raises `IndexError` from `split()[-1]`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/length-of-last-word-no-empty-guard.json"},{"id":"length-of-last-word-o-n-space","text":"`length_of_last_word` runs in O(n) space because `split()` materializes the full word list, not just the last word.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/length-of-last-word-o-n-space.json"},{"id":"length-of-last-word-uses-no-arg-split","text":"`length_of_last_word` relies on `str.split()` with no arguments, which collapses consecutive whitespace and strips leading/trailing spaces — distinct from `str.split(' ')`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/length-of-last-word-uses-no-arg-split.json"},{"id":"lexicographic-hhmm-is-chronological","text":"Comparing `\"HH:MM\"` strings with `<=` produces correct chronological ordering because the format is fixed-width and zero-padded; this breaks if the input is not zero-padded (e.g., `\"9:30\"` instead of `\"09:30\"`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lexicographic-hhmm-is-chronological.json"},{"id":"lhs-counter-based-linear","text":"`findLHS` runs in O(n) time and O(n) space via a single `Counter` construction and one pass over distinct keys","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lhs-counter-based-linear.json"},{"id":"lhs-one-directional-check","text":"`findLHS` only checks `k + 1` in the counter (never `k - 1`), ensuring each valid adjacent pair is counted exactly once without double-counting","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lhs-one-directional-check.json"},{"id":"lhs-returns-zero-for-uniform-list","text":"`findLHS` returns 0 when all elements are identical, because a harmonious subsequence requires max - min == 1, not 0","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lhs-returns-zero-for-uniform-list.json"},{"id":"lhs-subsequence-not-subarray","text":"`findLHS` correctly treats the input as a subsequence problem (order-independent) by using frequency counts rather than positional logic","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lhs-subsequence-not-subarray.json"},{"id":"license-key-empty-input-safe","text":"License-key-formatting handles all-dashes or empty input without error — the loop range is empty, `parts` stays `[]`, and `\"-\".join([])` returns `\"\"`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/license-key-empty-input-safe.json"},{"id":"license-key-first-group-remainder","text":"In license-key-formatting, the first group size equals `len(cleaned) % k`; all subsequent groups are exactly `k` characters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/license-key-first-group-remainder.json"},{"id":"license-key-strip-then-partition","text":"The license-key-formatting solution uses the strip-then-partition pattern: destroy all existing structure (`replace` + `upper`), then rebuild from scratch — avoiding edge cases around existing group boundaries.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/license-key-strip-then-partition.json"},{"id":"line-break-before-overflow","text":"In the line-writing solution (problem 806), a new line starts *before* the character that would exceed 100 pixels; a character landing exactly at 100 does not trigger a break","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/line-break-before-overflow.json"},{"id":"linear-time-no-simulation","text":"`count_pairs_leftovers` avoids the O(n^2) pair-removal simulation described in the problem and instead uses O(n) frequency counting with `Counter` plus integer division.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/linear-time-no-simulation.json"},{"id":"linear-time-two-scan","text":"`maxDistance` achieves O(n) time and O(1) space via two linear scans with early termination, anchoring at opposite endpoints.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/linear-time-two-scan.json"},{"id":"linked-list-cycle-read-only","text":"`hasCycle` never modifies the list — it is a purely read-only traversal, preserving the original structure.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/linked-list-cycle-read-only.json"},{"id":"linked-list-intersection-identity-not-equality","text":"`getIntersectionNode` uses `a is not b` (identity comparison), not value equality — two nodes with the same `val` at different addresses are not considered an intersection.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/linked-list-intersection-identity-not-equality.json"},{"id":"linked-list-two-pointer-redirect-convergence","text":"The two-pointer redirect trick guarantees convergence: each pointer traverses both lists (total `len(A) + len(B)` nodes), so they align at the intersection node or both reach `None` simultaneously if lists don't intersect.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/linked-list-two-pointer-redirect-convergence.json"},{"id":"listnode-defined-locally-per-problem","text":"`ListNode` is defined locally in each linked-list problem's `solution.py` rather than imported from a shared module — keeps solutions self-contained but means the class is duplicated across every linked-list problem in the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/listnode-defined-locally-per-problem.json"},{"id":"listnode-defined-per-solution","text":"`ListNode` is redefined locally in each linked-list solution file rather than imported from a shared module, keeping each problem directory self-contained.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/listnode-defined-per-solution.json"},{"id":"listnode-shared-dependency","text":"`ListNode`, `from_list`, and `to_list` defined in `remove-linked-list-elements/solution.py` are imported by hundreds of other problem directories as the repo's de facto shared linked list utilities, despite living under a single problem's directory.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/listnode-shared-dependency.json"},{"id":"logger-10s-boundary-inclusive","text":"A message printed at timestamp `t` can be printed again at exactly `t + 10` — the comparison is `>=`, making the blocked window `[t, t+10)`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/logger-10s-boundary-inclusive.json"},{"id":"logger-no-state-change-on-reject","text":"When `shouldPrintMessage` returns `False`, the `next_allowed` dict is not modified — only accepted messages update state.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/logger-no-state-change-on-reject.json"},{"id":"logger-stores-next-allowed-not-last-seen","text":"The logger stores `timestamp + 10` (next-allowed time) rather than the last-seen timestamp, collapsing the acceptance check to a single `>=` comparison.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/logger-stores-next-allowed-not-last-seen.json"},{"id":"logger-unbounded-memory","text":"The logger's `next_allowed` dict is never pruned; memory grows monotonically with the number of distinct messages over the logger's lifetime.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/logger-unbounded-memory.json"},{"id":"logger-unseen-message-always-prints","text":"A never-seen message always returns `True` because `dict.get(message, 0)` returns `0`, which any non-negative timestamp satisfies.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/logger-unseen-message-always-prints.json"},{"id":"lonely-detection-parent-perspective","text":"Lonely-node detection operates from the parent's perspective (checking if exactly one child exists), which structurally excludes the root from results without special-casing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lonely-detection-parent-perspective.json"},{"id":"lonely-detection-xor-logic","text":"A child is appended to lonely-node results if and only if exactly one of `(left, right)` exists at the parent — a logical XOR on child presence, implemented via `if`/`elif` branches.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lonely-detection-xor-logic.json"},{"id":"long-press-full-consumption","text":"`isLongPressedName` returns `i == len(name)` to reject cases where `typed` is a valid long-press prefix of `name` but doesn't cover all characters","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/long-press-full-consumption.json"},{"id":"long-press-greedy-order","text":"The `isLongPressedName` algorithm never backtracks pointer `i`; each character in `name` is matched at most once, left to right, using a greedy two-pointer approach","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/long-press-greedy-order.json"},{"id":"long-press-j0-guard","text":"The `j > 0` guard in `isLongPressedName` prevents `typed[j-1]` from wrapping to the last character when `j == 0`, ensuring the first character must match `name[0]` or fail","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/long-press-j0-guard.json"},{"id":"long-press-three-case-dispatch","text":"Each character in `typed` is handled by exactly one of three cases: match (advance `i`), long-press repeat (skip), or mismatch (return False immediately)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/long-press-three-case-dispatch.json"},{"id":"long-press-time-complexity","text":"`isLongPressedName` runs in O(len(typed)) time with O(1) extra space since pointer `i` only moves forward and the loop visits each `typed` character exactly once","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/long-press-time-complexity.json"},{"id":"longest-task-first-starts-at-zero","text":"The employee-longest-task solution treats the first task as starting at time 0, capturing its duration as `logs[0][1]` directly without explicit subtraction.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/longest-task-first-starts-at-zero.json"},{"id":"longest-task-parameter-n-unused","text":"The `n` parameter in `worker_with_longest_task` exists solely to match the LeetCode signature and has no effect on the algorithm or output.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/longest-task-parameter-n-unused.json"},{"id":"longest-task-single-pass-o1-space","text":"`worker_with_longest_task` makes exactly one pass over `logs` using three scalar variables — O(n) time, O(1) space.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/longest-task-single-pass-o1-space.json"},{"id":"longest-task-tie-break-smallest-id","text":"When two tasks have equal duration, `worker_with_longest_task` retains the employee with the strictly smaller ID, not the one encountered first.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/longest-task-tie-break-smallest-id.json"},{"id":"lookup-abstraction-trio-covers-all-queries","text":"Three lookup abstractions recur across the repo's solution patterns: Counter for frequency, multiset, and pair-counting queries; set conversion for O(1) membership and dedup checks; and binary search for convergence-based positional queries. Together these cover a broad range of query patterns encountered in the codebase, each providing efficient time complexity for its query type.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/lookup-abstraction-trio-covers-all-queries.json"},{"id":"lookup-abstractions-enable-linear-time-across-paradigms","text":"The three lookup abstractions (Counter, set, binary search) are the mechanism that converts preprocessing investment into linear-time scans across both paradigms: hash preprocessing enables O(1) per-query lookups while sort preprocessing enables O(log n) binary search, and both reduce what would be O(n²) nested iteration to O(n) or O(n log n) single-pass scans.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/lookup-abstractions-enable-linear-time-across-paradigms.json"},{"id":"lookup-abstractions-instantiate-pipeline-phases","text":"The lookup abstraction trio (Counter, set, binary search) is the load-bearing joint between the pipeline's preprocessing and scanning phases — each preprocessing paradigm (hash or sort) establishes exactly the data structure one of these abstractions queries, making the lookup the mechanism that converts preprocessing investment into linear-time scan payoff across both pipeline instantiations.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/lookup-abstractions-instantiate-pipeline-phases.json"},{"id":"lookup-string-as-digit-map","text":"`hex_chars = \"0123456789abcdef\"` uses string indexing as a lightweight digit-to-character mapping, avoiding dictionaries or conditional chains.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lookup-string-as-digit-map.json"},{"id":"loop-terminates-at-one","text":"The width search loop always terminates because `w = 1` divides every positive integer, serving as a universal fallback.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/loop-terminates-at-one.json"},{"id":"lstrip-zero-fallback-prevents-empty-key","text":"The `or '0'` guard after `lstrip('0')` in `num_different_integers` ensures all-zero strings like `\"000\"` canonicalize to `\"0\"` rather than the empty string, which would silently miscount distinct integers.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lstrip-zero-fallback-prevents-empty-key.json"},{"id":"lucky-numbers-distinct-values-required","text":"The lucky numbers solution uses `row.index(min_val)` which returns the first occurrence; correctness depends on all matrix values being distinct, as duplicates could cause incorrect column selection.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lucky-numbers-distinct-values-required.json"},{"id":"lucky-numbers-row-min-then-col-max","text":"The algorithm finds row minimums first, then validates each candidate as a column maximum via a linear scan; it never independently scans columns to find maximums.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lucky-numbers-row-min-then-col-max.json"},{"id":"lus-mathematical-reduction","text":"Longest Uncommon Subsequence I collapses to a string equality check: if strings differ, return `max(len(a), len(b))`; if equal, return `-1` — no subsequence enumeration needed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/lus-mathematical-reduction.json"},{"id":"majority-check-bounds-safe","text":"The short-circuit `and` in `is_majority_element` guarantees `nums[first + n // 2]` is never accessed out of bounds — the left operand `first + n // 2 < n` must be true before the right operand is evaluated.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/majority-check-bounds-safe.json"},{"id":"majority-check-single-bisect","text":"`is_majority_element` uses exactly one `bisect_left` call to achieve O(log n) majority checking — it avoids a second binary search by checking `nums[first + n//2] == target` directly.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/majority-check-single-bisect.json"},{"id":"majority-threshold-floor-division","text":"The majority threshold is `n // 2` (floor division), so the target must appear at least `n // 2 + 1` times; for n=5 that means ≥3 occurrences.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/majority-threshold-floor-division.json"},{"id":"make-string-great-method-name-mismatch","text":"The method in `make-the-string-great/solution.py` is named `goodNodes` but implements LeetCode 1544's `makeGood`; this is a copy-paste artifact from a tree problem.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/make-string-great-method-name-mismatch.json"},{"id":"make-string-sorted-is-misnomer","text":"The module-level alias `make_string_sorted` in the equal-occurrences solution does not match the problem name or the method it wraps (`areOccurrencesEqual`) — likely a copy-paste artifact from code generation tooling.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/make-string-sorted-is-misnomer.json"},{"id":"mass-import-is-test-scaffolding","text":"The hundreds of \"Imported By\" entries shown for solution files are artifacts of the repo's test harness structure — the test runner imports all solution modules uniformly, not because solutions depend on each other","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mass-import-is-test-scaffolding.json"},{"id":"mathematical-insight-replaces-brute-computation","text":"Solutions leverage mathematical reasoning — closed-form formulas for arithmetic series, greedy optimality proofs for prefix-free codes and assignment problems, algebraic reductions — to replace iterative or exhaustive computation with provably correct O(1) or O(n) alternatives.","truth_value":"IN","justification_count":1,"dependent_count":4,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/mathematical-insight-replaces-brute-computation.json"},{"id":"mathematical-reduction-eliminates-all-runtime-state","text":"Mathematical reduction achieves the logical extreme of the space minimization strategy: by replacing iteration with closed-form computation, it eliminates both the algorithmic state (running accumulators that streaming requires) and structural state (preprocessed data structures that pipeline solutions require), collapsing the entire scan-accumulate loop to a single constant-time evaluation with zero auxiliary memory.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/mathematical-reduction-eliminates-all-runtime-state.json"},{"id":"mathematical-reduction-is-degenerate-streaming","text":"Closed-form mathematical solutions are degenerate instances of the streaming paradigm: they reduce the \"scan\" to a single constant-time evaluation, eliminating not just preprocessing but iteration itself — the logical extreme of streaming's progressive elimination of computational prerequisites.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/mathematical-reduction-is-degenerate-streaming.json"},{"id":"mathematical-reduction-is-third-elimination-axis","text":"Mathematical reduction (closed-form formulas, modular arithmetic) constitutes a third axis of the elimination principle alongside construction-based validation elimination and isolation-based coupling elimination: where construction eliminates runtime checks and isolation eliminates inter-module dependencies, mathematical reduction eliminates computational phases entirely.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/mathematical-reduction-is-third-elimination-axis.json"},{"id":"mathematical-reduction-proves-streaming-extremal-minimality","text":"Closed-form mathematical solutions serve as constructive proofs of streaming's extremal minimality: by collapsing the streaming scan to a single constant-time evaluation while remaining within the paradigm (as degenerate instances), they demonstrate that the normal form admits reduction all the way to zero iteration — the theoretical minimum of the minimal strategy.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/mathematical-reduction-proves-streaming-extremal-minimality.json"},{"id":"mathematical-reduction-unifies-simulation-elimination","text":"Closed-form algebraic formulas and modular arithmetic are two instances of the same strategy: replacing iterative simulation with direct mathematical computation, eliminating entire computational phases rather than optimizing them.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/mathematical-reduction-unifies-simulation-elimination.json"},{"id":"max-avg-no-input-validation","text":"`findMaxAverage` performs no validation on inputs; it will divide by zero if `k == 0` and may return incorrect results if `k > len(nums)`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-avg-no-input-validation.json"},{"id":"max-avg-sliding-window-o-n","text":"The maximum average subarray solution runs in O(n) time and O(1) extra space by maintaining a running sum and sliding a fixed-size window.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-avg-sliding-window-o-n.json"},{"id":"max-avg-tracks-sum-not-average","text":"`findMaxAverage` tracks the maximum window sum during iteration and only divides by `k` once at the end, avoiding repeated floating-point division and accumulation errors.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-avg-tracks-sum-not-average.json"},{"id":"max-captured-forts-anchor-greedy","text":"`last_non_zero` is updated on every non-zero element, not just on successful captures, ensuring the closest valid anchor is always used for future candidates.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-captured-forts-anchor-greedy.json"},{"id":"max-captured-forts-bidirectional","text":"`max_captured_forts` captures both 1→(-1) and (-1)→1 movements in a single pass via a `!=` sign check between the current non-zero and the last-seen non-zero anchor.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-captured-forts-bidirectional.json"},{"id":"max-captured-forts-linear-time","text":"`max_captured_forts` runs in O(n) time with a single pass and O(1) auxiliary space, using an anchor-tracking scan over non-zero elements.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-captured-forts-linear-time.json"},{"id":"max-captured-forts-no-validation","text":"`max_captured_forts` performs no input validation; it assumes all elements are in {-1, 0, 1} per the LeetCode contract and relies on only 0s existing between non-zero indices.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-captured-forts-no-validation.json"},{"id":"max-consecutive-ones-eager-update","text":"The maximum is updated inside the `n == 1` branch only, eliminating the need for a post-loop `max()` call and avoiding a redundant comparison on every 0-element.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-consecutive-ones-eager-update.json"},{"id":"max-consecutive-ones-non1-as-terminator","text":"The function does not validate that elements are 0 or 1; any non-1 value (including 2, -1, etc.) silently acts as a streak terminator.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-consecutive-ones-non1-as-terminator.json"},{"id":"max-consecutive-ones-pure-streaming-exemplar","text":"Max consecutive ones is a pure streaming exemplar demonstrating all three structural properties of the paradigm in minimal form: single-pass O(n) scan with O(1) space (paradigm shape), eager in-loop max update eliminating post-loop fixup (extend-or-reset pattern), and correct empty-input handling via zero-initialization (sentinel boundary handling).","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/max-consecutive-ones-pure-streaming-exemplar.json"},{"id":"max-consecutive-ones-single-pass","text":"`findMaxConsecutiveOnes` runs in O(n) time and O(1) space with exactly one pass over the input using a streaming accumulator with reset-on-mismatch.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-consecutive-ones-single-pass.json"},{"id":"max-consecutive-ones-zero-on-empty","text":"The function returns 0 for empty input and for arrays containing no 1s, without special-casing either scenario.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-consecutive-ones-zero-on-empty.json"},{"id":"max-depth-assumes-valid-input","text":"`maxDepth` does not validate that parentheses are balanced; `depth` could go negative on malformed input, producing silently wrong results.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-depth-assumes-valid-input.json"},{"id":"max-depth-nary-depth-convention","text":"Depth is 1-indexed across tree problems: a single-node tree returns 1, an empty tree returns 0.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-depth-nary-depth-convention.json"},{"id":"max-depth-nary-leaf-guard","text":"The `if not root.children: return 1` check prevents `ValueError` from calling `max()` on an empty generator; removing it breaks leaf nodes.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-depth-nary-leaf-guard.json"},{"id":"max-depth-nary-node-children-default","text":"`Node.__init__` normalizes `children=None` to `[]`, avoiding the mutable default argument pitfall and ensuring callers can omit the argument.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-depth-nary-node-children-default.json"},{"id":"max-depth-o1-space","text":"`maxDepth` uses O(1) space with two integer counters (`depth` and `max_depth`), avoiding the O(n) stack that a structural parenthesis solution would require.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-depth-o1-space.json"},{"id":"max-depth-single-pass","text":"`maxDepth` makes exactly one character-by-character pass over the input string in O(n) time.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-depth-single-pass.json"},{"id":"max-difference-alias-is-vestigial","text":"The `max_difference` class-level alias on the candies-with-discount Solution has no semantic connection to the problem and appears to be a scaffolding artifact from the code generation pipeline.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-difference-alias-is-vestigial.json"},{"id":"max-distance-endpoint-invariant","text":"In `maxDistance`, the optimal pair always includes index 0 or index n-1; the proof is that any interior-only pair can be extended to an endpoint for a strictly larger distance.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-distance-endpoint-invariant.json"},{"id":"max-distance-mutates-input","text":"`max_distance` sorts `nums` in-place; callers cannot rely on the original ordering after the call.","truth_value":"OUT","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-distance-mutates-input.json"},{"id":"max-heap-via-negation-idiom","text":"Solutions needing max-heap behavior negate values on insert and negate again on extract, since Python's `heapq` only provides a min-heap.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-heap-via-negation-idiom.json"},{"id":"max-product-three-o-nlogn","text":"`maximumProduct` uses O(n log n) sort when an O(n) single-pass tracking five extremes (min1, min2, max1, max2, max3) is possible — a deliberate simplicity-over-performance tradeoff.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-product-three-o-nlogn.json"},{"id":"max-product-two-candidates","text":"The maximum product of three numbers from a sorted array is always `max(top3_product, bottom2_times_top1)` — no other combination of three indices can produce a larger value.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-product-two-candidates.json"},{"id":"max-remap-first-non-nine","text":"The max value in digit-remapping is always achieved by remapping the leftmost non-9 digit to 9, because that digit has the highest positional weight among improvable digits.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-remap-first-non-nine.json"},{"id":"max-repeating-no-empty-word-guard","text":"`longestAwesomeSubstring` (the maximum repeating substring solver) has no guard against empty `word` input — `\"\" in sequence` is always `True`, causing an infinite loop. Correctness depends on the LeetCode constraint `len(word) >= 1`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-repeating-no-empty-word-guard.json"},{"id":"max-sum-greedy-correctness","text":"The closed-form formula is equivalent to greedily picking all 1s, then all 0s, then -1s, which is provably optimal because item values are strictly ordered (1 > 0 > -1).","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-sum-greedy-correctness.json"},{"id":"max-sum-is-closed-form","text":"`max_sum` computes the answer in O(1) time with no loops or data structures, reducing the greedy pick strategy to `min(k, numOnes) - max(0, k - numOnes - numZeros)`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-sum-is-closed-form.json"},{"id":"max-sum-no-input-validation","text":"`max_sum` does not validate that `k <= numOnes + numZeros + numNegOnes`; violating this precondition produces a mathematically valid but semantically meaningless result where the implied -1 count exceeds `numNegOnes`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max-sum-no-input-validation.json"},{"id":"max69-greedy-leftmost","text":"Replacing the leftmost 6 with 9 is provably optimal because higher-order digit positions have exponentially greater value; `str.replace` with count=1 naturally targets this position.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max69-greedy-leftmost.json"},{"id":"max69-no-op-on-all-nines","text":"When `num` contains no 6s, the function returns the input unchanged because `str.replace` is a no-op when the target substring is absent — no special-case code needed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max69-no-op-on-all-nines.json"},{"id":"max69-single-expression","text":"The entire solution is a single return expression (`int(str(num).replace(\"6\", \"9\", 1))`) with no control flow, leveraging `str.replace` count parameter for the \"at most one change\" constraint.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/max69-single-expression.json"},{"id":"maxdepth-is-pure-recursive","text":"`maxDepth` uses no auxiliary data structures; space complexity is O(h) from the call stack alone, where h is tree height.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/maxdepth-is-pure-recursive.json"},{"id":"maxdepth-none-returns-zero","text":"`maxDepth(None)` returns `0`, establishing that depth counts nodes on the path, not edges (a single node has depth 1).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/maxdepth-none-returns-zero.json"},{"id":"maxpower-eager-max-update","text":"`max_count` is updated only inside the run-extension branch (`s[i] == s[i-1]`), never on run breaks; correctness depends on the initial value of 1 covering all length-1 runs.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/maxpower-eager-max-update.json"},{"id":"maxpower-empty-string-bug","text":"`maxPower` returns 1 for an empty string (loop is skipped, `max_count` stays at its initial value of 1) rather than 0 or raising — safe only because LeetCode guarantees `len(s) >= 1`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/maxpower-empty-string-bug.json"},{"id":"maxpower-linear-time","text":"`maxPower` runs in O(n) time and O(1) space using a single-pass \"current vs. previous\" scan — the canonical pattern for run-length problems.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/maxpower-linear-time.json"},{"id":"meeting-rooms-mutates-input","text":"`can_attend_meetings` sorts the `intervals` list in-place, modifying the caller's data.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/meeting-rooms-mutates-input.json"},{"id":"meeting-rooms-no-imports","text":"The meeting-rooms solution uses no imports — it is pure Python with no standard library or external dependencies.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/meeting-rooms-no-imports.json"},{"id":"meeting-rooms-sort-then-scan","text":"`can_attend_meetings` uses O(n log n) sort + O(n) adjacent-pair scan; correctness relies on the invariant that after sorting by start time, overlap can only occur between adjacent intervals.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/meeting-rooms-sort-then-scan.json"},{"id":"meeting-rooms-strict-boundary","text":"Meetings sharing an endpoint (e.g., `[0,10]` and `[10,20]`) are not considered overlapping; the overlap check uses `>`, not `>=`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/meeting-rooms-strict-boundary.json"},{"id":"merge-alternately-linear-complexity","text":"`mergeAlternately` runs in O(n + m) time and space via a single pass with list accumulation and join.","truth_value":"IN","justification_count":0,"dependent_count":2,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-alternately-linear-complexity.json"},{"id":"merge-alternately-output-length","text":"Output length of `mergeAlternately` is always exactly `len(word1) + len(word2)` — no characters are dropped or duplicated.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-alternately-output-length.json"},{"id":"merge-alternately-word1-first","text":"At each index position, `mergeAlternately` appends `word1`'s character before `word2`'s, guaranteeing `word1` leads at every shared index.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-alternately-word1-first.json"},{"id":"merge-no-allocation","text":"`merge_two_lists` allocates exactly one `ListNode` (the dummy sentinel); all output nodes are reused from the inputs via pointer rewiring.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-no-allocation.json"},{"id":"merge-nums-aliases-unmatched","text":"For IDs appearing in only one input, `merge_nums` appends a reference to the original `[id, value]` sublist rather than a copy — callers mutating the output can inadvertently modify the input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-nums-aliases-unmatched.json"},{"id":"merge-nums-no-input-mutation","text":"`merge_nums` never modifies `nums1` or `nums2`; matched entries produce new `[id, sum]` lists, while unmatched entries are appended by reference.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-nums-no-input-mutation.json"},{"id":"merge-nums-sorted-precondition","text":"`merge_nums` correctness depends on both inputs being sorted by ID; unsorted inputs produce incorrect results silently with no validation or error.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-nums-sorted-precondition.json"},{"id":"merge-nums-two-pointer-linear-time","text":"`merge_nums` uses a two-pointer merge pattern, visiting each element exactly once for O(n + m) time complexity — exploiting the sorted precondition rather than using a hash map.","truth_value":"IN","justification_count":0,"dependent_count":2,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-nums-two-pointer-linear-time.json"},{"id":"merge-paradigm-linear-via-pointer-advancement","text":"The merge problem family (merge-alternately, merge-nums, merge-two-lists) collectively demonstrates that pointer-per-input advancement achieves O(n+m) time with minimal allocation: each pointer advances monotonically, the merge is stable (equal-value ties broken by input ordering), and the output reuses existing nodes rather than allocating fresh ones.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/merge-paradigm-linear-via-pointer-advancement.json"},{"id":"merge-scan-extends-sort-pipeline-to-dual-inputs","text":"The merge-scan pattern is the canonical extension of the sort-then-two-pointer pipeline to problems with two pre-sorted input sequences: instead of sorting a single array then scanning with converging pointers, it interleaves two already-sorted inputs using advancing pointers, preserving the pipeline's structure while accepting dual inputs.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/merge-scan-extends-sort-pipeline-to-dual-inputs.json"},{"id":"merge-scan-pattern-for-sorted-pair-processing","text":"The two-pointer merge-scan pattern (maintain a pointer into each sorted sequence, advance the pointer on the smaller value, act on equality or exhaustion) is a recurring O(n+m) technique for processing paired elements from two sorted inputs — instantiated in merge-alternately (interleave by index), merge-nums (sum by matching ID), and min-common-number (return on first match).","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/merge-scan-pattern-for-sorted-pair-processing.json"},{"id":"merge-similar-items-output-sorted-by-value","text":"The return value of `sum_weights` is always sorted ascending by the first element (value) of each pair, enforced by `sorted()` on the final list comprehension.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-similar-items-output-sorted-by-value.json"},{"id":"merge-similar-items-self-contained-tests","text":"`merge-similar-items/solution.py` includes both the solution and a `unittest.TestCase` with 7 test methods, runnable standalone via `__main__`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-similar-items-self-contained-tests.json"},{"id":"merge-similar-items-uses-defaultdict-accumulation","text":"`sum_weights` uses `defaultdict(int)` to merge both lists in O(n) time before a single O(n log n) sort, rather than a two-pointer merge on pre-sorted input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-similar-items-uses-defaultdict-accumulation.json"},{"id":"merge-stable-ordering","text":"`merge_two_lists` is a stable merge: when both lists contain equal values, `list1`'s node appears first in the output due to the `<=` comparison.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-stable-ordering.json"},{"id":"merge-trees-creates-new-nodes-for-overlaps","text":"`merge_trees` allocates a new `TreeNode` for every position where both input trees have a node; it never mutates either input at overlapping positions.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-trees-creates-new-nodes-for-overlaps.json"},{"id":"merge-trees-hybrid-ownership-semantics","text":"The merge-trees algorithm produces a hybrid ownership structure: overlapping positions get newly allocated nodes (independent of inputs), while non-overlapping subtrees are shared by reference with the original trees — the output's lifetime is entangled with both inputs, making it unsafe to mutate either input tree after merging.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/merge-trees-hybrid-ownership-semantics.json"},{"id":"merge-trees-recursion-depth-equals-max-height","text":"`merge_trees` recursion depth is bounded by the height of the taller input tree — O(log n) for balanced trees, O(n) worst case for skewed trees.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-trees-recursion-depth-equals-max-height.json"},{"id":"merge-trees-shares-subtrees-for-non-overlaps","text":"When one input tree is `None` at a position, `merge_trees` returns the other tree's subtree by reference — the output shares structure with the inputs for non-overlapping regions.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/merge-trees-shares-subtrees-for-non-overlaps.json"},{"id":"method-alias-for-test-harness","text":"Solution classes alias the main method to a second name (e.g., `find_latest_step = countConsistentStrings`) with no semantic relationship to the algorithm — this exists purely to satisfy test infrastructure expectations","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/method-alias-for-test-harness.json"},{"id":"method-alias-is-test-harness-artifact","text":"`mincostTickets = divisorGame` in divisor-game/solution.py creates a class-level alias so the module satisfies generic `Solution` attribute lookups from other problems' test files — it has no semantic relationship to LeetCode 983.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/method-alias-is-test-harness-artifact.json"},{"id":"method-alias-pattern-for-leetcode-names","text":"The repo uses class-level aliasing (`correctName = wrongName`) to expose LeetCode-expected method names without wrapping overhead, as seen in `numberOfSteps = queensAttacktheKing`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/method-alias-pattern-for-leetcode-names.json"},{"id":"method-name-mismatch-minimum-moves","text":"`Solution.maximumRemovals` in `minimum-moves-to-convert-string/solution.py` is misnamed; it solves LeetCode 2027 (minimum moves to convert string), not LeetCode 1898 (maximum removals).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/method-name-mismatch-minimum-moves.json"},{"id":"method-name-mismatch-pattern","text":"Multiple solutions in the repo have method names from a different LeetCode problem due to copy-paste from templates (`maxSideLength` for 1413, `mctFromLeafValues` for 1228); tests likely bind to the wrong name to match.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/method-name-mismatch-pattern.json"},{"id":"method-name-mismatches-common","text":"Multiple solutions use method names that don't match LeetCode's canonical names (e.g., `numberOfWays` for problem 806, `numberOfSets` for problem 1725, `queensAttacktheKing` for problem 1342) — a recurring pattern across the repo, not isolated typos","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/method-name-mismatches-common.json"},{"id":"method-name-mismatches-exist","text":"Multiple solutions use incorrect method names that don't match LeetCode's canonical names (e.g., `sortItems` instead of `freqAlphabets` for #1309, `minOperations` instead of `decrypt` for #1652) — likely copy-paste artifacts from scaffolding.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/method-name-mismatches-exist.json"},{"id":"method-naming-inconsistencies","text":"Multiple solutions have method names that don't match LeetCode canonical names (`possible_bipartition` for sortArrayByParityII, `maxValue` for sortEvenOdd), likely artifacts from the code generation pipeline.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/method-naming-inconsistencies.json"},{"id":"middle-element-lo-le-hi","text":"The `lo <= hi` condition (not `lo < hi`) in `flipAndInvertImage` is critical: it ensures the center element of odd-length rows is inverted exactly once when `lo == hi`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/middle-element-lo-le-hi.json"},{"id":"min-abs-diff-mutates-input","text":"`minimumAbsDifference` mutates the caller's list via `arr.sort()` rather than working on a copy — standard for LeetCode solutions in this repo but relevant if the caller retains the list.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-abs-diff-mutates-input.json"},{"id":"min-cost-assumes-length-ge-2","text":"`minCostClimbingStairs` will raise `IndexError` if `cost` has fewer than 2 elements; it relies on the LeetCode constraint `len(cost) >= 2` without validation.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-cost-assumes-length-ge-2.json"},{"id":"min-cost-dp-uses-constant-space","text":"`minCostClimbingStairs` uses O(1) auxiliary space via two rolling variables (`prev1`, `prev2`) instead of an O(n) DP array.","truth_value":"IN","justification_count":0,"dependent_count":2,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-cost-dp-uses-constant-space.json"},{"id":"min-cost-final-answer-is-min-of-last-two","text":"The final `min(prev1, prev2)` is necessary because you can reach the top (one past the last index) from either of the last two steps.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-cost-final-answer-is-min-of-last-two.json"},{"id":"min-cost-loop-invariant","text":"After processing index `i`, `prev1` holds the minimum cost to reach and pay step `i`, and `prev2` holds the same for step `i-1`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-cost-loop-invariant.json"},{"id":"min-cuts-colocated-tests","text":"`minimum-cuts-to-divide-a-circle/solution.py` contains both the solution function and its `unittest.TestCase` in the same file, in addition to the separate `test_solution.py` — following a pattern of colocated tests for some solutions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-cuts-colocated-tests.json"},{"id":"min-cuts-even-half-odd-full","text":"`min_cuts(n)` returns 0 for n=1, n//2 for even n, and n for odd n > 1 — even-numbered slices allow diameter reuse (each cut creates two boundaries) while odd-numbered slices cannot.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-cuts-even-half-odd-full.json"},{"id":"min-distance-generator-not-list","text":"`get_min_distance` uses a generator expression (lazy) inside `min()`, not a list comprehension, avoiding allocation of an intermediate list — O(1) auxiliary space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-distance-generator-not-list.json"},{"id":"min-distance-precondition-target-exists","text":"`get_min_distance` raises `ValueError` if `target` is absent from `nums` because `min()` receives an empty generator; no internal guard exists.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-distance-precondition-target-exists.json"},{"id":"min-max-alternation-resets-per-round","text":"The min/max alternation resets each round — pair index `i` starts at 0, so the first pair always uses `min` regardless of which operation ended the previous round.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-max-alternation-resets-per-round.json"},{"id":"min-max-game-linear-total-work","text":"Total comparisons across all rounds is O(n) due to geometric halving (n/2 + n/4 + ... = n - 1).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-max-game-linear-total-work.json"},{"id":"min-max-game-returns-value-not-count","text":"`min_steps` returns the last surviving element value, not the number of reduction rounds — the function name is misleading.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-max-game-returns-value-not-count.json"},{"id":"min-moves-no-empty-guard","text":"`min_moves` calls `min()` and `max()` without guarding for empty input; an empty list raises `ValueError` — this is by design, relying on LeetCode's guarantee of non-empty input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-moves-no-empty-guard.json"},{"id":"min-moves-strict-inequality-excludes-boundaries","text":"`min_moves` uses strict `<` comparisons, so elements equal to `min(nums)` or `max(nums)` are never counted — only interior values qualify.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-moves-strict-inequality-excludes-boundaries.json"},{"id":"min-moves-three-pass-linear","text":"`min_moves` makes three O(n) passes (min, max, count) using a generator inside `sum()`, achieving O(n) time and O(1) auxiliary space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-moves-three-pass-linear.json"},{"id":"min-moves-uniform-list-returns-zero","text":"When all elements are identical, `min_val == max_val` makes the condition `min_val < x < max_val` unsatisfiable, correctly returning 0 without special-casing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-moves-uniform-list-returns-zero.json"},{"id":"min-of-adjacent-groups","text":"In `count_binary_substrings`, the number of valid binary substrings spanning two adjacent groups of sizes a and b is exactly `min(a, b)` — this is the mathematical invariant the O(1)-space algorithm relies on.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-of-adjacent-groups.json"},{"id":"min-on-empty-is-unguarded","text":"`max_distance` crashes with `ValueError` from `min()` on an empty generator if `k > len(nums)`; no explicit validation exists.","truth_value":"IN","justification_count":0,"dependent_count":3,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-on-empty-is-unguarded.json"},{"id":"min-operations-is-misnamed","text":"The function `min_operations` in `convert-binary-number-in-a-linked-list-to-integer/solution.py` performs binary-to-integer conversion, not any \"minimum operations\" computation; the name doesn't match the problem.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-operations-is-misnamed.json"},{"id":"min-ops-equals-distinct-positives","text":"`minOperations` in `make-array-zero-by-subtracting-equal-amounts/solution.py` returns `len(set(nums) - {0})` — the count of distinct positive values — because each subtraction operation eliminates exactly one distinct positive value.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-ops-equals-distinct-positives.json"},{"id":"min-ops-increasing-empty-input-crashes","text":"`min_operations` (array increasing) accesses `nums[0]` unconditionally — passing an empty list raises an unhandled `IndexError`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-ops-increasing-empty-input-crashes.json"},{"id":"min-remap-always-leading-digit","text":"The min value in digit-remapping is always achieved by remapping `s[0]` to `'0'`, regardless of what `s[0]` is — leading zeros collapse naturally via `int()`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-remap-always-leading-digit.json"},{"id":"min-subarray-alias-is-generic","text":"The `min_subarray` alias at module level is a project-wide test harness convention, not semantically related to the individual solution.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-subarray-alias-is-generic.json"},{"id":"min-subsequence-integer-only-threshold","text":"The threshold check `subseq_sum > total - subseq_sum` uses only integer arithmetic, avoiding floating-point precision issues that would arise from `subseq_sum > total / 2`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-subsequence-integer-only-threshold.json"},{"id":"min-subsequence-mutates-input","text":"`min_subsequence` calls `nums.sort(reverse=True)` in-place, reordering the caller's list as a side effect.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-subsequence-mutates-input.json"},{"id":"min-sum-init-zero-is-intentional","text":"In the min-start-value solution, `min_sum` is initialized to 0 (not `-inf`) so that when all prefix sums are non-negative, the result is correctly `max(1, 1 - 0) = 1` without a special case.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-sum-init-zero-is-intentional.json"},{"id":"min-time-typewriter-greedy-optimal","text":"Processing characters left-to-right with shortest-arc moves is provably optimal for the typewriter problem; no lookahead or reordering can reduce total time because the pointer must visit each character in sequence.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-time-typewriter-greedy-optimal.json"},{"id":"min-time-typewriter-per-char-bound","text":"Each character in the typewriter problem contributes exactly `min(|target - curr|, 26 - |target - curr|) + 1` seconds, bounded to `[1, 14]`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-time-typewriter-per-char-bound.json"},{"id":"min-tracking-pattern-shared","text":"`maxProfit` and `maximum-difference-between-increasing-elements/solution.py` share the same min-so-far tracking pattern: maintain a running minimum, compute max delta at each position.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/min-tracking-pattern-shared.json"},{"id":"mindepth-bfs-over-dfs","text":"`minDepth` uses BFS (level-order traversal) rather than DFS so it can return immediately at the first leaf encountered, avoiding full-tree traversal on unbalanced trees.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mindepth-bfs-over-dfs.json"},{"id":"mindepth-depth-one-indexed","text":"`minDepth` uses 1-indexed depth (root = 1), so a single-node tree returns 1 and an empty tree returns 0.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mindepth-depth-one-indexed.json"},{"id":"mindepth-single-child-not-leaf","text":"A node with exactly one child is never treated as a leaf in `minDepth`; the algorithm descends into the existing subtree — the key correctness property that distinguishes minimum depth from maximum depth.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mindepth-single-child-not-leaf.json"},{"id":"minimumcost-mutates-input-list","text":"`minimumCost` calls `cost.sort(reverse=True)` in place, reordering the caller's list as a side effect.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/minimumcost-mutates-input-list.json"},{"id":"minus-one-means-infeasible","text":"distribute-money returns -1 if and only if `money < children`, the sole condition where giving every child at least $1 is impossible.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/minus-one-means-infeasible.json"},{"id":"misleading-function-names-from-generation","text":"At least two solutions have wrapper/function names unrelated to their problem (`minimizeTheDifference` for palindrome finding, `mem_sticks_crash` for graph connectivity), indicating a systematic naming issue in the code generation pipeline.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/misleading-function-names-from-generation.json"},{"id":"misleading-method-names-exist","text":"Some solution methods have names that do not reflect their algorithm — `countStrings` counts removal steps not strings, and `dfs` performs a greedy linear scan with no recursion or backtracking.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/misleading-method-names-exist.json"},{"id":"misnamed-method-split-and-minimize","text":"`largest-3-same-digit-number-in-string/solution.py` defines `split_and_minimize` but the correct LeetCode signature is `largestGoodInteger` — likely a code generation pipeline bug","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/misnamed-method-split-and-minimize.json"},{"id":"misnamed-module-exports-in-test-harness","text":"Some solution modules export a module-level alias (e.g., `count_balls = Solution().replaceDigits`) that does not match the actual problem — this is a code-generation artifact from the repo's test harness, not a logic error.","truth_value":"OUT","justification_count":0,"dependent_count":7,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/misnamed-module-exports-in-test-harness.json"},{"id":"missing-char-returns-zero","text":"If any character in `target` is absent from `s`, `maxNumberOfCopies` returns 0 because `Counter.__getitem__` returns 0 for missing keys, making `0 // demand` yield 0.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/missing-char-returns-zero.json"},{"id":"missing-number-gauss-sum","text":"`missing-number/solution.py` uses Gauss's formula `n*(n+1)//2 - sum(nums)` for O(n) time and O(1) space, rather than XOR, hash set, or sorting approaches.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/missing-number-gauss-sum.json"},{"id":"missing-ranges-cursor-not-sentinel","text":"`find_missing_ranges` uses a `next_expected` cursor to detect gaps rather than mutating the input by prepending `lower-1` / appending `upper+1` — the input list is never modified or copied.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/missing-ranges-cursor-not-sentinel.json"},{"id":"missing-ranges-empty-input-returns-full-range","text":"When `nums` is empty, `find_missing_ranges` returns the single formatted range `[lower, upper]` — the loop body never executes and the post-loop residual check captures the entire bound.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/missing-ranges-empty-input-returns-full-range.json"},{"id":"missing-ranges-precondition-sorted-unique-in-bounds","text":"`find_missing_ranges` assumes `nums` is sorted, contains unique values, and all elements fall within `[lower, upper]` — none of these preconditions are validated at runtime.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/missing-ranges-precondition-sorted-unique-in-bounds.json"},{"id":"missing-target-returns-neg-one","text":"`shortest_distance` returns `-1` when the target string is absent from the array, not 0 or an exception — the sentinel check `result < n` distinguishes found from not-found.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/missing-target-returns-neg-one.json"},{"id":"mixed-api-style-class-and-function","text":"Solutions inconsistently use either a `Solution` class with instance methods (matching LeetCode's expected interface) or standalone module-level functions — both styles coexist in the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mixed-api-style-class-and-function.json"},{"id":"mixed-solution-export-conventions","text":"Some solutions export a `Solution` class with a method (e.g., `largestInteger`, `largestNumberAtLeastTwiceOfOthers`), while others export a bare function (e.g., `largest_matrix`, `largest_odd_number`) — the repo has no single enforced convention","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mixed-solution-export-conventions.json"},{"id":"mod-6-equivalence","text":"The average-even-divisible-by-three solution collapses `n % 2 == 0 and n % 3 == 0` into `n % 6 == 0` using the fact that lcm(2, 3) = 6, a number-theory simplification that recurs across solutions with coprime divisibility checks.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mod-6-equivalence.json"},{"id":"mod-applied-per-multiply","text":"In prime-arrangements, modular reduction (`% MOD`) is applied at each multiplication step rather than once at the end, keeping intermediate values bounded — a pattern used across competitive-programming solutions in this repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mod-applied-per-multiply.json"},{"id":"modular-arithmetic-avoids-large-integers","text":"The binary-prefix-divisible-by-5 solution tracks only the remainder modulo 5 at each step (`remainder = (remainder * 2 + bit) % 5`), never constructing the actual binary number — a pattern for constant-space streaming over unbounded numeric sequences.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/modular-arithmetic-avoids-large-integers.json"},{"id":"modular-arithmetic-eliminates-simulation","text":"Solutions for problems with circular, periodic, or wrap-around structure uniformly reduce to O(1) closed-form expressions via modular arithmetic (min-of-diff-and-complement for shortest arc, mod-then-truncate for cyclic shifts, division-and-modulo for periodic bouncing), eliminating iterative simulation entirely.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/modular-arithmetic-eliminates-simulation.json"},{"id":"modular-digit-extraction-pattern","text":"`subtract-the-product-and-sum-of-digits` extracts digits via `n % 10` / `n //= 10` loop rather than string conversion, achieving O(1) space with no string allocation","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/modular-digit-extraction-pattern.json"},{"id":"module-alias-instantiates-at-import","text":"The module-level alias pattern (e.g., `sort_integers_by_the_number_of_1_bits = Solution().sortByBits`) creates a `Solution()` instance at import time and binds its method, providing a uniform snake_case entry point for the test harness.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/module-alias-instantiates-at-import.json"},{"id":"modulo-for-circular-wraparound","text":"`idx % len(array)` is the standard idiom for circular wrap-around in sorted/search problems — it handles target-greater-than-all, target-equals-last, and target-equals-interior cases without explicit conditionals.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/modulo-for-circular-wraparound.json"},{"id":"monotonic-constant-array-is-monotonic","text":"A constant array (all elements equal) returns `True` from `isMonotonic` because neither the `>` nor `<` comparisons fire, leaving both flags `True`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/monotonic-constant-array-is-monotonic.json"},{"id":"monotonic-dual-flag-no-early-exit","text":"`isMonotonic` tracks `increasing` and `decreasing` flags simultaneously but never short-circuits — the loop runs to completion even if both flags are `False` mid-scan, making worst-case and best-case both O(n).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/monotonic-dual-flag-no-early-exit.json"},{"id":"monotonic-vacuous-truth-short-arrays","text":"Arrays of length 0 or 1 return `True` from `isMonotonic` without entering the loop — `range(0)` produces no iterations, so both flags remain `True`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/monotonic-vacuous-truth-short-arrays.json"},{"id":"month-dict-completeness","text":"The `months` dictionary maps exactly the 12 three-letter English month abbreviations to zero-padded two-digit strings `\"01\"` through `\"12\"`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/month-dict-completeness.json"},{"id":"month-zero-silent-wrong-answer","text":"`number_of_days` performs no input validation; passing month=0 silently returns 31 (December) via Python's negative list indexing rather than raising an error","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/month-zero-silent-wrong-answer.json"},{"id":"morse-gin-zen-collision-tested","text":"The test suite explicitly verifies that distinct words (`\"gig\"` and `\"msg\"`) produce identical Morse strings, confirming the deduplication behavior is non-trivial","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/morse-gin-zen-collision-tested.json"},{"id":"morse-ord-indexing-pattern","text":"Character-to-Morse lookup uses `ord(c) - ord('a')` to index into a 26-element list, requiring input to be strictly lowercase a-z","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/morse-ord-indexing-pattern.json"},{"id":"morse-set-comprehension-dedup","text":"Uniqueness counting is done via set comprehension, making the solution O(S) time where S is total characters across all words","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/morse-set-comprehension-dedup.json"},{"id":"morse-table-is-itu-standard","text":"The 26-element `morse` list in `unique-morse-code-words/solution.py` matches the ITU International Morse Code alphabet in a-z order","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/morse-table-is-itu-standard.json"},{"id":"most-common-word-no-empty-guard","text":"`mostCommonWord` raises `IndexError` if every word is banned or the paragraph has no alphabetic characters — there is no guard on an empty `Counter`, relying on LeetCode's guarantee of a valid answer.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/most-common-word-no-empty-guard.json"},{"id":"most-common-word-regex-tokenization","text":"`mostCommonWord` tokenizes via `re.findall(r'[a-z]+', paragraph.lower())`, which strips all punctuation and whitespace implicitly — no explicit delimiter character class is needed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/most-common-word-regex-tokenization.json"},{"id":"most-frequent-even-inline-tests","text":"`most-frequent-even-element/solution.py` contains both the solution function and a `TestMostFrequentEven` unittest class in the same file, unlike the repo's typical pattern of separate `test_solution.py` files.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/most-frequent-even-inline-tests.json"},{"id":"most-frequent-even-negative-one-sentinel","text":"`most_frequent_even` returns `-1` (not `None` or an exception) when the input contains no even numbers — this is the sentinel convention for this problem.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/most-frequent-even-negative-one-sentinel.json"},{"id":"most-frequent-even-tiebreak-smallest","text":"When multiple even elements share the highest frequency, `most_frequent_even` returns the numerically smallest via `min(counts, key=lambda x: (-counts[x], x))` — a composite sort key that maximizes count then minimizes value.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/most-frequent-even-tiebreak-smallest.json"},{"id":"most-visited-only-depends-on-endpoints","text":"The most-visited-sector solution's correctness relies on intermediate rounds contributing uniform visits to all sectors, so only `rounds[0]` and `rounds[-1]` determine the answer.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/most-visited-only-depends-on-endpoints.json"},{"id":"mostWordsFound-empty-list-raises","text":"Passing an empty `sentences` list to `mostWordsFound` raises `ValueError` from `max()` because no fallback default is provided.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mostWordsFound-empty-list-raises.json"},{"id":"mostWordsFound-single-pass","text":"The generator-based `mostWordsFound` iterates through sentences exactly once with O(1) auxiliary space beyond each individual split.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mostWordsFound-single-pass.json"},{"id":"mostWordsFound-uses-split-no-args","text":"`mostWordsFound` calls `str.split()` without a delimiter, splitting on any whitespace and stripping leading/trailing spaces — not just single spaces.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mostWordsFound-uses-split-no-args.json"},{"id":"mountain-peak-must-be-interior","text":"The valid-mountain-array solution requires the peak index to satisfy `0 < peak < n-1`, rejecting purely monotonic sequences even when both pointers converge.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mountain-peak-must-be-interior.json"},{"id":"move-zeroes-no-return-value","text":"`moveZeroes` returns `None` and mutates the input list in-place; callers must inspect the modified list to observe results.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/move-zeroes-no-return-value.json"},{"id":"move-zeroes-stable-ordering","text":"Non-zero elements maintain their original relative order after `moveZeroes` completes — the swap-based two-pointer advances the slow pointer only on non-zero encounters, preserving sequence.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/move-zeroes-stable-ordering.json"},{"id":"move-zeroes-swap-not-overwrite","text":"`moveZeroes` uses element swaps (slow/fast pointer) rather than overwriting non-zeros to front and filling zeros after, performing at most n swaps in a single pass with no second fill phase.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/move-zeroes-swap-not-overwrite.json"},{"id":"moving-avg-eviction-order","text":"In `MovingAverage.next()`, the subtraction of the evicted element must happen before `deque.append()` because `append` on a full `maxlen` deque silently discards `_queue[0]`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/moving-avg-eviction-order.json"},{"id":"moving-avg-o1-next","text":"`MovingAverage.next()` runs in O(1) time by maintaining a running sum incrementally, avoiding O(k) re-summation of the deque on each call.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/moving-avg-o1-next.json"},{"id":"moving-avg-sum-invariant","text":"`self._sum == sum(self._queue)` holds after every `next()` call in `MovingAverage`; if this invariant breaks, all subsequent averages silently return wrong values.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/moving-avg-sum-invariant.json"},{"id":"multi-digit-counts-supported","text":"The digit-scanning loop in `_extract_next` handles arbitrarily large multi-digit counts (e.g., `1000000000`) by scanning consecutive digit characters until a non-digit or end-of-string.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/multi-digit-counts-supported.json"},{"id":"multiplication-before-division-ordering","text":"In `percentageLetter`, the `count * 100` multiplication happens before the `// len(s)` division — reversing the order would produce 0 for any `count < len(s)` due to integer floor division.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/multiplication-before-division-ordering.json"},{"id":"mutable-list-for-string-manipulation","text":"Solutions that need character-level string mutation convert to `list()`, mutate in place, then `''.join()` back — the standard Python idiom since strings are immutable.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mutable-list-for-string-manipulation.json"},{"id":"mutable-list-for-string-mutation","text":"Solutions that need in-place character modification convert the input string to a `list` via `list(s)`, mutate it, then rejoin with `''.join(chars)` — this avoids O(n²) repeated string concatenation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/mutable-list-for-string-mutation.json"},{"id":"mutation-invisible-in-single-call-context","text":"In-place mutation of input arguments (sorting, element swaps, pointer reassignment) has no observable effect beyond the current call because LeetCode's judge invokes each solution exactly once per test case, making aliasing and input reuse irrelevant under the submission model.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"insufficient","source_type":"","url":"/public/leetcode-expert/belief/mutation-invisible-in-single-call-context.json"},{"id":"n-choose-2-for-pair-counting","text":"When counting unordered pairs within groups, solutions apply the combinatorial formula `n*(n-1)//2` per group rather than enumerating pairs, relying on the integer-division-is-exact invariant (one of n, n-1 is always even).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/n-choose-2-for-pair-counting.json"},{"id":"n-choose-2-pair-counting-formula","text":"Pair-counting solutions use `n*(n-1)//2` per frequency group (or the incremental equivalent `count += seen[x]; seen[x] += 1`) rather than enumerating all pairs; integer division is exact because one of two consecutive integers is always even.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/n-choose-2-pair-counting-formula.json"},{"id":"n100-yields-682289015","text":"For n=100 (25 primes, 75 non-primes), Prime Arrangements returns 682289015, serving as a regression anchor for the full computation chain including primality counting and modular factorial.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/n100-yields-682289015.json"},{"id":"names-serve-no-functional-role","text":"Function and method names are entirely non-functional in this architecture: naming errors introduced by the generation pipeline remain permanently invisible at runtime, and naming drift across solutions never affects execution — making names purely documentary artifacts with no load-bearing role.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/names-serve-no-functional-role.json"},{"id":"naming-drift-does-not-affect-execution","text":"Method name mismatches from copy-paste are invisible at runtime because the test harness imports via module-level aliases bound at the top of each solution file, not via method names on the Solution class.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/naming-drift-does-not-affect-execution.json"},{"id":"naming-drift-evidences-co-adaptation-lock","text":"Naming drift serves as empirical evidence that the streaming-isolation co-adaptation lock is actively operating: drift accumulates precisely because streaming's self-sufficiency eliminates functional dependency on correct names, while isolation's zero-coupling eliminates detection mechanisms — the canonical instance of permanently frozen debt is a directly observable trace of the dynamically locked co-adaptation between the dominant paradigm and the architectural pattern.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/naming-drift-evidences-co-adaptation-lock.json"},{"id":"naming-drift-is-canonical-frozen-debt","text":"Naming drift is the canonical instance of permanently frozen engineering debt: names serve no functional role at any layer of the architecture (neither runtime execution nor test harness depend on semantic correctness of names), while the isolation mechanism that freezes all engineering debt simultaneously ensures naming errors are undetectable without manual inspection — making naming the purest case of a defect that is simultaneously consequenceless and uncorrectable.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/naming-drift-is-canonical-frozen-debt.json"},{"id":"naming-drift-is-definitive-immunity-proof","text":"Naming drift serves as the definitive proof of architectural immunity: it is simultaneously the most pervasive engineering defect (affecting multiple solutions systematically via the generation pipeline) and the most completely harmless (names serve zero functional role at any architectural layer), demonstrating that immunity handles even the worst-case defect class — maximum surface area, zero impact.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/naming-drift-is-definitive-immunity-proof.json"},{"id":"naming-drift-is-domain-selection-signature","text":"Naming drift is the empirically observable signature of domain-level quality selection: the domain's fixed-point dynamics select for algorithmic investment over engineering discipline (no force pushes toward fixing names), and naming drift — simultaneously the most pervasive engineering defect and the most harmless (definitive immunity proof) — is the visible residue of that selection, making it the canonical diagnostic for identifying LeetCode-domain quality dynamics in any codebase.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/naming-drift-is-domain-selection-signature.json"},{"id":"naming-drift-structurally-inevitable-at-fixed-point","text":"Naming drift is not merely tolerated but structurally inevitable at the streaming fixed point: because the fixed point's four-fold optimality (convergence attractor, algebraic normal form, self-sufficient paradigm, constructive minimal strategy) eliminates all naming infrastructure from the solution space (no imports, no shared interfaces, no cross-module references), naming precision has exactly zero selection pressure at the convergence attractor, guaranteeing drift accumulates monotonically.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/naming-drift-structurally-inevitable-at-fixed-point.json"},{"id":"nearest-valid-point-fused-filter-reduce","text":"`nearestValidPoint` fuses the validity filter and argmin reduction into a single O(n) pass with O(1) space — no intermediate filtered list, no sorting.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nearest-valid-point-fused-filter-reduce.json"},{"id":"nearest-valid-point-no-imports","text":"`nearestValidPoint` has zero imports — it uses only Python builtins (`float`, `abs`, `enumerate`), making it fully self-contained.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nearest-valid-point-no-imports.json"},{"id":"nearest-valid-point-or-means-either-axis","text":"A point is valid in `nearestValidPoint` if it shares the x-coordinate OR the y-coordinate with the query (not necessarily both) — an easy-to-misread detail of the problem contract.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nearest-valid-point-or-means-either-axis.json"},{"id":"nearest-valid-point-returns-first-index-on-tie","text":"When multiple valid points share the minimum Manhattan distance, `nearestValidPoint` returns the smallest index because it uses strict `<` comparison (first occurrence is kept).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nearest-valid-point-returns-first-index-on-tie.json"},{"id":"negated-max-heap-idiom","text":"Max-heap behavior is emulated by negating all values on insertion and negating again on extraction, since Python's `heapq` only provides a min-heap — a standard idiom used across heap-based solutions in this repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/negated-max-heap-idiom.json"},{"id":"negation-marking-abs-required","text":"In the negation-marking pattern, `abs()` is required when reading a cell's value (as opposed to its sign) because earlier iterations may have negated it; omitting `abs()` would produce negative indices and raise `IndexError`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/negation-marking-abs-required.json"},{"id":"negation-marking-idempotent-guard","text":"The `if nums[idx] > 0` guard in `find_disappeared_numbers` ensures each index is negated at most once, preventing double-negation by duplicates from restoring a positive sign and producing false \"missing\" results.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/negation-marking-idempotent-guard.json"},{"id":"negation-marking-mutates-input","text":"`find_disappeared_numbers` destructively modifies the input array via in-place sign flipping; callers cannot reuse `nums` after the call.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/negation-marking-mutates-input.json"},{"id":"negation-marking-requires-1-to-n-range","text":"The in-place negation-marking technique only works when values are guaranteed in `[1, n]`, since each value `v` maps to index `v - 1`; values outside this range would cause out-of-bounds access.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/negation-marking-requires-1-to-n-range.json"},{"id":"negation-trick-requires-integers","text":"The tiebreaker `-x` only produces correct descending order for numeric types; applying this pattern to strings or other non-numeric types would fail.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/negation-trick-requires-integers.json"},{"id":"negative-input-causes-nontermination","text":"`hamming_weight` has no guard against negative inputs; on Python's arbitrary-precision integers, `n &= n - 1` on a negative value never reaches zero, causing an infinite loop","truth_value":"OUT","justification_count":0,"dependent_count":3,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/negative-input-causes-nontermination.json"},{"id":"negative-one-sentinel-for-max-tracking","text":"`largest-number-at-least-twice-of-others/solution.py` initializes `max_val` and `second_max` to -1, which is safe only because the problem constrains values to [0, 1000] — this sentinel would break for problems allowing negative inputs","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/negative-one-sentinel-for-max-tracking.json"},{"id":"nested-helpers-are-pure-closures","text":"Helper functions nested inside solution methods (e.g., `is_valid` in `countValidWords`, `diff` in `stringWithDifferentDifference`) don't capture mutable state from the enclosing scope — they are pure functions co-located for readability","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nested-helpers-are-pure-closures.json"},{"id":"net-shift-collapse","text":"All individual shift operations are collapsed into a single net displacement before any string manipulation, making the solution O(n + k) rather than O(n * total_shift_amount).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/net-shift-collapse.json"},{"id":"next-valid-terminates","text":"`_next_valid` in backspace-string-compare always terminates because the `index` variable strictly decreases on every iteration of its while loop, and the loop exits when `index < 0`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/next-valid-terminates.json"},{"id":"nge-linear-time","text":"`next_greater_element` runs in O(n + m) time where n = len(nums2) and m = len(nums1), because each element of nums2 is pushed and popped from the stack at most once (amortized analysis).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nge-linear-time.json"},{"id":"nge-precompute-then-query","text":"`next_greater_element` separates into two phases: a single O(n) pass over nums2 using a monotonic stack to build the full next-greater mapping, then O(1)-per-element dict lookups for each query in nums1.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nge-precompute-then-query.json"},{"id":"nge-stack-monotonic-decreasing","text":"The stack invariant in the Next Greater Element solution is strictly decreasing from bottom to top; the while loop pops all values smaller than the incoming element before pushing, enforcing this at every step.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nge-stack-monotonic-decreasing.json"},{"id":"nge-unique-elements-assumed","text":"The dict-keyed-by-value approach in `next_greater_element` is correct only because the problem guarantees all elements are unique; duplicate values would cause silent overwrites of earlier mappings.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nge-unique-elements-assumed.json"},{"id":"nibble-extraction-produces-lsb-first","text":"The hex conversion loop extracts digits from least-significant to most-significant nibble, collecting them in reverse order and requiring a final `reversed()` call.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nibble-extraction-produces-lsb-first.json"},{"id":"nice-substring-divide-conquer-split-correctness","text":"Splitting on a character whose case-counterpart is absent is sound: that character cannot appear in any nice substring, so the answer lies entirely in one of the two halves.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nice-substring-divide-conquer-split-correctness.json"},{"id":"nice-substring-left-bias-on-tie","text":"`longestNiceSubstring` uses `>=` when comparing left vs right result lengths, ensuring the earliest (leftmost) substring wins on equal length, matching LeetCode's tie-breaking requirement.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nice-substring-left-bias-on-tie.json"},{"id":"nice-substring-worst-case-quadratic","text":"The divide-and-conquer approach is O(n^2) worst case when every split produces one empty and one n-1 partition (analogous to quicksort's worst case); best case is O(n log n) with balanced splits.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nice-substring-worst-case-quadratic.json"},{"id":"nim-game-constant-complexity","text":"`canWinNim` is O(1) time and O(1) space — a single modulo operation — which is necessary because n can be up to 2^31 - 1, making DP infeasible.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nim-game-constant-complexity.json"},{"id":"nim-game-mod4-characterization","text":"The first player wins Nim (1–3 stones per turn) if and only if `n % 4 != 0`; this is a complete characterization derived from the Sprague-Grundy theorem, not heuristic.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nim-game-mod4-characterization.json"},{"id":"no-bounds-violation-on-overshoot","text":"When a number in `abbr` exceeds the remaining length of `word`, `i` overshoots `len(word)` and the final `i == len(word)` check catches it without raising an `IndexError`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-bounds-violation-on-overshoot.json"},{"id":"no-child-gets-four-dollars","text":"The `others == 1 and leftover == 3` branch in distribute-money specifically prevents the remaining child from receiving exactly $4, which the problem forbids.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-child-gets-four-dollars.json"},{"id":"no-consistency-enforcement-at-any-level","text":"The repo lacks any mechanism — shared imports, linters, templates, or conventions — for enforcing consistency in naming, testing, or structure across problem directories, making style drift an inevitable structural property rather than an oversight.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/no-consistency-enforcement-at-any-level.json"},{"id":"no-cross-problem-dependencies","text":"Each solution directory is fully self-contained; despite tooling artifacts showing large \"Imported By\" lists, no solution module imports from another problem's directory.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-cross-problem-dependencies.json"},{"id":"no-cross-problem-imports","text":"Each problem's `test_solution.py` imports only its own `solution.py`; the large \"Imported By\" lists in code-expert output are artifacts of the tooling, not real Python import edges","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-cross-problem-imports.json"},{"id":"no-external-dependencies-in-solutions","text":"Solution files import only from the Python standard library (`unittest`, `typing`). No external packages are used anywhere in the solution code.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-external-dependencies-in-solutions.json"},{"id":"no-full-house-distinction","text":"`best_poker_hand` uses `max_freq >= 3` which collapses Full House and Three of a Kind into the same classification, matching the problem's simplified hand ranking.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-full-house-distinction.json"},{"id":"no-input-validation-convention","text":"Solutions trust their callers to provide valid inputs within problem constraints; no range checking, type validation, or defensive error handling is performed beyond what the algorithm structurally requires.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-input-validation-convention.json"},{"id":"no-input-validation-in-solutions","text":"Solution methods perform no input validation or bounds checking, relying entirely on LeetCode's guaranteed constraints; invalid inputs propagate standard Python exceptions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-input-validation-in-solutions.json"},{"id":"no-input-validation-pattern","text":"Solution functions consistently omit input validation (bounds checking, type checking, error handling), relying on the LeetCode harness to satisfy problem constraints — this is deliberate, not an oversight","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-input-validation-pattern.json"},{"id":"no-input-validation-trusts-leetcode-contract","text":"Solutions do not validate input preconditions (sorted arrays, valid tree nodes, binary values) — they rely on LeetCode's guarantee that inputs conform to the problem statement.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-input-validation-trusts-leetcode-contract.json"},{"id":"no-post-loop-fixup-needed","text":"Because `checkZeroOnes` updates the max inside the loop on every iteration (not only at run transitions), the final run's length is always reflected in the result without a trailing adjustment","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-post-loop-fixup-needed.json"},{"id":"no-runtime-input-validation","text":"Solutions do not validate input at runtime — they trust LeetCode's guaranteed constraints, and invalid input propagates native Python exceptions (`ValueError`, `TypeError`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-runtime-input-validation.json"},{"id":"no-shared-node-class","text":"Each solution directory defines its own `Node`/`TreeNode` class rather than importing from a shared module — tree structure definitions are duplicated per problem.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-shared-node-class.json"},{"id":"no-simulation-needed","text":"The most-visited-sector function never iterates through the `rounds` array beyond reading the first and last elements, making it O(n) in sectors rather than O(len(rounds) * n).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-simulation-needed.json"},{"id":"no-sqrt-dependency","text":"`is_perfect_square` satisfies the LeetCode constraint of not using any built-in square root or exponentiation function; it relies only on integer multiplication and comparison.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-sqrt-dependency.json"},{"id":"no-stdlib-date-in-date-problems","text":"Date-related solutions (days-between-dates, days-in-a-month) implement Gregorian calendar arithmetic from scratch without importing `datetime` or `calendar`, since hand-rolling the math is the intended constraint","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-stdlib-date-in-date-problems.json"},{"id":"no-stdlib-date-parsing","text":"The reformat-date solution avoids `datetime` entirely, relying on manual string splitting and dictionary lookup.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-stdlib-date-parsing.json"},{"id":"no-two-pair-distinction","text":"`best_poker_hand` checks only `max_freq == 2`, so Two Pair and One Pair both return `\"Pair \"` — the problem defines no Two Pair category.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-two-pair-distinction.json"},{"id":"no-validation-is-deliberate-contract","text":"The universal absence of input validation is a deliberate architectural choice — solutions define their correctness boundary at LeetCode's stated constraints and are not intended to handle inputs outside that boundary.","truth_value":"IN","justification_count":1,"dependent_count":6,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/no-validation-is-deliberate-contract.json"},{"id":"no-zero-integers-returns-smallest-a","text":"`no_zero_integers` returns the pair with the smallest possible first element, scanning `a` upward from 1 and returning on first match, making the output deterministic.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-zero-integers-returns-smallest-a.json"},{"id":"no-zero-invariant","text":"The `min(a,b)*10 + max(a,b)` formula in `smallest_number_with_at_least_one_digit_from_each_array` assumes digits are 1-9; a zero in either array would produce an incorrect single-digit result instead of a two-digit number.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/no-zero-invariant.json"},{"id":"node-children-default-empty-list","text":"`Node.__init__` in n-ary tree solutions avoids Python's mutable default argument pitfall by using `None` as the default parameter and replacing with `[]` inside the constructor body.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/node-children-default-empty-list.json"},{"id":"non-alpha-positional-invariant","text":"In the Reverse Only Letters solution, non-alphabetic characters are guaranteed to remain at their original indices — the two-pointer loop only swaps when both pointers point at `isalpha()` characters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/non-alpha-positional-invariant.json"},{"id":"non-binary-input-silent-miscount","text":"In `checkZeroOnes`, characters other than `\"1\"` are silently counted toward `max_zeros`, since the only branch check is `c == \"1\"`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/non-binary-input-silent-miscount.json"},{"id":"nonlocal-accumulator-pattern","text":"The diameter solution uses a nested `height` closure that captures and mutates an outer `diameter` variable via `nonlocal`, computing height as the return value while accumulating the diameter as a side effect — a pattern that also appears in other tree problems like binary-tree-tilt.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/nonlocal-accumulator-pattern.json"},{"id":"null-root-returns-empty-list","text":"All tree traversal solutions return `[]` (not `None` or an error) when given a null/None root, enforced by early guard clauses or loop conditions that short-circuit naturally.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/null-root-returns-empty-list.json"},{"id":"null-subroot-is-always-subtree","text":"`isSubtree(any_root, None)` returns `True`, matching the LeetCode contract that an empty tree is a subtree of any tree","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/null-subroot-is-always-subtree.json"},{"id":"numofstrings-pure-function","text":"`numOfStrings` is a pure function: no side effects, no mutation of inputs, deterministic output for any given input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/numofstrings-pure-function.json"},{"id":"o1-space-via-running-accumulators","text":"Multiple solutions achieve O(1) auxiliary space by maintaining scalar running-state variables (min-so-far, running-sum, running-max) instead of materializing intermediate arrays or sorted copies.","truth_value":"IN","justification_count":1,"dependent_count":5,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/o1-space-via-running-accumulators.json"},{"id":"odd-cells-counting-over-simulation","text":"`oddCells` uses the counting-not-simulation pattern: since each cell's value equals `row_count[r] + col_count[c]`, it computes frequencies then uses combinatorics instead of applying increments to a matrix.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/odd-cells-counting-over-simulation.json"},{"id":"odd-cells-linear-time","text":"`oddCells` runs in O(|indices| + m + n) time — one pass to count frequencies, one pass to count parities — independent of the matrix area m*n.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/odd-cells-linear-time.json"},{"id":"odd-cells-no-matrix-materialization","text":"`oddCells` never allocates an m-by-n matrix; it uses O(m+n) row/column frequency arrays, reducing space from O(m*n) to O(m+n).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/odd-cells-no-matrix-materialization.json"},{"id":"odd-cells-xor-parity-formula","text":"A cell (r,c) has an odd value iff exactly one of `row_count[r]` and `col_count[c]` is odd; the return formula `odd_rows*(n-odd_cols) + (m-odd_rows)*odd_cols` computes this via two disjoint terms with no overlap.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/odd-cells-xor-parity-formula.json"},{"id":"odd-count-two-branch","text":"The odd-counts solution uses exactly two code paths: all-same-char for odd n, two-char split for even n","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/odd-count-two-branch.json"},{"id":"odd-index-reads-even-no-write-hazard","text":"In `replaceDigits`, each odd-index replacement reads from the preceding even index, which is never modified by the loop — so iteration order cannot affect correctness.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/odd-index-reads-even-no-write-hazard.json"},{"id":"odd-k-residual-cost","text":"When leftover k is odd after flipping all negatives, the sum penalty is exactly `2 * min(nums)` applied to the already-mutated (all-non-negative) array.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/odd-k-residual-cost.json"},{"id":"odd-string-exactly-one-outlier-assumed","text":"`stringWithDifferentDifference` assumes exactly one word has a unique difference array; if zero are unique it returns `\"\"`, if multiple are unique it returns only the first — the problem guarantees this won't happen","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/odd-string-exactly-one-outlier-assumed.json"},{"id":"odd-subarray-count-formula","text":"Element at index `i` in an array of length `n` appears in exactly `((i+1)*(n-i)+1)//2` odd-length subarrays, derived from total subarray count `(i+1)*(n-i)` with ceiling division by 2","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/odd-subarray-count-formula.json"},{"id":"one-liner-pipeline-pattern","text":"Easy-level solutions frequently use a composable pipeline of built-in string/list operations in a single return statement (e.g., split → transform → join) with no intermediate variables.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/one-liner-pipeline-pattern.json"},{"id":"one-mismatch-always-false","text":"Exactly one positional mismatch between two strings is never fixable by a single swap because a swap always changes two positions simultaneously","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/one-mismatch-always-false.json"},{"id":"one-problem-per-directory","text":"Each problem gets its own directory containing at minimum a `solution.py` and `test_solution.py`, with optional `plan.md` and `review.md` files.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/one-problem-per-directory.json"},{"id":"op1-discriminates-all-operations","text":"In `max_value`, the character at index 1 is `\"+\"` for both increment forms (`\"++X\"`, `\"X++\"`) and `\"-\"` for both decrement forms, making `op[1]` a sufficient discriminator without string matching.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/op1-discriminates-all-operations.json"},{"id":"ord-offset-letter-to-digit-pattern","text":"The `ord(c) - ord('a')` idiom for mapping lowercase letters to integer positions recurs across multiple solutions (summation-of-two-words, decode-the-message, replace-all-digits).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ord-offset-letter-to-digit-pattern.json"},{"id":"ord-offset-produces-multichar-strings","text":"The mapping `ord(c) - ord('a') + 1` produces values 10–26 for letters j–z, which concatenate as multi-character substrings — this is why the first phase builds a string rather than extracting digits per character.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ord-offset-produces-multichar-strings.json"},{"id":"ordered-stream-amortized-linear","text":"Total pointer movement across all n `insert` calls on `OrderedStream` is O(n), making each insert O(1) amortized despite the inner while loop.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ordered-stream-amortized-linear.json"},{"id":"ordered-stream-none-sentinel","text":"`OrderedStream` uses `None` as the sentinel for unfilled slots — inserting `None` as a value would break the contiguity scan, causing it to stop prematurely.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ordered-stream-none-sentinel.json"},{"id":"ordered-stream-pointer-monotonic","text":"`OrderedStream.ptr` only increases; once a value is returned from an `insert` call it is never returned again, and slots below the pointer are logically consumed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ordered-stream-pointer-monotonic.json"},{"id":"ordinal-arithmetic-for-letter-indexing","text":"Solutions use `ord(ch) - ord('a')` to map lowercase letters to indices 0–25 rather than using a dictionary, a standard LeetCode idiom used across the repo","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ordinal-arithmetic-for-letter-indexing.json"},{"id":"overflow-safe-midpoint-convention","text":"Binary search solutions use `left + (right - left) // 2` instead of `(left + right) // 2` as a consistent idiom across the repo, borrowed from C/Java overflow safety even though Python has arbitrary-precision integers.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/overflow-safe-midpoint-convention.json"},{"id":"overflow-safe-midpoint-idiom","text":"`guessNumber` computes midpoint as `low + (high - low) // 2` rather than `(low + high) // 2` — unnecessary in Python but signals awareness of the integer overflow pitfall and is used idiomatically across the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/overflow-safe-midpoint-idiom.json"},{"id":"overlap-is-conjunction-of-axis-projections","text":"2D rectangle overlap is decomposed into the conjunction of independent 1D overlap checks on the x-axis and y-axis — a reusable geometric pattern.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/overlap-is-conjunction-of-axis-projections.json"},{"id":"overlapping-ranges-idempotent-marking","text":"In the range-coverage solution, overlapping intervals simply re-mark already-True positions in the boolean array — no deduplication or merging step is needed because marking is idempotent.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/overlapping-ranges-idempotent-marking.json"},{"id":"pad-then-slice-idiom","text":"divide-a-string normalizes input length before slicing rather than special-casing the last group — `(k - len(s) % k) % k` computes minimal padding, and uniform stride-k slicing produces all groups.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pad-then-slice-idiom.json"},{"id":"pairs-iff-even-counts","text":"An array can be divided into equal pairs if and only if every distinct element has an even frequency — the divide-array-into-equal-pairs solution checks `count % 2 == 0` for all Counter values.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pairs-iff-even-counts.json"},{"id":"pairs-leftovers-conservation","text":"`count_pairs_leftovers` guarantees the invariant `pairs * 2 + leftovers == len(nums)` — every element is accounted for exactly once as either paired or left over.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pairs-leftovers-conservation.json"},{"id":"pairwise-inequality-for-fixed-window","text":"For the size-3 sliding window, three explicit pairwise `!=` checks are used instead of `len(set(window)) == 3` — a micro-optimization that avoids set construction","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pairwise-inequality-for-fixed-window.json"},{"id":"palindrome-case-sensitive","text":"`longestPalindrome` treats uppercase and lowercase as distinct characters — `'A'` and `'a'` do not form pairs — matching the LeetCode problem spec.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-case-sensitive.json"},{"id":"palindrome-center-bonus-at-most-once","text":"`longestPalindrome` adds at most one center character regardless of how many characters have odd frequencies, using a boolean flag converted to int via Python's `bool` subclassing `int`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-center-bonus-at-most-once.json"},{"id":"palindrome-check-uses-slice-reversal","text":"Palindrome detection uses `word == word[::-1]`, creating a full reversed copy (O(m) space) rather than a two-pointer in-place comparison.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-check-uses-slice-reversal.json"},{"id":"palindrome-construction-reduces-to-frequency-parity","text":"Palindrome construction and permutation problems in the repo uniformly reduce to frequency-parity analysis: a string can form a palindrome iff at most one character has odd frequency, the longest constructible palindrome sums even portions of each frequency plus at most one center character, and the actual count values are discarded in favor of their parity — the palindrome property is entirely determined by the parity signature of the character frequency distribution.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/palindrome-construction-reduces-to-frequency-parity.json"},{"id":"palindrome-greedy-even-portions","text":"`longestPalindrome` computes the result by summing `count // 2 * 2` for each character frequency, extracting the largest even number ≤ count, plus 1 if any odd count exists.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-greedy-even-portions.json"},{"id":"palindrome-instantiates-hash-then-stream","text":"Palindrome construction and permutation problems are specific instantiations of the hash-then-stream pipeline: Counter builds the frequency map in O(n) preprocessing, then a single-pass parity check over frequencies determines constructibility — the same two-phase structure that governs the broader pipeline taxonomy.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/palindrome-instantiates-hash-then-stream.json"},{"id":"palindrome-is-canonical-counter-pipeline-exemplar","text":"Palindrome problems serve as the canonical exemplar of the full Counter-to-pipeline reduction chain: Counter construction from string (algebraic construction), frequency extraction (algebraic measurement), parity reduction (algebraic projection), and threshold aggregation (streaming accumulation) — exercising every layer of the hash-then-stream pipeline within a single problem class and demonstrating how Counter's algebraic completeness flows through the pipeline architecture.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/palindrome-is-canonical-counter-pipeline-exemplar.json"},{"id":"palindrome-ll-mutates-input","text":"`isPalindrome` reverses the second half of the linked list in-place and does not restore it — after the call returns, the original list structure is permanently altered","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-ll-mutates-input.json"},{"id":"palindrome-ll-o1-space-via-mutation","text":"`isPalindrome` achieves O(1) extra space by mutating the list in-place (fast/slow pointer to find midpoint, then in-place reversal) rather than copying values to an array","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-ll-o1-space-via-mutation.json"},{"id":"palindrome-ll-p2-terminates-comparison","text":"The comparison loop iterates until `p2` (reversed second half) is `None`, not `p1`, because the reversed half is always <= the first half in length (middle node stays with first half for odd-length lists)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-ll-p2-terminates-comparison.json"},{"id":"palindrome-ll-slow-pointer-guard","text":"The `while fast.next and fast.next.next` guard places `slow` at the last node of the first half — using the alternative `while fast and fast.next` would overshoot by one node and break the split","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-ll-slow-pointer-guard.json"},{"id":"palindrome-num-half-reversal-technique","text":"`is_palindrome` reverses only the second half of the digits and compares to the first half — the loop `while x > reversed_half` naturally stops at the midpoint, avoiding full reversal and potential overflow","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-num-half-reversal-technique.json"},{"id":"palindrome-num-no-string-conversion","text":"The palindrome number solution uses only integer arithmetic (`%`, `//`, `*`) — no `str()`, slicing, or string comparison, satisfying the problem's implicit constraint","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-num-no-string-conversion.json"},{"id":"palindrome-num-trailing-zero-early-exit","text":"Non-zero integers ending in 0 are rejected in O(1) before the reversal loop — a palindrome with trailing zeros would require leading zeros, which is impossible","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-num-trailing-zero-early-exit.json"},{"id":"palindrome-num-zero-is-palindrome","text":"The input `0` correctly returns `True` — the trailing-zero guard has an explicit carve-out (`x != 0`) so zero is not falsely rejected","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-num-zero-is-palindrome.json"},{"id":"palindrome-perm-at-most-one-odd","text":"`canPermutePalindrome` returns `True` iff at most one character in `s` has an odd frequency count","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-perm-at-most-one-odd.json"},{"id":"palindrome-perm-empty-string-true","text":"An empty string input returns `True` (zero odd counts <= 1)","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-perm-empty-string-true.json"},{"id":"palindrome-perm-linear-time","text":"The solution runs in O(n) time and O(k) space where k is the alphabet size, dominated by `Counter` construction","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-perm-linear-time.json"},{"id":"palindrome-perm-parity-reduction","text":"The solution reduces character frequencies to their parity (odd/even) via `c % 2`, discarding actual counts — a common idiom in palindrome problems","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/palindrome-perm-parity-reduction.json"},{"id":"palindrome-reversal-adapts-across-data-domains","text":"Palindrome detection implements the same core insight — reverse and compare — across three data domains, each adapting the reversal mechanism to its representation: string slice reversal creates a full copy (O(n) space), integer half-reversal compares digits without string conversion (O(1) space), and linked list in-place reversal reuses existing nodes (O(1) space via mutation).","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/palindrome-reversal-adapts-across-data-domains.json"},{"id":"pancakeSort-is-test-harness-alias","text":"`pancakeSort = bitwiseComplement` is a class-level alias, not a separate implementation; it exists so the repo's test harness can call a consistent method name across all solution files regardless of the actual LeetCode method signature.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pancakeSort-is-test-harness-alias.json"},{"id":"pangram-method-name-mismatch","text":"The pangram solution (`check-if-the-sentence-is-pangram/solution.py`) names its method `min_operations` instead of `checkIfPangram` — a copy-paste artifact that doesn't break tests because the harness calls whatever method is defined on `Solution`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pangram-method-name-mismatch.json"},{"id":"parent-context-threading-via-parameter","text":"`sum_of_left_leaves` passes an `is_left` boolean down the recursion so each node knows its relationship to its parent, rather than using the parent-look-ahead pattern where the parent checks `node.left.left is None`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/parent-context-threading-via-parameter.json"},{"id":"parity-ii-in-place-mutation","text":"The `possible_bipartition` method mutates and returns the input list; callers holding a reference to the original list see the changes.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/parity-ii-in-place-mutation.json"},{"id":"parity-ii-linear-time","text":"The parity-II algorithm runs in O(n) time and O(1) extra space via two stride-2 pointers that each traverse at most n/2 elements.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/parity-ii-linear-time.json"},{"id":"parity-ii-method-name-mismatch","text":"The parity-II solution method is named `possible_bipartition` rather than the LeetCode canonical `sortArrayByParityII`, likely a naming artifact from generation tooling.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/parity-ii-method-name-mismatch.json"},{"id":"parity-ii-swap-correctness","text":"A swap only occurs when `nums[i]` is odd and `nums[j]` is even, guaranteeing both positions are fixed simultaneously.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/parity-ii-swap-correctness.json"},{"id":"parity-slot-preservation-invariant","text":"In `largest-number-after-digit-swaps-by-parity/solution.py`, the output digit at every position has the same odd/even parity as the input digit at that position — enforced by dual-pointer reconstruction from separate sorted pools","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/parity-slot-preservation-invariant.json"},{"id":"partial-week-starts-at-full-weeks-plus-1","text":"The first day of the leftover partial week deposits `full_weeks + 1` (the 1-indexed week number), not `full_weeks`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/partial-week-starts-at-full-weeks-plus-1.json"},{"id":"pascal-boundary-by-prefill","text":"Boundary values (first and last element of each row = 1) are set by pre-filling with `[1] * (i + 1)`, not by conditional logic","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pascal-boundary-by-prefill.json"},{"id":"pascal-generate-pure","text":"`generate` is a pure function with no side effects, no imports, and no mutation of external state","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pascal-generate-pure.json"},{"id":"pascal-inner-loop-safe","text":"The inner loop `range(1, i)` guarantees all `triangle[i-1]` lookups are in-bounds without explicit bounds checking","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pascal-inner-loop-safe.json"},{"id":"pascal-zero-rows-returns-empty","text":"Calling `generate(0)` returns `[]` since the outer loop range is empty, even though this is outside the stated LeetCode constraints","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pascal-zero-rows-returns-empty.json"},{"id":"pascals-triangle-ii-inplace-dp-pattern","text":"The reverse-traversal in-place mutation is the same space-optimization pattern used in 0/1 knapsack and other DP problems that reduce 2D state to 1D","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pascals-triangle-ii-inplace-dp-pattern.json"},{"id":"pascals-triangle-ii-reverse-traversal","text":"The inner loop must traverse right-to-left; left-to-right would use already-updated values and produce incorrect results","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pascals-triangle-ii-reverse-traversal.json"},{"id":"pascals-triangle-ii-row-zero-correct","text":"For `row_index=0`, the loop body never executes and `[1]` is returned, which is correct","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pascals-triangle-ii-row-zero-correct.json"},{"id":"pascals-triangle-ii-space-linear","text":"The solution uses O(row_index) space by mutating a single list in place rather than building all prior rows","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pascals-triangle-ii-space-linear.json"},{"id":"password-checker-no-short-circuit-on-flags","text":"The validation loop cannot short-circuit even after all four category flags are `True`, because every adjacent pair must still be checked for duplicate characters","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/password-checker-no-short-circuit-on-flags.json"},{"id":"password-checker-special-char-independent-if","text":"The special-character membership test is a standalone `if` (not part of the `elif` chain for lower/upper/digit), ensuring characters like space that fail all three category tests are still recognized as special","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/password-checker-special-char-independent-if.json"},{"id":"password-checker-specials-include-space","text":"The special characters set is `\"!@#$%^&*()-+ \"` which includes the space character, matching the LeetCode problem specification","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/password-checker-specials-include-space.json"},{"id":"path-crossing-directions-rebuilt-per-call","text":"The directions dict mapping characters to displacement vectors is a local variable inside `path_crossing`, rebuilt on every invocation rather than hoisted to module scope.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/path-crossing-directions-rebuilt-per-call.json"},{"id":"path-crossing-early-exit","text":"`path_crossing` returns `True` on the first revisited coordinate via early return, skipping the rest of the path.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/path-crossing-early-exit.json"},{"id":"path-crossing-no-validation","text":"Invalid direction characters (anything not in N/S/E/W) raise an uncaught `KeyError` from the directions dict lookup — no input validation exists.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/path-crossing-no-validation.json"},{"id":"path-crossing-origin-seeded","text":"The visited set is seeded with (0,0) before any steps, so returning to the origin counts as a path crossing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/path-crossing-origin-seeded.json"},{"id":"path-crossing-set-based-visited","text":"Revisit detection uses a set of coordinate tuples for O(1) membership checks — the standard pattern for cycle/revisit detection on grids in this repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/path-crossing-set-based-visited.json"},{"id":"path-sum-leaf-only-matching","text":"`hasPathSum` only returns `True` when the matching path ends at a leaf node (both children `None`); internal nodes whose cumulative sum equals the target are explicitly rejected.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/path-sum-leaf-only-matching.json"},{"id":"path-sum-null-always-false","text":"`hasPathSum(None, targetSum)` returns `False` for any `targetSum` including 0 — an empty tree has no paths.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/path-sum-null-always-false.json"},{"id":"path-sum-self-contained-module","text":"`path-sum/solution.py` defines `TreeNode`, the solution function, and the full test suite (`TestPathSum` with 9 cases) in a single file.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/path-sum-self-contained-module.json"},{"id":"path-sum-short-circuit-or","text":"The `or` in the recursive return skips exploration of the right subtree entirely if the left subtree already found a valid path.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/path-sum-short-circuit-or.json"},{"id":"path-sum-subtraction-pattern","text":"The algorithm subtracts each node's value from the remaining target rather than accumulating a running sum, avoiding an extra accumulator parameter.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/path-sum-subtraction-pattern.json"},{"id":"per-problem-data-structure-isolation","text":"Each problem directory defines its own data structures (e.g., `TreeNode` in `sum-of-left-leaves`) rather than importing from a shared utility module, maintaining per-problem self-containment.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/per-problem-data-structure-isolation.json"},{"id":"per-problem-directory-layout","text":"Each LeetCode problem lives in its own directory containing `solution.py`, `test_solution.py`, `plan.md`, and `review.md` as the standard file set.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/per-problem-directory-layout.json"},{"id":"percentage-floor-integer-arithmetic","text":"`percentageLetter` computes floor percentage using `count * 100 // len(s)`, avoiding floating-point entirely to prevent rounding artifacts.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/percentage-floor-integer-arithmetic.json"},{"id":"percentage-no-empty-string-guard","text":"`percentageLetter` has no guard against empty-string input and will raise `ZeroDivisionError` — it relies on LeetCode's constraint that `len(s) >= 1`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/percentage-no-empty-string-guard.json"},{"id":"perfect-number-dedup-guard","text":"The `i != num // i` check prevents double-counting the square root divisor when `num` is a perfect square.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/perfect-number-dedup-guard.json"},{"id":"perfect-number-seed-one","text":"The divisor sum is seeded at 1 (since 1 is always a proper divisor for `num > 1`), and the loop starts at 2, avoiding a special case inside the loop.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/perfect-number-seed-one.json"},{"id":"perfect-number-sqrt-complexity","text":"`checkPerfectNumber` runs in O(sqrt(n)) time and O(1) space by harvesting paired divisors from a loop up to `isqrt(num)`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/perfect-number-sqrt-complexity.json"},{"id":"perfect-number-uses-isqrt","text":"`checkPerfectNumber` uses `math.isqrt` instead of `int(math.sqrt(n))` to avoid floating-point precision loss for large integers near 2^53.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/perfect-number-uses-isqrt.json"},{"id":"perform-string-shifts-empty-crash","text":"Passing an empty string to `inorder` raises `ZeroDivisionError` at `net %= len(s)` — no guard exists.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/perform-string-shifts-empty-crash.json"},{"id":"pigeonhole-26-letter-bound","text":"The first-letter-to-appear-twice loop executes at most 27 iterations regardless of string length, since 26 lowercase letters force a collision by the 27th character via the pigeonhole principle.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pigeonhole-26-letter-bound.json"},{"id":"pillow-holder-n1-crash","text":"Calling `pillowHolder(1, t)` for any `t > 0` raises `ZeroDivisionError` because `cycle` is 0","truth_value":"OUT","justification_count":0,"dependent_count":4,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pillow-holder-n1-crash.json"},{"id":"pillow-holder-o1-time","text":"`pillowHolder` runs in O(1) time and space regardless of the `time` input, using division and modulo instead of simulation","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pillow-holder-o1-time.json"},{"id":"pillow-holder-parity-direction","text":"Even `full_passes` means forward direction (returns `1 + remainder`), odd means backward (returns `n - remainder`)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pillow-holder-parity-direction.json"},{"id":"pillow-holder-zero-indexed-cycle","text":"The cycle length is `n - 1` (not `n`), representing the number of hand-offs per pass, not the number of people","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pillow-holder-zero-indexed-cycle.json"},{"id":"ping-window-boundary-inclusive","text":"In the recent-calls solution (problem 933), the eviction condition `self.q[0] < t - 3000` keeps timestamps equal to `t - 3000` in the window, making both endpoints of `[t-3000, t]` inclusive","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ping-window-boundary-inclusive.json"},{"id":"pipeline-decomposition-unifies-classification-and-optimization","text":"The preprocess-then-stream pipeline decomposition serves a dual structural role: it is simultaneously the classification criterion that partitions the solution taxonomy into three exhaustive strategies AND the optimization mechanism that achieves correctness, time efficiency, and space efficiency — the same structural cut that classifies solutions also optimizes them.","truth_value":"OUT","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/pipeline-decomposition-unifies-classification-and-optimization.json"},{"id":"pipeline-generates-misnamed-functions","text":"At least two solutions have function names from unrelated LeetCode problems due to copy-paste errors in the code generation pipeline: `longestAwesomeSubstring` solves problem 1668 (not 1542), and `busiest_servers` solves problem 1710 (not 1606).","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pipeline-generates-misnamed-functions.json"},{"id":"pivot-index-accumulate-after-check","text":"In `pivotIndex`, `left_sum += num` occurs *after* the equality check — this ordering is a critical invariant ensuring the pivot element is excluded from both the left and right sums.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pivot-index-accumulate-after-check.json"},{"id":"pivot-index-boundary-no-special-case","text":"Index 0 and index n-1 are valid pivot positions without special-case code because `left_sum` starts at 0 and the right sum is computed algebraically — empty-side sums are implicitly zero.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pivot-index-boundary-no-special-case.json"},{"id":"pivot-index-leftmost-guarantee","text":"`pivotIndex` returns the leftmost valid pivot index via early return on first match, not just any valid pivot.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pivot-index-leftmost-guarantee.json"},{"id":"pivot-index-right-sum-derived-algebraically","text":"`pivotIndex` never computes the right sum directly; it derives it as `total - left_sum - nums[i]`, enabling O(n) time and O(1) space with a single pass after the initial `sum()`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pivot-index-right-sum-derived-algebraically.json"},{"id":"pivot-integer-closed-form-o1","text":"`find_pivot` reduces the problem to checking whether `n*(n+1)/2` is a perfect square, yielding O(1) time and space with no loops or recursion.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pivot-integer-closed-form-o1.json"},{"id":"pivot-integer-isqrt-not-sqrt","text":"`find_pivot` uses `math.isqrt` (integer square root) instead of `math.sqrt` to avoid floating-point precision bugs that surface with `int(math.sqrt(n))` for large perfect squares.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pivot-integer-isqrt-not-sqrt.json"},{"id":"plate-parsing-ignores-non-alpha","text":"Only alphabetic characters from `licensePlate` contribute to the required letter counts; digits and spaces are filtered by `isalpha()` and letters are lowercased at parse time, while `words` are assumed already lowercase.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/plate-parsing-ignores-non-alpha.json"},{"id":"popcount-via-bin-count","text":"The codebase uses `bin(n).count('1')` as its standard popcount idiom rather than Kernighan's bit-clearing loop or Python 3.10+'s `int.bit_count()`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/popcount-via-bin-count.json"},{"id":"postorder-accumulator-pattern","text":"Tree problems in this repo use a recurring idiom: a postorder DFS function returns one value (e.g., subtree sum, height) while accumulating a second aggregate (e.g., tilt, diameter) into a `nonlocal` closure variable.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/postorder-accumulator-pattern.json"},{"id":"postorder-uses-reverse-preorder","text":"The n-ary postorder traversal computes a modified preorder (root-right-left via stack) and reverses the result, rather than using recursion or visited-node tracking.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/postorder-uses-reverse-preorder.json"},{"id":"power-of-four-constant-time","text":"`isPowerOfFour` runs in O(1) time and O(1) space with no loops, recursion, or library calls.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/power-of-four-constant-time.json"},{"id":"power-of-four-mask-32bit","text":"The mask `0x55555555` only covers bit positions 0–30, so the power-of-four solution assumes n fits in a 32-bit signed integer (matching the LeetCode constraint).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/power-of-four-mask-32bit.json"},{"id":"power-of-four-subset-of-power-of-two","text":"The first two conditions in `isPowerOfFour` (`n > 0` and `n & (n-1) == 0`) are exactly the power-of-two check; the third condition (`n & 0x55555555 != 0`) narrows from powers-of-two to powers-of-four by requiring the set bit at an even position.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/power-of-four-subset-of-power-of-two.json"},{"id":"power-of-three-32bit-assumption","text":"The power-of-three solution is only correct for inputs in [-2^31, 2^31-1]; any power of 3 exceeding 3^19 (e.g., 3^20) would incorrectly return `False`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/power-of-three-32bit-assumption.json"},{"id":"power-of-three-magic-constant","text":"The constant 1162261467 equals 3^19, the largest power of 3 below 2^31, and is load-bearing for correctness — if the input domain expanded beyond 32-bit signed integers, this constant would need to change.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/power-of-three-magic-constant.json"},{"id":"power-of-three-prime-dependency","text":"The divisibility trick (`3^19 % n == 0` implies n is a power of 3) is valid only because 3 is prime; applying the same pattern to a composite base would produce false positives since composite powers have non-power divisors.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/power-of-three-prime-dependency.json"},{"id":"power-of-two-bit-trick","text":"`n & (n - 1) == 0` detects positive integers with exactly one set bit (powers of two); this is a foundational kernel reused in power-of-four and referenced by number-of-1-bits (Brian Kernighan's algorithm) across the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/power-of-two-bit-trick.json"},{"id":"power-of-two-rejects-zero","text":"The `n > 0` guard in `is_power_of_two` is necessary because `0 & (0 - 1)` equals `0`, which would incorrectly pass the single-set-bit test.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/power-of-two-rejects-zero.json"},{"id":"power-of-x-positivity-guard","text":"All three power-of-X solutions (two, three, four) share an `n > 0` guard as their first short-circuit condition, since no non-positive integer is a power of any positive base — and each would fail differently without it (false positive for zero in power-of-two, ZeroDivisionError in power-of-three).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/power-of-x-positivity-guard.json"},{"id":"precompute-then-transfer-partition-idiom","text":"`max_score_after_splitting` uses a precompute-then-transfer pattern: initialize the right-side count to the full-string total, then \"transfer\" elements to the left side as the partition sweeps right, achieving O(n) time instead of O(n^2) re-counting.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/precompute-then-transfer-partition-idiom.json"},{"id":"predictability-is-itself-stable","text":"The system's quantitative predictability is itself a stable property (meta-stability): the two predictive relationships (abstraction overhead predicts convergence strength; judge reward signal predicts defense investment) are invariant because the quality equilibrium that generates them is doubly locked at every granularity — the predictors cannot drift because the underlying quality dynamics are at a fixed point, making the system not just predictable but reliably predictable across time.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/predictability-is-itself-stable.json"},{"id":"prefix-count-difference-pattern","text":"The formula `f(high) - f(low - 1)` is used to count elements satisfying a predicate in a range by subtracting prefix counts, as seen in `count_odds` where `(high+1)//2 - low//2` computes odds in `[low, high]`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/prefix-count-difference-pattern.json"},{"id":"prefix-match-requires-word-boundary","text":"`is_prefix_string` only returns `True` when `s` aligns exactly with a word boundary in `words`; partial word matches are rejected because equality is checked after appending whole words","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/prefix-match-requires-word-boundary.json"},{"id":"preorder-reversed-children-for-left-to-right","text":"The n-ary preorder traversal pushes `reversed(node.children)` onto the stack so that LIFO pop order yields left-to-right child visitation — the mirror of postorder's `extend(children)` approach.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/preorder-reversed-children-for-left-to-right.json"},{"id":"preorder-right-before-left-push-order","text":"In iterative preorder traversal, the right child is pushed onto the stack before the left child so that LIFO ordering produces the correct root-left-right visit sequence.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/preorder-right-before-left-push-order.json"},{"id":"preprocess-then-stream-is-canonical-pipeline","text":"The dominant two-phase algorithmic pipeline is: build a hash structure (Counter for frequencies, set for membership) in O(n) preprocessing, then consume it via single-pass streaming with O(1) accumulators — combining the repo's two most pervasive patterns into one archetypal shape.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/preprocess-then-stream-is-canonical-pipeline.json"},{"id":"preprocessing-is-domain-transformation-to-streaming","text":"The canonical pipeline's preprocessing phase functions as a domain adapter: it converts problems from domains where streaming alone may be insufficient (such as ordering-dependent or frequency-queried problems) into a form where single-traversal accumulation can produce correct results. This suggests that many non-streaming solutions can be understood as streaming with a preprocessing step prepended, since the single-traversal accumulation paradigm appears universal across data structures.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/preprocessing-is-domain-transformation-to-streaming.json"},{"id":"prev-sentinel-assumes-positive","text":"`is_increasing_skip` initializes `prev = -1` as a sentinel, which is correct only because the problem guarantees `nums[i] >= 1` — this would silently break on inputs containing non-positive values.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/prev-sentinel-assumes-positive.json"},{"id":"prev-zero-sentinel","text":"In `count_binary_substrings`, `prev` starts at 0 so the first group boundary contributes zero substrings via `min(0, curr)`, correctly handling the absence of a preceding group.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/prev-zero-sentinel.json"},{"id":"prime-arrangements-factorial-decomposition","text":"The answer to Prime Arrangements equals `factorial(prime_count) * factorial(non_prime_count) mod 10^9+7`, because primes must occupy prime indices and non-primes must occupy non-prime indices — two independent permutation groups.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/prime-arrangements-factorial-decomposition.json"},{"id":"product-init-one-not-zero","text":"The product accumulator in `subtract_product_and_sum` starts at 1 (multiplicative identity); starting at 0 would make the product always 0 regardless of input","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/product-init-one-not-zero.json"},{"id":"property-based-tests-for-multi-answer-problems","text":"When a problem has multiple valid outputs, tests assert structural invariants (e.g., no consecutive repeats, preserved non-placeholder characters) rather than pinning to a specific expected string.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/property-based-tests-for-multi-answer-problems.json"},{"id":"pure-function-convention","text":"Solution methods are typically stateless pure functions with no side effects and no instance state; the `Solution` class exists solely to satisfy LeetCode's submission format.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/pure-function-convention.json"},{"id":"python-int-drops-leading-zeros-safely","text":"String-accumulator digit-splitting relies on Python's `int()` silently dropping leading zeros, so inputs with zero digits (e.g., 2030) need no special handling","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/python-int-drops-leading-zeros-safely.json"},{"id":"python-modulo-floor-semantics","text":"The `net %= len(s)` normalization relies on Python's floor-modulo semantics where `(-2) % 5 == 3` — this would produce different results in C/Java, which use truncated division.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/python-modulo-floor-semantics.json"},{"id":"python-negative-mod-safe-for-circular","text":"Python's `%` operator guarantees non-negative results for positive divisors, so `(i - j) % n` correctly handles backward circular wrapping without an explicit bounds check — used in defuse-the-bomb and applicable to all circular-array solutions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/python-negative-mod-safe-for-circular.json"},{"id":"python-no-overflow-gauss-sum","text":"The Gauss sum approach in `missing-number/solution.py` has no overflow risk in Python due to arbitrary-precision integers, unlike equivalent C++/Java implementations where `n*(n+1)` can exceed fixed-width integer bounds.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/python-no-overflow-gauss-sum.json"},{"id":"python-stdlib-preferred-over-manual-algorithms","text":"Solutions systematically delegate computation to Python standard library abstractions — str() for digit extraction, Counter for frequency counting, set for deduplication, bin().count() for popcount — rather than implementing equivalent arithmetic or bitwise logic manually.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"insufficient","source_type":"","url":"/public/leetcode-expert/belief/python-stdlib-preferred-over-manual-algorithms.json"},{"id":"quality-equilibrium-self-reinforcing","text":"The repo's quality profile (high algorithmic sophistication, low engineering discipline) is a self-reinforcing equilibrium: the submission-optimized architecture makes engineering quality invisible to the judge, removing the feedback signal that would drive improvement, while algorithmic quality receives immediate accept/reject feedback — quality flows toward measurement, and the absence of measurement guarantees stasis.","truth_value":"IN","justification_count":1,"dependent_count":5,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/quality-equilibrium-self-reinforcing.json"},{"id":"quality-inversion-algorithmic-vs-engineering","text":"The repo exhibits a quality asymmetry: algorithmic sophistication (convergent paradigms, exact arithmetic) tends to be high while engineering discipline (naming, structure) tends to be low. This pattern is consistent with LeetCode's judge selecting primarily for correctness rather than maintainability, though other factors may also contribute.","truth_value":"IN","justification_count":1,"dependent_count":4,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/quality-inversion-algorithmic-vs-engineering.json"},{"id":"quality-inversion-structurally-inseparable","text":"The quality inversion (high algorithmic sophistication, low engineering discipline) is reinforced by the same construction-plus-isolation mechanism that eliminates defensive code: construction-based correctness removes runtime validation while submission-optimized isolation removes cross-module contracts, together producing lean, algorithmically coherent solutions that lack the cross-solution coupling where engineering conventions would normally develop — suggesting that improving engineering quality would likely require introducing structure that partially counteracts the isolation enabling algorithmic focus.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/quality-inversion-structurally-inseparable.json"},{"id":"quality-profile-doubly-locked","text":"The repo's quality profile (high algorithmic sophistication, low engineering discipline) is locked by two independent mechanisms operating at different structural levels: structural inseparability means the same mechanisms produce both algorithmic quality and engineering neglect (so changing one changes the other), while the self-reinforcing equilibrium means the submission-optimized feedback loop perpetuates both sides independently of structure — neither incremental improvement nor structural refactoring alone can alter the quality balance.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/quality-profile-doubly-locked.json"},{"id":"quality-stasis-at-every-granularity","text":"The repo is in quality stasis at every granularity: the macro-level quality profile (high algorithmic sophistication, low engineering discipline) is doubly locked by domain selection and self-reinforcing equilibrium, while micro-level engineering debts (naming drift, convention inconsistency, style divergence) are individually frozen by the submission-optimized architecture's inability to surface them.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/quality-stasis-at-every-granularity.json"},{"id":"quarter-gap-proves-frequency-in-sorted-array","text":"In a sorted array, `arr[i] == arr[i + len(arr)//4]` proves that element appears at least `len(arr)//4 + 1` times, because all values between those indices must be identical.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/quarter-gap-proves-frequency-in-sorted-array.json"},{"id":"queue-order-irrelevance","text":"The correctness of `countStudents` relies on the insight that queue rotation changes when a student eats but not whether they eat; any student of the matching type will eventually rotate to the front.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/queue-order-irrelevance.json"},{"id":"racecar-is-misnamed","text":"The function `racecar` in `rectangle-overlap/solution.py` implements rectangle overlap (LC 836), not the racecar problem (LC 818); the name is a bug, likely from a code generation pipeline.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/racecar-is-misnamed.json"},{"id":"range-addition-ii-empty-ops-returns-full-matrix","text":"When `ops` is empty, `maxCount` returns `m * n` because all cells are zero and thus all share the maximum value","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/range-addition-ii-empty-ops-returns-full-matrix.json"},{"id":"range-addition-ii-ignores-matrix-dimensions-with-ops","text":"When `ops` is non-empty, the parameters `m` and `n` are unused — the result depends solely on the minimum first and second elements across operations","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/range-addition-ii-ignores-matrix-dimensions-with-ops.json"},{"id":"range-addition-ii-reduces-to-min","text":"`maxCount` runs in O(len(ops)) time and O(1) space by reducing the problem to `min(ai) * min(bi)` — the matrix is never allocated","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/range-addition-ii-reduces-to-min.json"},{"id":"range-bounds-inclusive","text":"In `range_sum_bst`, both `low` and `high` are included in the sum because the pruning comparisons use strict `<` and `>`, so nodes equal to either bound fall into the in-range branch","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/range-bounds-inclusive.json"},{"id":"rank-map-is-o-n-log-n","text":"The ranking solution's time complexity is O(n log n) dominated by `sorted()`; the dict construction is O(k) and lookup per element is O(1) amortized","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rank-map-is-o-n-log-n.json"},{"id":"rank-preserves-original-order","text":"The output of `arrayRankTransform` maintains index correspondence with the input array — only values are replaced with their ranks","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rank-preserves-original-order.json"},{"id":"rank-uses-dense-ranking","text":"`arrayRankTransform` produces dense ranks with no gaps: if k unique values exist, ranks span exactly [1, k], as opposed to competition ranking (1,2,2,4) or ordinal ranking (1,2,3,4)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rank-uses-dense-ranking.json"},{"id":"read4-adapter-inheritance-pattern","text":"`Solution` extends `Reader4` to access the `read4` API, mirroring LeetCode's convention for \"given an API\" problems where the solution class inherits the provided interface.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/read4-adapter-inheritance-pattern.json"},{"id":"rearrange-spaces-preserves-space-count","text":"The output of `reorderSpaces` always contains exactly the same number of space characters as the input — spaces are redistributed, never created or destroyed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rearrange-spaces-preserves-space-count.json"},{"id":"rearrange-spaces-single-word-trailing","text":"When the input contains exactly one word, all spaces are placed after the word (not before), as a special case handled before the `divmod` distribution logic.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rearrange-spaces-single-word-trailing.json"},{"id":"recursive-reversal-On-stack","text":"`reverse_list_recursive` makes one recursive call per node, so stack depth equals list length — lists over ~1000 nodes risk hitting Python's default recursion limit.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/recursive-reversal-On-stack.json"},{"id":"redistribute-chars-counter-update-avoids-concatenation","text":"Using `Counter.update` in a loop avoids allocating a single concatenated string, keeping peak memory proportional to unique characters rather than total characters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/redistribute-chars-counter-update-avoids-concatenation.json"},{"id":"redistribute-chars-divisibility-is-necessary-and-sufficient","text":"The check `all(count % n == 0)` is both necessary and sufficient for redistribution because characters can move freely between any two strings.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/redistribute-chars-divisibility-is-necessary-and-sufficient.json"},{"id":"redistribute-chars-linear-time","text":"The function runs in O(C) time where C is the total number of characters across all words, plus O(U) for the final check where U is the number of unique characters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/redistribute-chars-linear-time.json"},{"id":"redistribute-chars-no-input-validation","text":"The function performs no input validation and will raise `ZeroDivisionError` if called with an empty list, relying on LeetCode's guarantee that `words` is non-empty.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/redistribute-chars-no-input-validation.json"},{"id":"reduce-empty-guard-required","text":"`reduce(or_, nums)` with no initializer raises `TypeError` on an empty list; the early-return guard in `subsetXORSum` is load-bearing, not defensive.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reduce-empty-guard-required.json"},{"id":"reduce-gcd-no-initializer","text":"The x-of-a-kind solution calls `reduce(gcd, counts)` without an initial value, meaning an empty deck would raise `TypeError` — safe under LeetCode constraints but not defensively coded.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reduce-gcd-no-initializer.json"},{"id":"reduction-hierarchy-reflects-domain-quality-gradient","text":"The complete three-tier reduction hierarchy (mathematical reduction → streaming → preprocessing pipeline) mirrors the domain's quality fixed point along its algorithmic axis: the judge reward signal creates an implicit preference gradient favoring solutions closer to the mathematical-reduction end (O(1) > O(n) > O(n log n)), while the quality dynamics simultaneously freeze engineering discipline at every tier, producing a sophistication gradient in the algorithmic dimension with no corresponding gradient in the engineering dimension — the hierarchy is domain-shaped, not developer-shaped.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/reduction-hierarchy-reflects-domain-quality-gradient.json"},{"id":"reformat-impossible-iff-diff-gt-1","text":"`reformat` returns `\"\"` if and only if the count of letters and digits differ by more than 1.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reformat-impossible-iff-diff-gt-1.json"},{"id":"reformat-longer-group-gets-even-indices","text":"After the swap, the longer group always occupies even-indexed positions (0, 2, 4, ...) in the output.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reformat-longer-group-gets-even-indices.json"},{"id":"reformat-no-block-of-one","text":"The loop guard `len(digits) - i > 4` ensures the tail is never a single digit, so no output block has size 1.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reformat-no-block-of-one.json"},{"id":"reformat-output-is-deterministic","text":"For a given input, `reformat` always produces the same permutation (no randomness), though it may not match LeetCode's expected output since any valid interleaving is accepted.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reformat-output-is-deterministic.json"},{"id":"reformat-tail-split-at-four","text":"When exactly 4 digits remain, they are split into two blocks of 2 (not 3+1 or a single 4).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reformat-tail-split-at-four.json"},{"id":"reformat-variable-names-misleading-after-swap","text":"After the swap at line 21, `letters` may contain digit characters and `digits` may contain letter characters; the names reflect initial assignment, not post-swap content.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reformat-variable-names-misleading-after-swap.json"},{"id":"relative-ranks-argsort-pattern","text":"`find_relative_ranks` uses the argsort idiom (`sorted(range(n), key=lambda i: score[i])`) to map ranks back to original positions without building intermediate tuples.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/relative-ranks-argsort-pattern.json"},{"id":"relative-ranks-medal-threshold","text":"Exactly the first three places (0, 1, 2) receive medal strings; place 3 onward receives `str(place + 1)`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/relative-ranks-medal-threshold.json"},{"id":"relative-ranks-no-tie-handling","text":"The function assumes all scores are unique; duplicate scores would receive arbitrary distinct ranks based on Python's stable sort order, with no explicit tie-breaking.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/relative-ranks-no-tie-handling.json"},{"id":"relative-ranks-time-complexity","text":"The function runs in O(n log n) time dominated by the sort, with O(n) auxiliary space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/relative-ranks-time-complexity.json"},{"id":"relative-sort-assumes-arr2-subset-of-arr1","text":"`relativeSortArray` calls `count.pop(x)` without a default — if `arr2` contains a value absent from `arr1`, it raises `KeyError` with no fallback.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/relative-sort-assumes-arr2-subset-of-arr1.json"},{"id":"relative-sort-preserves-multiplicity","text":"The Counter-based reconstruction guarantees every element from `arr1` appears in the output exactly as many times as in the input; no loss or duplication is possible.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/relative-sort-preserves-multiplicity.json"},{"id":"relative-sort-uses-counter-pop-partition","text":"`Counter.pop` during the `arr2` traversal both retrieves element counts and removes keys, partitioning elements into \"ordered\" and \"remainder\" groups in a single pass without a separate set lookup.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/relative-sort-uses-counter-pop-partition.json"},{"id":"remaining-invariant","text":"The remaining counter equals sum(count) at every point in sortString execution, ensuring the drain loop terminates exactly when all characters are consumed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/remaining-invariant.json"},{"id":"remove-digit-no-input-validation","text":"`max_number_after_remove_digit` assumes `digit` appears at least once in `number`; if absent, `last` remains `-1` and the fallback silently truncates the wrong character.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/remove-digit-no-input-validation.json"},{"id":"remove-dupes-assumes-nonempty","text":"`removeDuplicates` starts `k=1` with no empty-list guard, so an empty input returns 1 instead of 0 — a latent bug masked by LeetCode's `1 <= nums.length` constraint.","truth_value":"OUT","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/remove-dupes-assumes-nonempty.json"},{"id":"remove-dupes-assumes-sorted","text":"`removeDuplicates` only compares against the last written element; it silently produces incorrect results on unsorted input with no validation or error.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/remove-dupes-assumes-sorted.json"},{"id":"remove-dupes-compare-against-write-head","text":"Uniqueness is checked via `nums[i] != nums[k-1]` (last written value), not `nums[i] != nums[i-1]` (previous read position) — both work on sorted input but the write-head form generalizes to the Remove Duplicates II variant.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/remove-dupes-compare-against-write-head.json"},{"id":"remove-duplicates-no-dependencies","text":"The `remove-all-adjacent-duplicates-in-string` solution module has zero imports and depends only on Python builtins (`list`, `str.join`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/remove-duplicates-no-dependencies.json"},{"id":"remove-duplicates-stack-invariant","text":"In `removeDuplicates`, the stack never contains two identical adjacent characters at any point during execution, guaranteeing the result is fully reduced in a single pass.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/remove-duplicates-stack-invariant.json"},{"id":"remove-element-uses-stable-compaction","text":"`removeElement` preserves the relative order of retained elements; it does not use the swap-to-end optimization (which would be unstable).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/remove-element-uses-stable-compaction.json"},{"id":"remove-element-write-never-exceeds-read","text":"In `removeElement`, the write pointer `k` satisfies `k <= i` at all times, so the copy `nums[k] = nums[i]` never overwrites an unread element — this is the safety invariant that makes in-place compaction correct.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/remove-element-write-never-exceeds-read.json"},{"id":"remove-elements-no-advance-on-match","text":"When `remove_elements` deletes a node, the cursor does not advance — it re-inspects the new `curr.next`, ensuring consecutive matching nodes are all removed in sequence.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/remove-elements-no-advance-on-match.json"},{"id":"repeated-division-terminates","text":"The `while n: n //= k` loop terminates in O(log_k(n)) iterations for k >= 2 because integer division by k >= 2 strictly decreases a positive n toward zero.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repeated-division-terminates.json"},{"id":"repeated-n-times-early-return","text":"`repeated_n_times` returns inside the loop body with no post-loop return; it relies on the problem guarantee that a duplicate always exists, and returns `None` implicitly if called with all-unique input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repeated-n-times-early-return.json"},{"id":"repeated-n-times-linear-time","text":"`repeated_n_times` runs in O(n) time and O(n) space using set-based duplicate detection with early termination.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repeated-n-times-linear-time.json"},{"id":"repeated-n-times-pigeonhole-bound","text":"In a 2n-length array where one value repeats n times, the pigeonhole principle guarantees a duplicate is found within the first n+1 elements during a linear scan.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repeated-n-times-pigeonhole-bound.json"},{"id":"repo-dfs-naming-convention","text":"Solutions in this repo export a function named `dfs` regardless of the actual algorithm used; this is a repo-wide convention that the test harness depends on, not a description of the algorithm.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-dfs-naming-convention.json"},{"id":"repo-each-problem-dir-is-independent","text":"Each problem directory contains a self-contained `solution.py` that defines all needed types (e.g., `TreeNode`) locally rather than importing from a shared module.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-each-problem-dir-is-independent.json"},{"id":"repo-function-naming-bug","text":"The closest-to-zero solution exports `robot_instructions` instead of a problem-appropriate name, suggesting a code-generation naming bug that may be shared across the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-function-naming-bug.json"},{"id":"repo-generator-counting-idiom","text":"Multiple solutions use `sum(pred(x) for x in iterable)` as the standard conditional counting pattern, exploiting Python's `True == 1` coercion and avoiding intermediate list allocation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-generator-counting-idiom.json"},{"id":"repo-imported-by-is-misleading","text":"The \"Imported By\" cross-reference lists in file exploration output reflect test files importing their own local `solution.py`, not actual cross-module dependencies — each solution is consumed only by its own `test_solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-imported-by-is-misleading.json"},{"id":"repo-imported-by-lists-are-artifacts","text":"The \"Imported By\" lists reported by the analysis tooling are misleading — they reflect shared imports (like `unittest` or `typing.List`) across the repo, not actual dependencies on each solution's functions","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-imported-by-lists-are-artifacts.json"},{"id":"repo-imported-by-lists-are-misleading","text":"The \"Imported By\" lists in code-expert prompts overcount: hundreds of test files appear because they share similar import patterns, but each `test_solution.py` only imports from its own co-located `solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-imported-by-lists-are-misleading.json"},{"id":"repo-imported-by-unreliable","text":"The repo's dependency scanner produces misleading \"Imported By\" lists — it flags hundreds of test files as importing a given solution when they actually import their own `solution.py`; only each problem's own `test_solution.py` is a real consumer.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-imported-by-unreliable.json"},{"id":"repo-mixes-class-and-function-styles","text":"Some solutions use a `Solution` class with LeetCode method signatures (e.g., `countPairs`, `countGoodTriplets`) while others use bare module-level functions (e.g., `distinct_numbers`, `min_moves`, `count_hills_and_valleys`) — the repo has no single convention.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-mixes-class-and-function-styles.json"},{"id":"repo-mixes-function-and-class-conventions","text":"Some solutions expose a bare function named after the problem slug in snake_case (e.g., `determine_if_string_halves_are_alike`, `has_event_conflict`), while others wrap the solver in a `Solution` class (e.g., `Solution.findRotation`, `Solution.diStringMatch`, `diameter_of_binary_tree`); the convention is not uniform across the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-mixes-function-and-class-conventions.json"},{"id":"repo-modules-are-self-contained","text":"Each problem directory contains a standalone `solution.py` with both the algorithm and its unit tests; there are no cross-problem import dependencies.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-modules-are-self-contained.json"},{"id":"repo-modules-self-contained","text":"Each problem directory is a self-contained module — types like `TreeNode` are defined locally rather than imported from a shared location, and there are no cross-problem runtime imports.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-modules-self-contained.json"},{"id":"repo-most-solutions-skip-input-validation","text":"The dominant pattern across solutions is to trust LeetCode's input guarantees and omit validation; `smallest-even-multiple` is a notable exception that validates type and range","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-most-solutions-skip-input-validation.json"},{"id":"repo-no-cross-problem-imports","text":"Each problem directory is self-contained; solution files never import from other problem directories, and the \"Imported By\" lists across the repo are test-infrastructure artifacts, not real cross-problem dependencies.","truth_value":"IN","justification_count":0,"dependent_count":2,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-no-cross-problem-imports.json"},{"id":"repo-no-input-validation","text":"Solutions trust LeetCode's input constraints and perform no defensive validation; correctness relies on problem guarantees rather than runtime checks.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-no-input-validation.json"},{"id":"repo-one-problem-per-directory","text":"Each LeetCode problem is isolated in its own directory with a consistent structure: `solution.py`, `test_solution.py`, `review.md`, `plan.md`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-one-problem-per-directory.json"},{"id":"repo-optimized-for-submission-not-engineering","text":"The repo's architecture is entirely submission-throughput-optimized: solutions are correct for the LeetCode judge but neither reusable nor internally consistent, as no enforcement mechanism exists at any level for naming, testing, or structural conventions.","truth_value":"IN","justification_count":1,"dependent_count":4,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/repo-optimized-for-submission-not-engineering.json"},{"id":"repo-per-problem-directory-convention","text":"Each LeetCode problem lives in its own directory containing at least a `solution.py` and `test_solution.py`, forming a self-contained module.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-per-problem-directory-convention.json"},{"id":"repo-problem-dirs-self-contained","text":"Each problem directory is fully independent — no solution imports symbols from another problem's directory, despite misleading cross-references in the code-expert \"imported by\" output","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-problem-dirs-self-contained.json"},{"id":"repo-single-file-solution-and-tests","text":"Each problem directory contains a single `solution.py` with both the `Solution` class (or standalone function) and a `unittest.TestCase` subclass — no separate test files required to run coverage","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-single-file-solution-and-tests.json"},{"id":"repo-single-function-per-solution","text":"Each solution file exports exactly one public function (or one `Solution` class with one method), matching LeetCode's function signature adapted to the repo's snake_case convention.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-single-function-per-solution.json"},{"id":"repo-solution-and-tests-colocated","text":"Solution classes and unit tests coexist in the same `solution.py` file with an `if __name__ == \"__main__\"` guard, following a repo-wide convention.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-solution-and-tests-colocated.json"},{"id":"repo-solution-test-convention","text":"Each problem directory contains `solution.py` with the solution class/function and `test_solution.py` with tests; some solution files also include inline `unittest` suites runnable via `__main__`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-solution-test-convention.json"},{"id":"repo-solutions-are-pure-stdlib","text":"All four solutions examined use no external dependencies — pure Python stdlib only (at most `collections.Counter`, `typing`, `unittest`)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-solutions-are-pure-stdlib.json"},{"id":"repo-solutions-stdlib-only","text":"Solutions import only from the Python standard library (`unittest`, `typing`, `collections`, `annotations`) — no external packages are used anywhere in the repo","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-solutions-stdlib-only.json"},{"id":"repo-solutions-trust-leetcode-constraints","text":"Solutions across the repo perform no input validation (shape, type, value range); they rely on LeetCode's guaranteed constraints, meaning invalid inputs produce silent wrong answers or unguarded exceptions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-solutions-trust-leetcode-constraints.json"},{"id":"repo-standard-problem-layout","text":"Each LeetCode problem is isolated in its own directory containing `solution.py`, `test_solution.py`, `plan.md`, and `review.md`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-standard-problem-layout.json"},{"id":"repo-test-harness-shared-imports","text":"The \"Imported By\" lists in solution files are misleading — hundreds of test files appear because they share a common test runner import pattern, not because they actually import the specific solution module","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-test-harness-shared-imports.json"},{"id":"repo-test-helpers-use-leetcode-serialization","text":"Test helpers like `_build(vals)` and `_to_list(root)` use BFS-based level-order serialization matching LeetCode's own tree encoding format, with `None` entries representing missing children.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-test-helpers-use-leetcode-serialization.json"},{"id":"repo-uses-bare-functions-not-class-wrappers","text":"Solutions in this repo export bare functions rather than wrapping them in LeetCode's `class Solution` pattern — a repo-wide convention.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-uses-bare-functions-not-class-wrappers.json"},{"id":"repo-uses-leetcode-camelcase-convention","text":"Solution functions use LeetCode's camelCase method signatures (e.g., `searchInsert`, `searchBST`) rather than PEP 8 snake_case, as a repo-wide convention.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-uses-leetcode-camelcase-convention.json"},{"id":"repo-uses-post-hoc-sorting","text":"Multiple solutions (index-pairs, intersection) collect results unordered and sort once at the end rather than maintaining sorted order during construction — separating membership/computation logic from ordering requirements.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-uses-post-hoc-sorting.json"},{"id":"repo-wide-method-name-mismatches","text":"Multiple solutions use incorrect or template-inherited method names (`valid_selections`, `minOperations`, `add_rooms`) that don't match the LeetCode canonical names, indicating a shared template without per-problem renaming.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/repo-wide-method-name-mismatches.json"},{"id":"reshape-no-input-mutation","text":"`matrixReshape` never modifies the input `mat`; the success path returns a freshly constructed list-of-lists, and the failure path returns the original object unchanged.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reshape-no-input-mutation.json"},{"id":"reshape-preserves-row-major-order","text":"Elements appear in the reshaped output in the same row-major order as the input, guaranteed by the `[val for row in mat for val in row]` iteration order.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reshape-preserves-row-major-order.json"},{"id":"reshape-returns-original-on-mismatch","text":"When `m*n != r*c`, `matrixReshape` returns the exact same `mat` object (identity, not a copy), so callers can use `is` to detect failure.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reshape-returns-original-on-mismatch.json"},{"id":"reshape-uses-flatten-then-slice","text":"`matrixReshape` uses the flatten→slice idiom: nested list comprehension to 1D, then `flat[i*c:(i+1)*c]` to partition into rows — same concept as `numpy.reshape` but with O(m·n) extra space for the intermediate list.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reshape-uses-flatten-then-slice.json"},{"id":"resource-optimization-coordinated-across-pipeline","text":"Resource optimization is coordinated across the two pipeline phases: the preprocessing phase minimizes space via in-place mutation of inputs, while the streaming phase minimizes time via O(1) scalar accumulators, so neither phase's optimization strategy compromises the other's.","truth_value":"OUT","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/resource-optimization-coordinated-across-pipeline.json"},{"id":"result-list-exact-invariant","text":"During `findRestaurant`'s scan, `result` always contains exactly the strings whose index sum equals the current `min_sum` — it is fully replaced on improvement and appended on tie, with no post-processing pass needed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/result-list-exact-invariant.json"},{"id":"reversal-equals-reorder","text":"Any permutation of an array is reachable via a sequence of subarray reversals, so `make-two-arrays-equal-by-reversing-subarrays/solution.py` correctly reduces the problem to multiset equality via `sorted(target) == sorted(arr)`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reversal-equals-reorder.json"},{"id":"reverse-alpha-scan-gives-max","text":"Iterating the alphabet from Z to A and returning on first dual-case match guarantees the lexicographically greatest result via early exit, without needing `max()`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-alpha-scan-gives-max.json"},{"id":"reverse-bits-accumulator-pattern","text":"`reverse_bits` builds its result LSB-first via `(result << 1) | (n & 1)`, extracting bits from `n` right-to-left and placing them left-to-right in the accumulator — no string conversion or array needed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-bits-accumulator-pattern.json"},{"id":"reverse-bits-fixed-32-iterations","text":"`reverse_bits` always iterates exactly 32 times regardless of input value — this is the key correctness invariant, since a `while n:` loop would silently drop leading zeros (e.g., `reverse_bits(1)` must return `2147483648`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-bits-fixed-32-iterations.json"},{"id":"reverse-bits-unsigned-only","text":"`reverse_bits` assumes non-negative input; Python's right-shift on negative integers sign-extends, which would produce incorrect results — but the problem guarantees unsigned 32-bit input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-bits-unsigned-only.json"},{"id":"reverse-list-tests-cover-both-implementations","text":"Every test case in `TestReverseList` runs against both `reverse_list` and `reverse_list_recursive` via the `_run_both` helper with `unittest.subTest`, ensuring behavioral equivalence with clear failure attribution.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-list-tests-cover-both-implementations.json"},{"id":"reverse-only-letters-method-name-mismatch","text":"The Reverse Only Letters solution (problem 917) has its method incorrectly named `num_rescue_boats` — a copy-paste artifact from a different problem. The implementation correctly solves problem 917 despite the name.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-only-letters-method-name-mismatch.json"},{"id":"reverse-str-ii-pure-function","text":"`reverseStr` returns a new string and does not mutate its input; it works on a `list(s)` copy internally and joins the result.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-str-ii-pure-function.json"},{"id":"reverse-str-ii-relies-on-slice-clamping","text":"`reverseStr` has no explicit bounds check for the final partial window — it relies on Python's slice clamping behavior (`chars[i:i+k]` naturally covers only remaining characters when fewer than `k` are left).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-str-ii-relies-on-slice-clamping.json"},{"id":"reverse-str-ii-stride-pattern","text":"`reverseStr` uses `range(0, len(chars), 2*k)` to step through windows, reversing only `chars[i:i+k]` — the second half of each window is left untouched implicitly by never selecting it.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-str-ii-stride-pattern.json"},{"id":"reverse-vowels-case-sensitive-set","text":"`reverseVowels` defines vowels as `set(\"aeiouAEIOU\")` — both cases explicitly listed — so mixed-case input is handled without normalization.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-vowels-case-sensitive-set.json"},{"id":"reverse-vowels-non-vowel-stability","text":"In `reverseVowels`, non-vowel characters are never moved; the pointer-advance logic guarantees a character is only swapped when both pointers point to vowels.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-vowels-non-vowel-stability.json"},{"id":"reverse-words-iii-preserves-word-order","text":"`reverse_words_in_string` reverses characters within each word but preserves word positions — split/reverse/join guarantees this structurally.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/reverse-words-iii-preserves-word-order.json"},{"id":"rgb-channels-independently-optimizable","text":"The similar-rgb-color solution processes each color channel independently because the squared-difference similarity metric is separable, reducing a search over 4096 shorthand colors to three independent 16-candidate lookups.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rgb-channels-independently-optimizable.json"},{"id":"right-to-left-in-place-expansion-pattern","text":"The two-pass right-to-left copy in duplicate-zeros is the same strategy used for merge-sorted-array and similar in-place expansion problems — it avoids O(n) shifting per insertion and O(n) extra space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/right-to-left-in-place-expansion-pattern.json"},{"id":"rightmost-odd-digit-determines-answer","text":"In `largest-odd-number-in-string/solution.py`, the largest odd substring is always the prefix `num[:k+1]` where `k` is the rightmost odd digit's index — this holds because no-leading-zeros guarantees longer prefixes are numerically larger","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rightmost-odd-digit-determines-answer.json"},{"id":"rings-stride-2-parsing","text":"`countPoints` parses the input string with `range(0, len(rings), 2)` stride-2 indexing, relying on the guaranteed alternating color-char/digit-char format rather than regex or explicit parsing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rings-stride-2-parsing.json"},{"id":"rod-completion-threshold-hardcoded","text":"The completion check in `countPoints` uses the literal `3`, coupling it to exactly the RGB color set; a fourth color would require changing this constant.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rod-completion-threshold-hardcoded.json"},{"id":"roman-subtraction-lookahead-pattern","text":"`roman_to_int` uses a left-to-right single-pass scan that subtracts `values[s[i]]` when it is less than `values[s[i+1]]`, correctly handling all six Roman subtraction pairs (IV, IX, XL, XC, CD, CM).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/roman-subtraction-lookahead-pattern.json"},{"id":"roman-values-dict-local-to-function","text":"The Roman numeral `values` lookup dict is defined inside `roman_to_int` (not at module level), so it is reconstructed on every call.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/roman-values-dict-local-to-function.json"},{"id":"rook-captures-max-four","text":"The return value is bounded [0, 4] because the rook probes exactly four cardinal directions with at most one capture each.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rook-captures-max-four.json"},{"id":"rook-captures-wrong-method-name","text":"`regionsBySlashes` is the wrong method name for LeetCode 999; it should be `numRookCaptures` — likely a copy-paste error that the LeetCode judge ignores.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rook-captures-wrong-method-name.json"},{"id":"rook-position-default-zero","text":"If no rook is present on the board, the code silently treats cell (0, 0) as the rook position rather than raising an error — a latent bug if input constraints are ever relaxed.","truth_value":"OUT","justification_count":0,"dependent_count":2,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rook-position-default-zero.json"},{"id":"root-equals-sum-treenode-also-widely-imported","text":"`TreeNode` from `root-equals-sum-of-children/solution.py` is imported by 400+ test files, creating a second widely-used canonical tree node definition alongside the one in `same-tree/solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/root-equals-sum-treenode-also-widely-imported.json"},{"id":"root-nonnull-precondition","text":"`averageOfLevels` assumes root is non-null; passing `None` raises `AttributeError` with no graceful handling.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/root-nonnull-precondition.json"},{"id":"rotate-string-doubling-trick","text":"`can_transform` checks rotation equivalence via `goal in s + s` — concatenating `s` with itself produces a string containing every rotation of `s` as a substring, reducing the problem to a single substring search.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rotate-string-doubling-trick.json"},{"id":"rotation-produces-new-matrix","text":"Each 90° rotation in the matrix rotation solution creates a new nested list via list comprehension; the caller's original matrix is never mutated.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rotation-produces-new-matrix.json"},{"id":"rounding-plus-one-is-load-bearing","text":"The `+1` before `//2` in the odd-subarray formula is necessary: when `(i+1)*(n-i)` is odd, there is exactly one more odd-length subarray than even-length, and omitting the `+1` undercounts","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rounding-plus-one-is-load-bearing.json"},{"id":"rstrip-suffix-safety","text":"`rstrip(\"stndrdth\")` never removes day digits because no digit character appears in the strip set `{s,t,n,d,r,h}`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/rstrip-suffix-safety.json"},{"id":"running-min-before-diff","text":"In the maximum-difference solution, `min_val` is updated after the difference check within each loop iteration, guaranteeing the minimum always originates from an index strictly less than `j`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/running-min-before-diff.json"},{"id":"running-minimum-pattern-recurs","text":"The running-minimum single-pass pattern (track smallest-so-far, compute difference against current element) is used across multiple solutions including buy/sell stock and maximum-difference-between-increasing-elements, with only the sentinel return value differing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/running-minimum-pattern-recurs.json"},{"id":"running-sum-mutates-input","text":"`runningSum` modifies and returns the input list in-place via forward accumulation rather than allocating a new list; callers lose the original data.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/running-sum-mutates-input.json"},{"id":"running-sum-prefix-suffix-pattern","text":"Prefix-suffix sum problems use a single-pass running accumulator with the identity `rightSum = total - leftSum - current` to avoid building separate prefix and suffix arrays.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/running-sum-prefix-suffix-pattern.json"},{"id":"same-tree-treenode-is-canonical-import","text":"`TreeNode` from `same-tree/solution.py` is imported by 300+ test files across the repo, making it the de facto shared tree node definition despite being defined inside a single problem's solution.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/same-tree-treenode-is-canonical-import.json"},{"id":"scatter-write-for-permutation-rearrangement","text":"The shuffle-string solution uses a scatter-write pattern (pre-allocate result array, write each element directly to its target index) for O(n) permutation-based rearrangement, rather than sorting or in-place mutation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/scatter-write-for-permutation-rearrangement.json"},{"id":"search-insert-equivalent-to-bisect-left","text":"`searchInsert(nums, target)` produces the same result as `bisect.bisect_left(nums, target)` for sorted distinct-integer lists — it is the canonical lower-bound binary search.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/search-insert-equivalent-to-bisect-left.json"},{"id":"search-insert-left-converges-to-insertion-point","text":"When `target` is absent, `searchInsert` returns `left`, which equals the count of elements strictly less than `target` — no post-loop adjustment needed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/search-insert-left-converges-to-insertion-point.json"},{"id":"search-starts-at-isqrt","text":"`constructRectangle` begins its width search at `math.isqrt(area)` and decrements, guaranteeing the first divisor found is the largest factor ≤ sqrt(area), which yields the minimum `L - W`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/search-starts-at-isqrt.json"},{"id":"searchbst-assumes-valid-bst","text":"`searchBST` never validates BST ordering; it silently returns wrong results if the input tree violates the BST invariant.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/searchbst-assumes-valid-bst.json"},{"id":"searchbst-iterative-o1-space","text":"`searchBST` uses O(1) auxiliary space via iterative `while` loop traversal — no recursion, no stack, no queue.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/searchbst-iterative-o1-space.json"},{"id":"searchbst-returns-subtree-by-reference","text":"`searchBST` returns the original `TreeNode` from the tree, not a copy; the caller receives the entire subtree rooted at that node via Python's object reference semantics.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/searchbst-returns-subtree-by-reference.json"},{"id":"second-highest-constant-time-digit-ops","text":"`second_highest` collects digits into a set bounded at 10 elements (digits 0–9), so all set and `max()` operations are O(1) regardless of input string length.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/second-highest-constant-time-digit-ops.json"},{"id":"second-minimum-prune-on-greater-value","text":"In `find_second_minimum_value`, when `node.val > min_val`, the subtree is pruned because the tree's parent-equals-min-of-children invariant guarantees no descendant can have a value between `min_val` and `node.val`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/second-minimum-prune-on-greater-value.json"},{"id":"second-minimum-root-is-global-min","text":"In the special binary tree for LeetCode 671, `root.val` is always the global minimum due to the structural invariant that every parent's value equals the minimum of its children.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/second-minimum-root-is-global-min.json"},{"id":"seen-set-checks-before-insert","text":"The standard duplicate-detection idiom checks `if x in seen` before `seen.add(x)`, preventing an element from matching itself — used in sliding-window and two-sum family problems throughout the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/seen-set-checks-before-insert.json"},{"id":"seen-set-insert-after-check","text":"In `count_arithmetic_triplets`, each element is added to `seen` after the triplet membership check, maintaining the invariant that only previously-visited elements are lookup candidates","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/seen-set-insert-after-check.json"},{"id":"seen-set-monotonic","text":"The `seen` vowel set within each inner loop iteration is monotonically non-decreasing; once all 5 vowels are found, every further vowel-only extension also increments the count","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/seen-set-monotonic.json"},{"id":"segments-strict-comparison","text":"`checkZeroOnes` uses strict `>` comparison, so equal-length runs of `'1'`s and `'0'`s return `False`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/segments-strict-comparison.json"},{"id":"selective-condition-checking-not-absent","text":"Solutions check conditions that enable optimization (early-exit on domain invariants, short-circuit on first violation) but deliberately skip conditions that guard against invalid input (no bounds checks, no type checks), demonstrating selective rather than absent runtime checking — the discipline is in choosing which conditions matter.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/selective-condition-checking-not-absent.json"},{"id":"selective-defense-explained-by-judge-boundary","text":"The selective-defense pattern (invest in efficiency-improving conditions like early exit and short-circuit, skip robustness-improving conditions like input validation) is precisely explained by the judge's evaluation boundary: solutions invest in conditions whose payoff is measurable (early exit improves runtime, which the judge times) and skip conditions whose payoff is invisible (validation guards against inputs the judge never sends).","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/selective-defense-explained-by-judge-boundary.json"},{"id":"selective-defense-replaces-universal-validation","text":"Solutions employ selective defense rather than universal validation: they invest in conditions that improve efficiency (early exit, short-circuit) and defaults that encode domain knowledge (Counter zero-default, sentinel initialization), while deliberately omitting input validation — defense serves optimization, not safety.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/selective-defense-replaces-universal-validation.json"},{"id":"self-contained-solution-test-files","text":"Each problem directory contains a single `solution.py` that co-locates the algorithm implementation and its `unittest` test class, runnable standalone or via a test runner — this is the repo-wide convention.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/self-contained-solution-test-files.json"},{"id":"self-contained-solution-with-local-treenode","text":"Each tree problem defines its own `TreeNode` class locally rather than importing from a shared module, making each problem directory independently runnable","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/self-contained-solution-with-local-treenode.json"},{"id":"self-dividing-tests-original-not-truncated","text":"`is_self_dividing` checks `n % digit` against the original input `n`, not the progressively truncated `num` used for digit extraction — using `num` would test a shrinking value and produce wrong results.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/self-dividing-tests-original-not-truncated.json"},{"id":"self-dividing-zero-guard-before-modulo","text":"`is_self_dividing` checks `digit == 0` before `n % digit`, preventing division-by-zero at the logic level rather than via exception handling.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/self-dividing-zero-guard-before-modulo.json"},{"id":"sentence-similarity-identity-implicit","text":"Word identity (`w1 == w2`) is handled by a direct equality check, not by requiring self-pairs in `similarPairs` — a word is always similar to itself.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sentence-similarity-identity-implicit.json"},{"id":"sentence-similarity-no-transitivity","text":"`areSentencesSimilar` treats similarity as non-transitive: `a~b` and `b~c` does not imply `a~c`, enforced by the problem contract and verified by a dedicated test case.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sentence-similarity-no-transitivity.json"},{"id":"sentence-similarity-symmetry-by-construction","text":"Symmetry is guaranteed by inserting both `(x,y)` and `(y,x)` into the lookup set during preprocessing, rather than checking both orderings at query time.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sentence-similarity-symmetry-by-construction.json"},{"id":"sentence-similarity-time-complexity","text":"The algorithm runs in O(N + P) time where N is sentence length and P is the number of similar pairs, achieved by converting the pair list to a set of tuples for O(1) membership tests.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sentence-similarity-time-complexity.json"},{"id":"sentinel-as-found-flag","text":"Solutions use sentinel values (e.g., initializing `result = n` where max valid answer is `n // 2`) to double as both accumulator and \"not found\" indicator, avoiding a separate boolean flag.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sentinel-as-found-flag.json"},{"id":"sentinel-boundary-flush","text":"The loop iterates to `len(s) + 1` (one past the last index) so the final character group is flushed without duplicating the emit logic after the loop — a pattern reused across run-length solutions in this repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sentinel-boundary-flush.json"},{"id":"sentinel-defaults-safe-under-constraints","text":"Sentinel initial values (-1, 0, None) never collide with valid data because LeetCode's input constraints guarantee the sentinel falls outside the problem's value domain, making sentinel-based boundary elimination unconditionally safe within the stated contract.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/sentinel-defaults-safe-under-constraints.json"},{"id":"sentinel-initialization-encodes-boundary-conditions","text":"Sentinel initial values (-1, 0, None, specific constants) are used to encode boundary conditions directly into loop initializers, eliminating first-iteration special-case branches and keeping loop bodies uniform.","truth_value":"IN","justification_count":1,"dependent_count":4,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/sentinel-initialization-encodes-boundary-conditions.json"},{"id":"sentinel-prev-initialization","text":"In `checkZeroOnes`, initializing `prev = \"\"` ensures the first character always starts a fresh run without requiring a conditional before the loop","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sentinel-prev-initialization.json"},{"id":"sentinel-return-values-match-leetcode-spec","text":"Solutions use problem-specific sentinel values for \"no answer\" cases (`0` for largest-perimeter-triangle, `-1` for find_K and maxLengthBetweenEqualCharacters) matching each problem's LeetCode specification rather than using Python idioms like `None`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sentinel-return-values-match-leetcode-spec.json"},{"id":"sentinel-values-bootstrap-streaming-state","text":"Sentinel initial values (-1, 0, None) bootstrap the O(1)-space running accumulators that power single-pass streaming, encoding boundary conditions directly into loop initializers so the first iteration executes the same code path as all subsequent iterations.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/sentinel-values-bootstrap-streaming-state.json"},{"id":"separate-digits-single-pass-eager","text":"`separate_digits` materializes the full result via a list comprehension in a single O(total_digits) pass — it is eager, not lazy.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/separate-digits-single-pass-eager.json"},{"id":"set-based-pangram-check","text":"The pangram solution uses `len(set(sentence)) == 26` as both necessary and sufficient, which is correct only under the invariant that input contains exclusively lowercase a–z characters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/set-based-pangram-check.json"},{"id":"set-cardinality-uniqueness-idiom","text":"The `len(set(...)) == 1` idiom is used to check whether all elements share a single value (e.g., all letters on one keyboard row) and recurs across multiple solutions in this repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/set-cardinality-uniqueness-idiom.json"},{"id":"set-complement-lookup-pattern","text":"The `find_K` solution and related problems (Two Sum family) use a set-complement idiom: build a set for O(1) membership, then iterate checking for a complementary value — a recurring O(n) pattern across the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/set-complement-lookup-pattern.json"},{"id":"set-conversion-before-loop-for-o1-lookup","text":"`greatest-english-letter` converts the input string to a set before the scan loop, turning each membership check from O(n) to O(1).","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/set-conversion-before-loop-for-o1-lookup.json"},{"id":"set-early-return-first-duplicate","text":"The first-letter-to-appear-twice solution returns on the first duplicate encountered during left-to-right iteration, guaranteeing the result is the letter whose second occurrence index is minimal.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/set-early-return-first-duplicate.json"},{"id":"set-for-o1-membership-universal","text":"Set conversion before scanning loops is a standard repo-wide pattern for upgrading membership/dedup operations from O(n) to O(1) per check.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/set-for-o1-membership-universal.json"},{"id":"set-lookup-guarantees-linear-preprocessing","text":"`find_final_value` builds a set from `nums` in O(n), then performs O(1) membership checks per iteration, making total complexity O(n + log(max(nums))).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/set-lookup-guarantees-linear-preprocessing.json"},{"id":"set-membership-over-trial-division","text":"Primality in `is_prime` is checked via O(1) set lookup rather than computed via trial division, because the domain is bounded (0–20) by the problem's input constraint of at most `10^6 < 2^20`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/set-membership-over-trial-division.json"},{"id":"set-membership-testing-pattern","text":"Multiple solutions (jewels-and-stones, keep-multiplying-found-values-by-two) use the same idiom: convert an input collection to a `set` for O(1) amortized membership testing before iterating over another collection. This is the repo's standard approach for membership-check problems.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/set-membership-testing-pattern.json"},{"id":"set-mismatch-gauss-sum-for-missing","text":"The solution finds the duplicate via set-based detection, then derives the missing number algebraically using the Gauss sum formula `n*(n+1)//2` rather than searching for it — a pattern shared with `missing-number` and similar 1-to-n range problems.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/set-mismatch-gauss-sum-for-missing.json"},{"id":"set-mismatch-return-order","text":"`findErrorNums` returns `[duplicate, missing]`, matching the LeetCode 645 contract — the duplicate is always first.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/set-mismatch-return-order.json"},{"id":"shared-linked-list-infra","text":"`ListNode`, `to_list`, and `from_list` from `merge-two-sorted-lists/solution.py` are imported by 400+ test files across the repo as de-facto shared linked-list infrastructure.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/shared-linked-list-infra.json"},{"id":"shift-grid-flatten-rotate-reshape","text":"The 2D grid shift is implemented by flattening to 1D, rotating via Python slice (`flat[-k:] + flat[:-k]`), and reshaping back — the canonical idiom for cyclic 2D shifts that avoids manual index arithmetic.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/shift-grid-flatten-rotate-reshape.json"},{"id":"shift-grid-k-mod-optimization","text":"`k` is reduced modulo `m*n` before any list operations, making runtime independent of `k`'s magnitude — standard for cyclic operations in this repo.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/shift-grid-k-mod-optimization.json"},{"id":"shift-grid-zero-shift-aliases-input","text":"When `k % total == 0`, `shiftGrid` returns the original grid object (not a copy), meaning mutations to the return value alias the input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/shift-grid-zero-shift-aliases-input.json"},{"id":"shoelace-orientation-independent","text":"The `abs()` call in the Shoelace formula makes the triangle area computation independent of vertex winding order (clockwise vs counterclockwise).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/shoelace-orientation-independent.json"},{"id":"shoelace-returns-zero-for-collinear","text":"The Shoelace formula produces area 0 exactly when three points are collinear, so `largestTriangleArea` handles degenerate triangles implicitly without a separate collinearity check.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/shoelace-returns-zero-for-collinear.json"},{"id":"short-circuit-left-before-right","text":"`getTargetCopy` checks the left subtree result before recursing right; if the target is found left, the right subtree is never visited.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/short-circuit-left-before-right.json"},{"id":"short-string-returns-zero-naturally","text":"Strings shorter than 3 characters produce an empty `range(len(s) - 2)`, so `countGoodSubstrings` returns 0 without any special-case code","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/short-string-returns-zero-naturally.json"},{"id":"shortest-completing-word-tie-breaking","text":"When multiple words have the same minimal length, the one appearing earliest in `words` is returned, enforced by strict `<` comparison (not `<=`) in the linear scan.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/shortest-completing-word-tie-breaking.json"},{"id":"shorthand-hex-values-are-multiples-of-17","text":"All shorthand hex color components (`00`, `11`, `22`, ..., `ff`) are exactly the multiples of 17 from 0 to 255, making nearest-shorthand a `round(val/17)*17` problem rather than a brute-force search.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/shorthand-hex-values-are-multiples-of-17.json"},{"id":"shuffle-array-offset-indexing-over-slicing","text":"`shuffle-the-array/solution.py` uses offset indexing (`nums[i]` and `nums[n + i]`) in a single loop rather than slicing into two halves and zipping, avoiding intermediate list allocations.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/shuffle-array-offset-indexing-over-slicing.json"},{"id":"shuffle-string-assumes-valid-permutation","text":"`shuffle-string/solution.py` assumes `indices` is a valid permutation of `[0, len(s))` — duplicate indices silently overwrite, out-of-range indices raise `IndexError`, and no validation is performed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/shuffle-string-assumes-valid-permutation.json"},{"id":"shuffle-string-wrong-method-name","text":"`shuffle-string/solution.py` has method named `kids_with_candies` but implements LeetCode 1528 (Shuffle String) — a copy-paste naming bug from the code generation pipeline.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/shuffle-string-wrong-method-name.json"},{"id":"sign-func-zero-short-circuit","text":"`signFunc` returns `0` immediately upon encountering any zero element, skipping remaining iteration — both a correctness guarantee (zero dominates the product) and a minor performance optimization.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sign-func-zero-short-circuit.json"},{"id":"sign-product-via-parity-counting","text":"`signFunc` determines the sign of a product by counting negative elements (even count → positive, odd → negative) and short-circuiting on zero, never computing the actual product — avoiding overflow entirely.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sign-product-via-parity-counting.json"},{"id":"similar-rgb-inline-tests","text":"`similar-rgb-color/solution.py` contains inline unit tests alongside the solution (importing `unittest`), unlike most solutions which keep tests in a separate `test_solution.py` file.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/similar-rgb-inline-tests.json"},{"id":"simulation-elimination-via-preprocessing","text":"Both sort preprocessing and Counter-based frequency counting serve as simulation eliminators: sort replaces iterative simulation by establishing structural invariants that make outcomes directly readable, while Counter collapses position-dependent queue simulation to position-independent frequency analysis — two complementary preprocessing strategies achieving the same elimination goal.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/simulation-elimination-via-preprocessing.json"},{"id":"simulation-preferred-over-closed-form","text":"Solutions favor direct simulation loops over equivalent closed-form or bit-manipulation formulas — e.g., steps-to-zero uses a while loop instead of `bit_length + popcount - 1`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/simulation-preferred-over-closed-form.json"},{"id":"simulation-to-formula-pattern","text":"Multiple solutions (e.g., `time_to_buy_tickets`) replace explicit round-by-round simulation with per-element contribution formulas, reducing time complexity from O(n·k) to O(n) by reasoning about how many rounds each element participates in.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/simulation-to-formula-pattern.json"},{"id":"single-file-solution-test-layout","text":"Every problem directory uses the same structure: `solution.py` contains both the solution function and inline `unittest` tests, runnable standalone via `python -m unittest` or `if __name__ == \"__main__\"`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/single-file-solution-test-layout.json"},{"id":"single-file-solution-test-pattern","text":"Some problem directories combine the solution and test suite in a single `solution.py` file (e.g., `maximum-number-of-words-you-can-type`, `maximum-product-of-three-numbers`), diverging from the standard separate-file layout.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/single-file-solution-test-pattern.json"},{"id":"single-loop-computes-row-and-column-max","text":"The `grid[j][i]` index swap in `projectionArea` computes column maximums alongside row maximums in a single nested loop, avoiding a second O(n²) pass for the side projection","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/single-loop-computes-row-and-column-max.json"},{"id":"single-pass-accumulation-pattern","text":"Multiple solutions prefer single-pass accumulation (tracking running totals/counts) over multi-step approaches like filter-then-compute, achieving O(1) auxiliary space as a recurring design choice.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/single-pass-accumulation-pattern.json"},{"id":"single-pass-dual-max-tracking","text":"`checkZeroOnes` computes both `max_ones` and `max_zeros` in a single O(n) pass with O(1) space, updating the relevant max on every character rather than only at run boundaries","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/single-pass-dual-max-tracking.json"},{"id":"single-pass-max-tracking-idiom","text":"The repo prefers single-pass algorithms with running accumulators over multi-pass approaches that materialize intermediate lists, as seen in rectangle counting (O(n) with running max+count) and line writing (O(n) greedy scan)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/single-pass-max-tracking-idiom.json"},{"id":"single-pass-no-length","text":"`middle_of_the_linked_list` finds the middle in exactly one pass (n/2 iterations) without computing the list's length, using the slow/fast pointer technique.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/single-pass-no-length.json"},{"id":"single-pass-streaming-dominant-shape","text":"The dominant algorithmic shape is single-pass streaming: a left-to-right scan maintaining O(1) scalar accumulators, extending or resetting counters at each step, and exiting early when possible — producing O(n) time with O(1) space.","truth_value":"IN","justification_count":1,"dependent_count":12,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/single-pass-streaming-dominant-shape.json"},{"id":"single-row-keyboard-finger-starts-at-zero","text":"The finger always starts at index 0 of the keyboard string, and `current` tracks the most recently typed character's position throughout the loop","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/single-row-keyboard-finger-starts-at-zero.json"},{"id":"single-row-keyboard-no-validation","text":"`calculate_time` assumes all characters in `word` exist in `keyboard`; a missing character raises an unhandled `KeyError`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/single-row-keyboard-no-validation.json"},{"id":"single-row-keyboard-precomputed-index-map","text":"`calculate_time` builds a `{char: index}` dictionary from the keyboard string in O(26) time, enabling O(1) lookups per character instead of O(26) `str.index()` calls","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/single-row-keyboard-precomputed-index-map.json"},{"id":"skip-counter-non-negative","text":"The `skip` variable in `_next_valid` is never decremented below zero; the `elif skip > 0` guard ensures decrements only occur when there are pending backspaces to consume.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/skip-counter-non-negative.json"},{"id":"sliding-window-o1-update-pattern","text":"`min_operations` (recolors) updates the window count in O(1) per step by adding the incoming element and removing the outgoing one, using Python's `bool`-to-`int` coercion (`True == 1`, `False == 0`) in a single arithmetic expression.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sliding-window-o1-update-pattern.json"},{"id":"slow-fast-second-middle","text":"For even-length lists, `middle_of_the_linked_list` returns the second middle node because the while condition checks `fast` before `fast.next`, causing `fast` to overshoot to `None`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/slow-fast-second-middle.json"},{"id":"slowest-key-first-duration-from-zero","text":"The first keypress duration is `releaseTimes[0]` (measured from time 0), handled by initializing `best_dur` before the loop rather than with a special case inside it","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/slowest-key-first-duration-from-zero.json"},{"id":"slowest-key-misleading-function-name","text":"The function is named `minInteger` (suggesting a numeric result) but actually returns the key character with the longest press duration — a naming artifact from LeetCode's class template","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/slowest-key-misleading-function-name.json"},{"id":"slowest-key-tiebreak-lexicographic-largest","text":"When multiple keys share the maximum press duration, `minInteger` returns the lexicographically largest key, using Python's native character comparison","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/slowest-key-tiebreak-lexicographic-largest.json"},{"id":"smaller-numbers-constant-space","text":"Memory usage beyond the output is O(101) = O(1) regardless of input size, due to the fixed value range constraint of [0,100].","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/smaller-numbers-constant-space.json"},{"id":"smaller-numbers-counting-sort-approach","text":"`smallerNumbersThanCurrent` uses counting sort + prefix sum over the fixed value range [0,100] to achieve O(n+k) time, avoiding the naive O(n²) pairwise comparison.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/smaller-numbers-counting-sort-approach.json"},{"id":"smaller-numbers-duplicate-handling","text":"Elements with the same value always receive the same count because they index into the same `prefix` slot — duplicates are handled correctly without special-casing.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/smaller-numbers-duplicate-handling.json"},{"id":"smaller-numbers-prefix-sum-correctness","text":"`prefix[v]` equals exactly the count of elements in `nums` with value strictly less than `v`, computed as the cumulative sum of `count[0..v-1]`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/smaller-numbers-prefix-sum-correctness.json"},{"id":"smallest-index-early-return-guarantees-first","text":"`smallest_index` returns the leftmost matching index because it iterates left-to-right with `enumerate` and returns immediately on the first hit","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/smallest-index-early-return-guarantees-first.json"},{"id":"smallest-index-sentinel-negative-one","text":"`smallest_index` returns `-1` (not `None` or an exception) when no index satisfies `i % 10 == nums[i]`, matching LeetCode's expected return contract","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/smallest-index-sentinel-negative-one.json"},{"id":"smallest-multiple-parity-shortcut","text":"The LCM of `n` and 2 is computed as a parity check (`n if n % 2 == 0 else n * 2`) rather than using `math.gcd`, because 2 is prime so `gcd(n, 2)` is always 1 or 2","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/smallest-multiple-parity-shortcut.json"},{"id":"smallest-multiple-rejects-floats","text":"`smallest_multiple(6.0)` raises `ValueError` because the `isinstance(n, int)` check excludes float types even when mathematically equivalent","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/smallest-multiple-rejects-floats.json"},{"id":"smallest-multiple-validates-input","text":"`smallest_multiple` checks `isinstance(n, int)` and range bounds `[1, 150]`, raising `ValueError` on failure — an exception to the repo-wide pattern of trusting LeetCode input guarantees","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/smallest-multiple-validates-input.json"},{"id":"smallest-range-i-closed-form","text":"The minimum score equals `max(0, max(nums) - min(nums) - 2*k)` — the optimal strategy pushes the min up by `k` and the max down by `k`, collapsing to zero if `2k` exceeds the original spread","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/smallest-range-i-closed-form.json"},{"id":"smallest-range-i-no-mutation","text":"`smallestRangeI` never modifies the input array; the answer is computed purely from `max(nums)`, `min(nums)`, and `k`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/smallest-range-i-no-mutation.json"},{"id":"solution-alias-convention","text":"Every solution module exposes a module-level snake_case callable (function or lambda) that wraps `Solution().methodName`, providing a uniform import interface for the test harness.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-alias-convention.json"},{"id":"solution-and-tests-colocated","text":"Every problem directory's `solution.py` contains both the `Solution` class and a `unittest.TestCase` subclass, runnable via `python -m unittest` or `if __name__ == \"__main__\"`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-and-tests-colocated.json"},{"id":"solution-class-camelcase-convention","text":"Solutions follow LeetCode's expected interface: a `Solution` class with a camelCase method name matching the problem's canonical signature (e.g., `removeVowels`, `replaceDigits`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-class-camelcase-convention.json"},{"id":"solution-class-convention","text":"Every solution in the repo follows the `class Solution` pattern with a single method matching the LeetCode function signature, except standalone-function solutions like `tax_amount` and `findTilt`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-class-convention.json"},{"id":"solution-class-no-init","text":"`Solution` classes have no `__init__` method, matching LeetCode's expected interface where the judge instantiates `Solution()` and calls the method directly.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-class-no-init.json"},{"id":"solution-class-stateless-convention","text":"`Solution` classes in this repo carry no instance state — methods are pure functions that could equivalently be standalone functions; the class wrapper exists solely to satisfy LeetCode's interface expectation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-class-stateless-convention.json"},{"id":"solution-class-style-inconsistent","text":"Some solutions use a `Solution` class (x-of-a-kind, XOR operation) while others use bare module-level functions (water bottles, alien dictionary, minimum training) — no consistent convention across the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-class-style-inconsistent.json"},{"id":"solution-class-vs-module-function-inconsistency","text":"Some solutions (e.g., binary-search) wrap logic in a `Solution` class matching LeetCode's interface, while others (e.g., binary-tree-inorder-traversal) expose module-level functions — the repo is inconsistent on this convention.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-class-vs-module-function-inconsistency.json"},{"id":"solution-class-vs-standalone-function","text":"Solutions use two module patterns inconsistently: some define a standalone function (e.g., `max_product`, `max_score_after_splitting`), while others wrap the function in a `Solution` class following LeetCode's submission convention (e.g., `maximum-value-of-a-string-in-an-array`).","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-class-vs-standalone-function.json"},{"id":"solution-class-wraps-single-method","text":"Every solution file exposes a `Solution` class with exactly one public method matching the LeetCode interface; no standalone functions at module level.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-class-wraps-single-method.json"},{"id":"solution-files-self-contain-treenode","text":"Each tree problem redefines `TreeNode` (or `Node`) locally rather than importing from a shared module, so every solution is independently runnable.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-files-self-contain-treenode.json"},{"id":"solution-is-single-call","text":"`Solution.read` (LC #157) has no instance-level carryover buffer; leftover bytes from the last `read4` call are lost if `read` is called again, distinguishing it from LC #158's multi-call variant.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-is-single-call.json"},{"id":"solution-module-level-alias-convention","text":"Every solution file instantiates `Solution()` and binds the target method to a top-level name so the test harness can import it uniformly without knowing the class API.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-module-level-alias-convention.json"},{"id":"solution-per-directory-structure","text":"Each LeetCode problem lives in its own directory containing at minimum `solution.py` and `test_solution.py`, with optional `review.md` and `plan.md` files.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-per-directory-structure.json"},{"id":"solution-read-never-exceeds-n","text":"`Solution.read` places at most `n` characters into `buf`, enforced by `min(count, n - total)` on every copy iteration — the key correctness guard.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-read-never-exceeds-n.json"},{"id":"solution-reduction-forms-complete-hierarchy","text":"The solution space admits a complete three-tier reduction hierarchy under the elimination principle: mathematical reduction eliminates iteration entirely (O(1) closed-form), raw streaming eliminates preprocessing (O(n) single-pass), and pipeline variants eliminate brute-force pairing (O(n log n) preprocessing + O(n) scan) — each tier eliminates a structural requirement of the tier below.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/solution-reduction-forms-complete-hierarchy.json"},{"id":"solution-resets-state-per-call","text":"`minDiffInBST` sets `self.prev = None` and `self.min_diff = inf` at the top of every call, making `Solution` instances safe to reuse across multiple invocations.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-resets-state-per-call.json"},{"id":"solution-test-colocated-convention","text":"Each problem directory contains `solution.py`, `test_solution.py`, `plan.md`, and `review.md` as the standard per-problem layout.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-test-colocated-convention.json"},{"id":"solution-test-colocation-convention","text":"Each problem directory contains a `solution.py` with both the `Solution` class and a `unittest.TestCase` subclass, runnable standalone via a `__main__` guard.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solution-test-colocation-convention.json"},{"id":"solutions-are-pure-functions","text":"Solution methods are pure — no state mutation, no side effects, same inputs always produce the same output. The `Solution` class carries no instance state.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-are-pure-functions.json"},{"id":"solutions-are-pure-no-mutation","text":"Solutions in this repo (including `minOperations`, `makeTwoArraysEqualByReversingSubarrays`, and `majority_element`) do not mutate their input arguments; they use non-mutating operations like `sorted()`, `set()`, and scalar variables.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-are-pure-no-mutation.json"},{"id":"solutions-are-self-contained-modules","text":"Each solution file is self-contained with no cross-solution imports; solutions never depend on other solutions, and most use only stdlib or no imports at all.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-are-self-contained-modules.json"},{"id":"solutions-are-self-contained-no-imports","text":"Multiple solutions (`reshape-the-matrix`, `reverse-bits`, `reverse-only-letters`, `reverse-string-ii`) use zero imports and rely solely on Python builtins — this is a recurring pattern across the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-are-self-contained-no-imports.json"},{"id":"solutions-are-self-contained-no-shared-imports","text":"Solution files define all needed data structures locally (e.g., `TreeNode`) rather than importing from a shared utility module — every problem directory is independent.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-are-self-contained-no-shared-imports.json"},{"id":"solutions-are-zero-dependency","text":"Multiple solution modules (number-of-1-bits, arithmetic-triplets, days-in-a-month) have zero imports; even when imports exist (common-factors uses `math.gcd`), they are limited to the standard library — no external packages anywhere","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-are-zero-dependency.json"},{"id":"solutions-assume-leetcode-input-constraints","text":"Solutions perform no input validation or error handling; they trust callers to provide inputs satisfying LeetCode's stated constraints — invalid input produces silent wrong results rather than exceptions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-assume-leetcode-input-constraints.json"},{"id":"solutions-assume-valid-input","text":"Solutions omit input validation (empty lists, type checks, bounds) and rely on LeetCode problem constraints guaranteeing valid input.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-assume-valid-input.json"},{"id":"solutions-assume-valid-input-no-validation","text":"All five solutions examined perform zero input validation — they trust LeetCode's guarantees on input format, size, and value ranges, and will silently produce wrong results or raise exceptions on out-of-contract inputs","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-assume-valid-input-no-validation.json"},{"id":"solutions-bundle-tests-inline","text":"Every solution file contains both the implementation and a `unittest.TestCase` in the same file, runnable via `python solution.py`, with a separate `test_solution.py` for external test harness integration.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-bundle-tests-inline.json"},{"id":"solutions-embed-inline-tests","text":"Solution files include their own `unittest.TestCase` subclass with test methods, runnable via `python solution.py`, in addition to a separate `test_solution.py` for the project harness.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-embed-inline-tests.json"},{"id":"solutions-inconsistent-input-mutation","text":"There is no repo-wide convention on input mutation: some solutions mutate in-place for space efficiency (array-partition, assign-cookies) while others defensively copy (array-transformation); callers must check each solution individually.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-inconsistent-input-mutation.json"},{"id":"solutions-minimal-imports","text":"Solutions use zero imports or only Python standard library modules (`math`, `unittest`); no third-party dependencies appear in any solution file.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-minimal-imports.json"},{"id":"solutions-never-validate-input","text":"Solutions uniformly omit input validation, trusting callers to satisfy LeetCode constraints. This is intentional for competitive-programming code but means functions can silently produce wrong results on out-of-contract inputs (e.g., negative values, empty lists, empty strings).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-never-validate-input.json"},{"id":"solutions-no-external-dependencies","text":"All solution files use only Python builtins and stdlib — no third-party packages are imported anywhere in the solution code.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-no-external-dependencies.json"},{"id":"solutions-no-input-validation","text":"Solutions uniformly skip input validation and error handling, relying entirely on LeetCode's guaranteed constraints; invalid inputs propagate as unhandled exceptions from stdlib calls.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-no-input-validation.json"},{"id":"solutions-nonmutating-when-copying","text":"Solutions that transform arrays (e.g., `performOps`) create a shallow copy with `nums[:]` before modification, leaving the caller's input unchanged.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-nonmutating-when-copying.json"},{"id":"solutions-prefer-math-over-simulation","text":"When a closed-form or O(1) mathematical reduction exists, solutions use it instead of simulating the described operation (e.g., digital root formula instead of iterative digit summing, modular arithmetic instead of double-reversal).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-prefer-math-over-simulation.json"},{"id":"solutions-return-new-collections-not-in-place","text":"Array-rearrangement solutions (shuffle-the-array, shuffle-string) allocate and return new lists rather than mutating input arrays, even when in-place solutions exist.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-return-new-collections-not-in-place.json"},{"id":"solutions-self-contained-no-internal-deps","text":"Solution files have no project-internal imports; they depend only on stdlib modules (`typing`, `unittest`) or nothing at all.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-self-contained-no-internal-deps.json"},{"id":"solutions-skip-input-validation","text":"Solutions universally omit input validation (length checks, type checks, null guards), relying entirely on LeetCode's guaranteed constraints for correctness.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-skip-input-validation.json"},{"id":"solutions-trust-input-no-validation","text":"Solution functions assume valid input per LeetCode problem constraints and perform no input validation; invalid inputs propagate raw Python exceptions (`KeyError`, `AttributeError`, `TypeError`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-trust-input-no-validation.json"},{"id":"solutions-trust-inputs-no-validation","text":"Solutions perform no input validation and trust callers to satisfy LeetCode constraints — out-of-spec inputs produce wrong results or raw Python exceptions rather than meaningful errors","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-trust-inputs-no-validation.json"},{"id":"solutions-trust-leetcode-constraints","text":"All solution functions assume valid input per the LeetCode problem constraints and perform no input validation — no type checks, no bounds guards, no try/except. Invalid inputs produce undefined behavior (typically `ValueError`, `IndexError`, or infinite loops) rather than informative errors.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-trust-leetcode-constraints.json"},{"id":"solutions-trust-leetcode-input-constraints","text":"All solution files assume valid input per LeetCode problem constraints and perform zero input validation — no type checks, no range guards, no empty-input handling.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-trust-leetcode-input-constraints.json"},{"id":"solutions-trust-leetcode-input-contract","text":"Solutions across the repo perform no input validation — they trust that inputs satisfy LeetCode's stated constraints. Invalid inputs (wrong types, empty when guaranteed non-empty, malformed strings) produce undefined behavior rather than meaningful errors.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-trust-leetcode-input-contract.json"},{"id":"solutions-trust-leetcode-input-contracts","text":"Solutions perform no input validation or exception handling — they rely on LeetCode's guaranteed input constraints, making invalid-input behavior undefined.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-trust-leetcode-input-contracts.json"},{"id":"solutions-trust-leetcode-preconditions","text":"Solutions across this repo do not validate inputs against problem constraints — they trust the caller to satisfy LeetCode guarantees (non-empty arrays, valid ranges, majority existence). Invalid inputs produce silent wrong answers rather than exceptions.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-trust-leetcode-preconditions.json"},{"id":"solutions-use-bare-functions","text":"The repo convention is a bare top-level function (e.g., `postorder(root)`, `moveZeroes(nums)`) rather than wrapping in LeetCode's `class Solution`, making functions directly importable by test files.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-use-bare-functions.json"},{"id":"solutions-use-both-class-and-function-styles","text":"Some solutions wrap the algorithm in a `Solution` class (e.g., `construct2DArray`), while others use bare module-level functions (e.g., `no_zero_integers`, `to_hex`); both patterns coexist in the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-use-both-class-and-function-styles.json"},{"id":"solutions-use-no-external-dependencies","text":"Solution files use only Python builtins and standard library modules (e.g., `unittest`, `typing`); no third-party packages are imported.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-use-no-external-dependencies.json"},{"id":"solutions-use-only-stdlib-or-builtins","text":"Solution files import at most `unittest` from the standard library; no external dependencies are used across any of the examined solutions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/solutions-use-only-stdlib-or-builtins.json"},{"id":"some-solutions-are-standalone-functions","text":"Not all solutions use a `Solution` class — some expose a standalone function (e.g., `get_answer`, `largest_unique_number`) as the entry point, with no class wrapper.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/some-solutions-are-standalone-functions.json"},{"id":"some-solutions-bundle-tests-inline","text":"Some solution files (e.g., `largest-number-after-digit-swaps-by-parity`, `largest-odd-number-in-string`) contain both the `Solution` class and a `unittest.TestCase` class in the same module, while others keep tests in a separate `test_solution.py`","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/some-solutions-bundle-tests-inline.json"},{"id":"some-solutions-combine-test-and-source","text":"Some solution files (e.g., `number-of-students-doing-homework-at-a-given-time/solution.py`, `number-of-valid-clock-times/solution.py`) include both the `Solution` class and a `unittest.TestCase` subclass in a single module, alongside a separate `test_solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/some-solutions-combine-test-and-source.json"},{"id":"some-solutions-embed-tests","text":"Some solution files (e.g., `count-prefixes-of-a-given-string/solution.py`) contain both the algorithm and a `unittest`-based test class in the same file, with a `__main__` guard for direct execution, rather than using a separate `test_solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/some-solutions-embed-tests.json"},{"id":"some-solutions-mutate-input","text":"Some solutions mutate their input arguments in place (e.g., `can_construct` sorts the array, `canPlaceFlowers` writes to the flowerbed list) while others are pure (e.g., `digitSum` rebinds without mutation). There is no repo-wide convention — each solution's mutation behavior must be checked individually.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/some-solutions-mutate-input.json"},{"id":"sort-and-deal-greedy-minimizes-digit-sum","text":"Round-robin dealing of ascending-sorted digits into two string accumulators minimizes the sum by placing smallest digits at highest significance positions and balancing number lengths","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-and-deal-greedy-minimizes-digit-sum.json"},{"id":"sort-array-misnaming-in-chips-solution","text":"The function solving minimum-cost-to-move-chips is named `sort_array` despite performing no sorting — it computes a minimum cost via parity counting, likely a code-generation pipeline artifact.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-array-misnaming-in-chips-solution.json"},{"id":"sort-as-simulation-substitute","text":"Multiple solutions in this repo replace iterative simulations with a single sort step, then reduce over the sorted structure — a recurring pattern across greedy problems.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-as-simulation-substitute.json"},{"id":"sort-by-bits-stable-tiebreak","text":"Elements with equal bit count are sorted ascending by value; equal-value elements preserve input order due to Python's stable sort.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-by-bits-stable-tiebreak.json"},{"id":"sort-by-bits-uses-string-popcount","text":"`sortByBits` computes popcount via `bin(x).count('1')` string counting rather than bitwise arithmetic (Kernighan's trick or lookup tables).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-by-bits-uses-string-popcount.json"},{"id":"sort-by-parity-in-place","text":"`sortArrayByParity` mutates and returns the input list; it allocates no auxiliary array.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-by-parity-in-place.json"},{"id":"sort-by-parity-linear","text":"The parity-sort algorithm runs in O(n) time with O(1) extra space via a single converging two-pointer pass.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-by-parity-linear.json"},{"id":"sort-by-parity-tests-property-based","text":"Tests for sort-by-parity verify two structural properties (evens-before-odds and permutation-of-input) rather than checking against hardcoded expected outputs, which is appropriate since multiple valid orderings exist.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-by-parity-tests-property-based.json"},{"id":"sort-even-odd-misnamed","text":"The sort-even-odd-indices function is named `maxValue` but the LeetCode problem's canonical method name is `sortEvenOdd`, likely a generation pipeline artifact.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-even-odd-misnamed.json"},{"id":"sort-even-odd-no-mutation","text":"`maxValue` (sort-even-odd-indices) returns a new list and never mutates the input `nums`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-even-odd-no-mutation.json"},{"id":"sort-even-odd-time-complexity","text":"Sort-even-odd-indices runs in O(n log n) time dominated by two `sorted()` calls, with O(n) space for partition lists and result.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-even-odd-time-complexity.json"},{"id":"sort-greedy-positive-only","text":"`max_product_difference` is correct only because all `nums[i]` are positive (per LeetCode constraint 1 <= nums[i] <= 10^4); negative values would invalidate the assumption that the two smallest form the minimum product.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-greedy-positive-only.json"},{"id":"sort-interleave-optimal-digit-split","text":"For 4-digit number splitting, sorting digits ascending and assigning the two smallest to tens places minimizes the two-number sum. The specific pairing assignment is irrelevant — `(0,2)+(1,3)` and `(0,3)+(1,2)` yield identical sums.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-interleave-optimal-digit-split.json"},{"id":"sort-pair-greedy-optimal-1d-assignment","text":"Sorting both arrays and pairing by index yields the minimum total absolute displacement for 1D assignment problems, by the rearrangement inequality.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-pair-greedy-optimal-1d-assignment.json"},{"id":"sort-people-assumes-distinct-heights","text":"`sort_names_by_height` correctness depends on all heights being distinct; duplicate heights cause tuple comparison to fall through to lexicographic name ordering, producing potentially wrong results.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-people-assumes-distinct-heights.json"},{"id":"sort-preprocessing-enables-linear-scan","text":"O(n log n) sorting as a preprocessing step is the standard technique for reducing complex pair/ordering problems to simple linear-scan algorithms via two-pointer, adjacent-pair, or greedy strategies.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/sort-preprocessing-enables-linear-scan.json"},{"id":"sort-preprocessing-universally-correct","text":"Sort-then-scan preprocessing produces correct results across all solutions that use it, because sorting establishes exactly the adjacency and monotonicity invariants that the subsequent linear scan requires for correctness.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"derived","url":"/public/leetcode-expert/belief/sort-preprocessing-universally-correct.json"},{"id":"sort-select-restore-idiom","text":"Subsequence selection problems use a two-sort pattern: sort by value to select the top-k elements, then re-sort by original index to restore input order — correctness does not depend on sort stability.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-select-restore-idiom.json"},{"id":"sort-sentence-positional-scatter","text":"`sort_sentence` uses positional scatter (pre-allocate array, place each word at its encoded index in one pass) instead of comparison sort, achieving O(n) time — the same pattern appears in `shuffle-string/solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-sentence-positional-scatter.json"},{"id":"sort-sentence-single-digit-position","text":"`sort_sentence` reads exactly one trailing character as the position digit, so it only supports inputs with at most 9 words; inputs with 10+ words would misparse the position.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-sentence-single-digit-position.json"},{"id":"sort-string-constant-space","text":"The count array is always exactly 26 elements regardless of input size; auxiliary space is O(1) beyond the output.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-string-constant-space.json"},{"id":"sort-string-counting-array-pattern","text":"Uses a 26-element integer array indexed by character ordinal offset instead of Counter or sorting — the canonical approach when the alphabet is small and fixed.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-string-counting-array-pattern.json"},{"id":"sort-string-linear-time","text":"sortString runs in O(n × 26) = O(n) time; each character is appended exactly once across all sweep iterations.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-string-linear-time.json"},{"id":"sort-then-column-max-equivalence","text":"`maxValueAfterOperations` sorts each row and sums column-wise maxima, which is mathematically equivalent to simulating repeated deletion of row maxima.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-then-column-max-equivalence.json"},{"id":"sort-then-scan-pattern","text":"The sort-then-scan pattern (sort to establish adjacency invariants, then linear scan) recurs across multiple solutions in the repo including `minimum-absolute-difference`, `array-partition`, and `largest-perimeter-triangle`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-then-scan-pattern.json"},{"id":"sort-then-slide-correctness","text":"After sorting, the minimum max-min difference over all size-k subsets equals the minimum `nums[i+k-1] - nums[i]`, because optimal subsets are always contiguous in sorted order.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-then-slide-correctness.json"},{"id":"sort-then-two-pointer-dominant-pair-pipeline","text":"The sort-then-two-pointer pipeline is the dominant combined technique for pair and ordering problems, where O(n log n) sorting establishes the monotonicity invariant that two-pointer convergence exploits for O(n) scanning.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/sort-then-two-pointer-dominant-pair-pipeline.json"},{"id":"sort-then-two-pointer-pattern","text":"The sort + two-pointer squeeze pattern (used in `two-sum-less-than-k`) recurs across multiple solutions for pair-sum optimization, converting O(n^2) brute force into O(n log n)","truth_value":"IN","justification_count":0,"dependent_count":2,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sort-then-two-pointer-pattern.json"},{"id":"sorted-adjacent-min-diff","text":"After sorting distinct integers, the minimum absolute difference always occurs between adjacent elements; the minimum-absolute-difference solution relies on this to reduce from O(n^2) pair comparisons to O(n) adjacent scan.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sorted-adjacent-min-diff.json"},{"id":"sorted-merge-vs-hashmap-strategy","text":"The repo demonstrates two distinct merge-by-key strategies: `merge-similar-items` uses `defaultdict(int)` when inputs are unsorted, while `merge-two-2d-arrays` uses a two-pointer merge when inputs are pre-sorted — the choice is driven by the sorted precondition.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sorted-merge-vs-hashmap-strategy.json"},{"id":"sorted-order-enables-all-efficient-search","text":"Sorted order is a key prerequisite for two major families of efficient search and scan algorithms: it enables O(n) linear-scan techniques (two-pointer, adjacent-pair, greedy) after an O(n log n) preprocessing step, and it enables O(log n) binary search via convergence-loop structures that narrow a search range. The choice between these approaches depends on whether the problem requires processing multiple elements or locating a specific target.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/sorted-order-enables-all-efficient-search.json"},{"id":"sorted-precondition-not-validated","text":"`min_common_number` assumes both input arrays are sorted in non-decreasing order but does not check or enforce this; unsorted input produces silently wrong results.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sorted-precondition-not-validated.json"},{"id":"sorted-rotated-at-most-one-break","text":"A non-decreasing array rotated by any number of positions has at most 1 index where `nums[i] > nums[(i+1) % n]`; the algorithm makes exactly `n` circular comparisons (not `n-1`) to include the wrap-around.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sorted-rotated-at-most-one-break.json"},{"id":"sorted-triangle-single-inequality","text":"When sides are sorted descending (`a >= b >= c`), only `a < b + c` needs explicit testing — the other two triangle inequalities hold automatically.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sorted-triangle-single-inequality.json"},{"id":"sorting-problems-use-tuple-keys","text":"Multi-criteria sorting problems in this repo consistently use Python's tuple sort keys (e.g., `(freq[x], -x)`, `(bin(x).count('1'), x)`) with lexicographic comparison rather than custom comparators via `functools.cmp_to_key`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sorting-problems-use-tuple-keys.json"},{"id":"space-minimization-dual-strategy","text":"Solutions minimize memory through two complementary strategies — algorithmic (scalar running accumulators replacing materialized collections) and structural (in-place mutation of input data structures) — achieving O(1) auxiliary space at both the computation and interface layers.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/space-minimization-dual-strategy.json"},{"id":"special-array-boundary-guard","text":"The `x == n` check in `specialArray` prevents an index-out-of-bounds access on `nums[x]` when `x` equals the array length; removing it would crash on arrays where all elements qualify.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/special-array-boundary-guard.json"},{"id":"special-array-mutates-input","text":"`specialArray` sorts the input list in-place with `nums.sort(reverse=True)`, mutating the caller's data — callers must copy first if they need the original order.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/special-array-mutates-input.json"},{"id":"special-positions-precompute-row-col-sums","text":"`numSpecial` precomputes per-row and per-column sums in O(m·n), reducing the per-cell special check from O(m+n) to O(1) — this precomputation pattern recurs across matrix problems like `lucky-numbers-in-a-matrix` and `image-smoother`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/special-positions-precompute-row-col-sums.json"},{"id":"special-positions-three-way-conjunction","text":"A cell is special iff `mat[i][j] == 1`, `row_sums[i] == 1`, and `col_sums[j] == 1`; the `mat[i][j] == 1` check is technically redundant but short-circuits the sum lookups for the majority-zero cells.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/special-positions-three-way-conjunction.json"},{"id":"split-min-sum-no-input-validation","text":"`min_sum_of_two_numbers` performs no input validation; a single-digit input would produce `int(\"\")` on the empty accumulator, crashing at runtime","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/split-min-sum-no-input-validation.json"},{"id":"split-space-vs-split-default-semantics","text":"`reverse_words_in_string` uses `split(\" \")` (explicit space delimiter) instead of `split()`, which would collapse multiple spaces and strip leading/trailing whitespace — the explicit form preserves the input's spacing structure.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/split-space-vs-split-default-semantics.json"},{"id":"sqrt-divisor-enumeration-pattern","text":"`common_factors` enumerates divisors in O(sqrt(gcd(a,b))) by iterating only up to the square root and pairing each divisor `i` with `g // i`, with a guard against double-counting perfect squares","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sqrt-divisor-enumeration-pattern.json"},{"id":"squares-sorted-array-function-misnamed","text":"`squares-of-a-sorted-array/solution.py` names its function `distinctSubseqII` (LeetCode 940) despite implementing LeetCode 977 (Squares of a Sorted Array)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/squares-sorted-array-function-misnamed.json"},{"id":"stack-cancellation-handles-cascades","text":"The stack-based pair cancellation in `make-the-string-great/solution.py` handles chain reactions (where removing one pair exposes a new bad pair) without re-scanning, because the next incoming character is checked against the newly-exposed stack top.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stack-cancellation-handles-cascades.json"},{"id":"stack-extend-preserves-child-order","text":"In the postorder solution, `stack.extend(node.children)` pushes children left-to-right so the rightmost is popped first, producing root-right-left order that reverses to correct left-right-root postorder.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stack-extend-preserves-child-order.json"},{"id":"stack-queue-costly-push-strategy","text":"Push is O(n) due to rotating n-1 elements behind the new element; pop, top, and empty are all O(1). This is the costly-push variant, preferred when reads outnumber writes.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stack-queue-costly-push-strategy.json"},{"id":"stack-queue-deque-as-fifo","text":"deque is used strictly as a FIFO queue (only append, popleft, len, and [0] indexing); no deque-specific operations like appendleft are used.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stack-queue-deque-as-fifo.json"},{"id":"stack-queue-front-invariant","text":"After every push, the front of the internal deque is the most recently pushed element (stack top), maintained by dequeuing and re-enqueuing n-1 preceding elements.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stack-queue-front-invariant.json"},{"id":"stack-queue-single-queue","text":"MyStack uses exactly one deque, satisfying the LeetCode follow-up constraint for single-queue implementation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stack-queue-single-queue.json"},{"id":"staircase-requires-both-row-and-column-sort","text":"The staircase traversal's correctness depends on columns being sorted descending (to justify counting `m - row` cells at once); row-only sorting would make the O(m+n) approach incorrect.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/staircase-requires-both-row-and-column-sort.json"},{"id":"staircase-traversal-for-sorted-matrix","text":"The sorted-matrix negative count uses O(m+n) staircase traversal starting from top-right corner, not binary-search-per-row or brute force — the same pattern applicable to LeetCode 240 and 378.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/staircase-traversal-for-sorted-matrix.json"},{"id":"stale-aliases-from-generation-pipeline","text":"Some solution files contain dead method aliases (e.g., `carFleet = projectionArea`) that are artifacts of the automated solution generation pipeline; these are never called by tests","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stale-aliases-from-generation-pipeline.json"},{"id":"star-center-two-edge-sufficiency","text":"The center of a star graph is uniquely determined by inspecting only the first two edges, since the center must appear in every edge; `find_center` runs in O(1) time regardless of graph size.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/star-center-two-edge-sufficiency.json"},{"id":"stdlib-construction-composable-correctness","text":"The combination of stdlib delegation (exact arithmetic, correct data structures) and construction techniques (sentinel initialization, streaming invariants) should compose to provide end-to-end correctness guarantees — no manual reimplementation means no reimplementation bugs, and construction eliminates boundary-condition errors.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stdlib-construction-composable-correctness.json"},{"id":"stdlib-delegation-safe-under-input-contracts","text":"Delegating computation to Python stdlib abstractions (Counter, min, reduce, sorted, set) is safe when LeetCode's input contracts hold, because the stdlib functions handle all valid inputs correctly without explicit error handling.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stdlib-delegation-safe-under-input-contracts.json"},{"id":"stdlib-gcd-delegation","text":"The GCD solution delegates entirely to `math.gcd` (C-accelerated in CPython) with no custom Euclidean algorithm.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stdlib-gcd-delegation.json"},{"id":"stdlib-only-dependencies","text":"Solutions import only from Python's standard library (primarily `unittest` and `typing`); no external or third-party packages are used.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stdlib-only-dependencies.json"},{"id":"stdlib-only-no-external-deps","text":"Solutions import only from Python's standard library (primarily `typing` and `unittest`) — no external or third-party dependencies are used.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stdlib-only-no-external-deps.json"},{"id":"stdlib-preferred-over-handrolled","text":"Solutions prefer standard library utilities (`bisect_right`, `sorted`, `sum` with generators) over hand-rolled implementations of the same logic, reducing off-by-one risk and code ceremony.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/stdlib-preferred-over-handrolled.json"},{"id":"stdlib-reinforces-exactness","text":"Python stdlib delegation and exact integer arithmetic converge on the same goal: Counter gives exact frequencies, math.isqrt gives exact roots, set gives exact membership — the stdlib IS the exactness layer, and choosing manual implementations would compromise both idiomaticity and precision.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/stdlib-reinforces-exactness.json"},{"id":"str-conversion-digit-extraction-idiom","text":"The `int(d) for d in str(n)` idiom is the standard digit-decomposition pattern across this repo, used instead of modular arithmetic (`% 10`, `// 10`), with the advantage of preserving left-to-right digit order without reversal.","truth_value":"IN","justification_count":0,"dependent_count":2,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/str-conversion-digit-extraction-idiom.json"},{"id":"str-digit-count-negative-miscount","text":"`findNumbers` uses `len(str(n))` to count digits, which is correct for positive integers but would miscount negatives because the `-` character inflates the string length by 1.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/str-digit-count-negative-miscount.json"},{"id":"str-digit-extraction-idiom","text":"Digit-manipulation problems in this repo consistently use `str(n)` to iterate digits left-to-right rather than arithmetic extraction via `% 10` / `divmod`, which yields digits in reverse order.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/str-digit-extraction-idiom.json"},{"id":"str-replace-replaces-all-occurrences","text":"`str.replace(d, '9')` remaps every occurrence of digit `d`, not just the first — this matches the problem's \"remap a digit\" semantics where choosing digit `d` affects all positions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/str-replace-replaces-all-occurrences.json"},{"id":"streaming-and-mutation-jointly-minimize-footprint","text":"The dominant space-minimization strategy combines two complementary mechanisms at different granularities: single-pass streaming with scalar accumulators avoids materializing intermediate collections (algorithmic minimization), while in-place mutation avoids allocating separate output structures (structural minimization) — together achieving minimal total memory footprint.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/streaming-and-mutation-jointly-minimize-footprint.json"},{"id":"streaming-boundary-handling-robust-in-practice","text":"Streaming's structural boundary handling produces correct results for all observed boundary inputs: sentinel initialization handles empty/degenerate inputs without special-case code, and sentinel values never collide with valid data under LeetCode's constraints — making the paradigm empirically robust at boundaries, not just structurally sound.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-boundary-handling-robust-in-practice.json"},{"id":"streaming-boundary-handling-structurally-complete","text":"The streaming paradigm handles all boundary conditions through structural mechanisms rather than conditional logic: sentinel initialization covers the start boundary (no first-iteration special cases), early-exit covers the termination boundary (no post-violation processing), and extend-or-reset covers transition boundaries (no inter-run bookkeeping).","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-boundary-handling-structurally-complete.json"},{"id":"streaming-counter-reset-pattern","text":"The \"streaming counter with reset\" idiom — increment on match, reset to 0 on mismatch — is used to detect k consecutive elements satisfying a predicate in O(n) time and O(1) space; `threeConsecutiveOdds` uses it with k=3.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/streaming-counter-reset-pattern.json"},{"id":"streaming-dominates-because-lowest-adoption-barrier","text":"Streaming's prevalence in an uncoordinated repo is partially explained by its self-sufficiency: it requires no preprocessing phase and no external ordering — only local reasoning about accumulator state — making it a paradigm with a particularly low adoption barrier. When each solution is developed independently without shared patterns, this autonomy may contribute to streaming's natural emergence as a dominant paradigm alongside sort-then-scan.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/streaming-dominates-because-lowest-adoption-barrier.json"},{"id":"streaming-enables-precision-without-coordination","text":"Streaming's self-sufficiency (no preprocessing phase, no runtime validation) is a contributing factor that supports algorithmic precision emerging without engineering coordination — fewer moving parts reduce opportunities for misconfiguration, which helps explain how high algorithmic quality can arise even when solutions are authored independently with zero cross-reference, alongside the natural constraint that LeetCode's problem domain exerts on the solution space.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/streaming-enables-precision-without-coordination.json"},{"id":"streaming-extends-through-three-orthogonal-axes","text":"Streaming achieves complete universality through three orthogonal extension mechanisms: operation specialization adapts the accumulation function to data domains (XOR for bits, Counter for frequencies), cursor duplication extends to multi-input and pair problems, and write-cursor compaction extends to in-place array transformations — collectively exhausting the space of solution output modes.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-extends-through-three-orthogonal-axes.json"},{"id":"streaming-fixed-point-of-solution-space","text":"Streaming simultaneously coincides with four independent characterizations of optimality — convergence attractor (lowest adoption barrier), algebraic normal form (all solutions reduce to it), universal strategy (three orthogonal extension axes), and minimal strategy (fewest prerequisites) — establishing it as the unique fixed point of the solution space under all natural orderings, contingent on streaming algorithms terminating for all valid inputs.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-fixed-point-of-solution-space.json"},{"id":"streaming-is-mechanism-of-quality-inversion","text":"Streaming is the specific mechanism through which algorithmic quality outpaces engineering quality: it achieves the strongest convergence (via lowest adoption barrier) while requiring the least engineering infrastructure (no preprocessing, no coordination, no shared abstractions), making the quality inversion an inevitable structural consequence rather than a contingent outcome.","truth_value":"OUT","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/streaming-is-mechanism-of-quality-inversion.json"},{"id":"streaming-is-privileged-default-strategy","text":"Single-pass streaming occupies a distinct position in the three-strategy taxonomy: it is the only strategy that is self-sufficient — requiring neither preprocessing nor runtime validation — making it the most autonomous and minimal pattern. The other two strategies (sort-then-scan and closed-form reduction) are justified when problem structure demands ordering or structural reducibility, respectively.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/streaming-is-privileged-default-strategy.json"},{"id":"streaming-is-self-sufficient-paradigm","text":"Single-pass streaming is the only paradigm that requires neither preprocessing (no external ordering needed) nor runtime validation (correctness by construction via sentinels and exact arithmetic), making it the most autonomous and minimal algorithmic pattern in the repo.","truth_value":"IN","justification_count":1,"dependent_count":8,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/streaming-is-self-sufficient-paradigm.json"},{"id":"streaming-is-solution-normal-form","text":"The closed taxonomy (three strategies exhaust the problem space) combined with universal reducibility to adapted streaming means the solution space has a normal form: every solution is either raw streaming or preprocessing-adapted streaming, and no solution lies outside this classification — the taxonomy is not just descriptive but canonical.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-is-solution-normal-form.json"},{"id":"streaming-isolation-co-adaptation-dynamically-locked","text":"The co-adaptation between streaming and isolation is not merely a structural fit but a dynamically locked equilibrium: the self-reinforcing quality feedback loop simultaneously rewards streaming dominance (by selecting for algorithmic investment) and perpetuates isolation (by making cross-solution engineering investment unrewarded), locking the co-adapted pair in place through the same mechanism that stabilizes the quality profile.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-isolation-co-adaptation-dynamically-locked.json"},{"id":"streaming-needs-no-external-ordering","text":"Single-pass streaming algorithms can process input in a single left-to-right scan without a separate preprocessing phase, because sentinel initialization bootstraps the O(1)-space accumulators so that extend-or-reset logic follows a uniform code path from the first iteration onward — in contrast to approaches like sort-then-scan that require O(n log n) ordering as a prerequisite.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/streaming-needs-no-external-ordering.json"},{"id":"streaming-normal-form-is-minimal-strategy","text":"The solution space has a normal form (streaming, to which every solution reduces via preprocessing) that is simultaneously its minimal-prerequisite member (self-sufficient, requiring no preprocessing or validation) — a structural property analogous to an algebraic identity element being the simplest group member: the universal reduction target is also the strategy with the lowest adoption barrier.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-normal-form-is-minimal-strategy.json"},{"id":"streaming-quality-divergence-requires-safety","text":"Streaming's self-sufficiency enables the quality divergence (high algorithmic quality achieved without engineering discipline) only while the streaming paradigm's implicit language-level safety assumptions hold — when Python's arbitrary-precision semantics cause streaming algorithms to fail on inputs outside problem constraints, the clean divergence story is incomplete.","truth_value":"OUT","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/streaming-quality-divergence-requires-safety.json"},{"id":"streaming-safe-within-problem-domain","text":"Single-pass streaming algorithms terminate correctly for all inputs within LeetCode's stated constraints, because the deliberate contract of trusting input guarantees eliminates the edge cases that would cause divergence.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/streaming-safe-within-problem-domain.json"},{"id":"streaming-self-sufficiency-bridges-causes","text":"Streaming's self-sufficiency is the causal bridge that connects the system's ultimate explanatory factors (elimination principle + domain lock) to its observable properties: elimination produces streaming's self-sufficiency by removing all prerequisites, while the domain lock stabilizes this state, and self-sufficiency then independently generates the three observable system-level phenomena (co-adaptation with isolation, selective defense, convergence dominance) — forming a complete proximate-to-ultimate causal chain with no explanatory gaps.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-self-sufficiency-bridges-causes.json"},{"id":"streaming-self-sufficiency-co-adapted-with-isolation","text":"Streaming's self-sufficiency and per-problem isolation form a co-adapted pair: streaming requires no shared infrastructure (no preprocessing library, no external ordering mechanism, no shared data structures), making isolation costless from an algorithmic perspective; isolation removes coordination overhead and convention enforcement, making streaming's self-sufficiency the path of least resistance for every new solution — the two properties mutually stabilize each other, each making the other more viable.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-self-sufficiency-co-adapted-with-isolation.json"},{"id":"streaming-self-sufficiency-explains-selective-defense","text":"Streaming's self-sufficiency and the judge-boundary explanation for selective defense are mutually reinforcing: streaming eliminates validation requirements by construction, and the judge rewards this absence (validation has no test-case payoff), so the dominant paradigm's architecture naturally produces the selective defense pattern without deliberate engineering choice.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-self-sufficiency-explains-selective-defense.json"},{"id":"streaming-self-sufficiency-is-proximate-system-cause","text":"Streaming's self-sufficiency is the single property from which three distinct system-level phenomena independently derive: it co-adapts with isolation to dynamically lock the architectural shape, it explains selective defense by eliminating validation requirements at the paradigm level, and its lowest adoption barrier drives uncoordinated convergence to the quality attractor — three independent causal paths from one property to three system characteristics.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-self-sufficiency-is-proximate-system-cause.json"},{"id":"streaming-universal-via-specialization-and-adaptation","text":"Streaming achieves universal coverage of the solution space through two orthogonal extension mechanisms: operation specialization adapts streaming to different data domains within a single pass (XOR for bits, Counter for frequencies, min-tracking for extrema), while domain adaptation via preprocessing transforms problems from domains where streaming alone is insufficient into streaming-amenable form — specialization extends streaming's reach within its native domain, adaptation extends it beyond.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-universal-via-specialization-and-adaptation.json"},{"id":"streaming-universality-and-minimality-coincide","text":"Streaming simultaneously achieves universality (covering the entire solution space through three orthogonal extension axes: operation specialization, cursor multiplicity, and in-place compaction) and minimality (requiring the fewest prerequisites of any strategy as the solution normal form), resolving the typical tradeoff between generality and simplicity — the most general strategy is also the simplest.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-universality-and-minimality-coincide.json"},{"id":"streaming-universality-through-operation-specialization","text":"The streaming paradigm achieves universality across data domains by specializing only the accumulation operation: XOR for bit-level cancellation and diffing, arithmetic sum for counting and tracking, min/max for optimization, and DFS traversal for tree-structured data — while the single-pass-with-accumulator skeleton remains invariant.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/streaming-universality-through-operation-specialization.json"},{"id":"strict-greater-than-plus-one","text":"The minimum training hours solution enforces the strict-greater-than requirement via `+ 1` in both the energy threshold (`sum + 1`) and experience gap (`exp + 1 - cur_exp`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/strict-greater-than-plus-one.json"},{"id":"strict-inequality-enforces-positive-area","text":"The rectangle overlap solution uses strict `<` (not `<=`) in all four comparisons, ensuring that touching edges or corners return `False` — matching the problem's requirement for positive intersection area.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/strict-inequality-enforces-positive-area.json"},{"id":"strict-inequality-guard","text":"The `nums[j] > min_val` check (not `>=`) means equal-valued pairs never contribute a difference, and a non-increasing array returns `-1`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/strict-inequality-guard.json"},{"id":"strict-inequality-rejects-plateaus","text":"The valid-mountain-array solution uses strict `<` (not `<=`) in pointer advancement, so equal adjacent elements halt the pointer and cause the validity check to fail.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/strict-inequality-rejects-plateaus.json"},{"id":"string-based-digit-check-idiom","text":"Zero-digit detection uses `'0' not in str(x)` rather than arithmetic modulo operations, a string-conversion idiom that appears across digit-manipulation problems in the repo.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/string-based-digit-check-idiom.json"},{"id":"string-concat-over-arithmetic-for-digit-joining","text":"Solutions that need to \"concatenate\" two integers as digits use `int(str(a) + str(b))` rather than `a * 10**len(str(b)) + b` — simpler code at the cost of O(d) string allocation per pair.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/string-concat-over-arithmetic-for-digit-joining.json"},{"id":"string-digit-extraction-is-default-idiom","text":"Digit decomposition across solutions defaults to `sum(int(d) for d in str(n))` rather than arithmetic modulo/division — a repo-wide convention favoring readability over performance.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/string-digit-extraction-is-default-idiom.json"},{"id":"string-doubling-trim-eliminates-trivial-matches","text":"In the repeated-substring-pattern solution, `(s + s)[1:-1]` is correctness-critical: without the `[1:-1]` trim, `s` always appears at positions 0 and `len(s)` in `s + s`, making every input a false positive.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/string-doubling-trim-eliminates-trivial-matches.json"},{"id":"string-immutability-eliminates-backtracking","text":"`binary_tree_paths` passes the accumulated path as a string parameter, relying on Python string immutability to give each recursive branch an independent snapshot without explicit undo or copy.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/string-immutability-eliminates-backtracking.json"},{"id":"string-join-then-parse-for-digit-construction","text":"When building multi-digit numbers from character sequences, solutions prefer joining digit strings and calling `int()` over arithmetic place-value computation (`acc * 10 + digit`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/string-join-then-parse-for-digit-construction.json"},{"id":"string-matching-break-prevents-duplicates","text":"In `string-matching-in-an-array`, the `break` after appending a matched word to the result list is the sole mechanism preventing duplicate entries — no set or other dedup is used","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/string-matching-break-prevents-duplicates.json"},{"id":"string-matching-self-exclusion-via-index","text":"The `i != j` index guard is the only mechanism preventing a word from being reported as a substring of itself","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/string-matching-self-exclusion-via-index.json"},{"id":"string-normalization-over-int-conversion","text":"`num_different_integers` normalizes leading zeros via `str.lstrip('0')` instead of `int()` conversion, keeping the solution safe for digit sequences that could exceed typical numeric ranges (LeetCode allows up to 200-digit sequences).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/string-normalization-over-int-conversion.json"},{"id":"string-over-arithmetic-for-digit-ops","text":"Digit extraction, digit checking, and popcount operations consistently use string conversion (str(), indexing, character iteration, bin().count()) rather than modular arithmetic across unrelated problems.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/string-over-arithmetic-for-digit-ops.json"},{"id":"string-popcount-idiom","text":"`bin(n).count('1')` is used as the popcount method in `hamming-distance/solution.py` and is likely the standard popcount idiom across the repo (shared with `number-of-1-bits`, `counting-bits`, `minimum-bit-flips-to-convert-number`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/string-popcount-idiom.json"},{"id":"strobogrammatic-center-self-symmetric","text":"For odd-length strings, the `left <= right` loop condition forces the center digit to be checked against its own rotation, so only 0, 1, and 8 are valid center digits","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/strobogrammatic-center-self-symmetric.json"},{"id":"strobogrammatic-five-valid-digits","text":"Only digits 0, 1, 6, 8, 9 are valid in a strobogrammatic number; the absence of any other digit from the mapping dict causes immediate rejection","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/strobogrammatic-five-valid-digits.json"},{"id":"strobogrammatic-uses-rotation-not-equality","text":"The strobogrammatic check compares `mapping[num[left]]` against `num[right]`, not `num[left]` against `num[right]` — \"69\" is strobogrammatic but not a palindrome","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/strobogrammatic-uses-rotation-not-equality.json"},{"id":"structural-congruence-assumed","text":"`getTargetCopy` assumes the cloned tree is structurally identical to the original without validation; divergent trees produce undefined behavior.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/structural-congruence-assumed.json"},{"id":"structural-equality-not-prefix-match","text":"`_is_same` returns `True` only when both trees have identical structure and values at every position; a node with extra children that `subRoot` lacks correctly returns `False`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/structural-equality-not-prefix-match.json"},{"id":"structural-twin-of-stock-problem","text":"The maximum-difference-between-increasing-elements solution is algorithmically identical to \"Best Time to Buy and Sell Stock\" (running minimum pattern) except it returns `-1` instead of `0` when no valid pair exists.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/structural-twin-of-stock-problem.json"},{"id":"subsequence-limited-sum-greedy-sort","text":"Sorting `nums` ascending and taking smallest elements first guarantees maximum count under any sum budget; this greedy choice is optimal because swapping a larger element for a smaller one never decreases remaining capacity.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/subsequence-limited-sum-greedy-sort.json"},{"id":"subsequence-limited-sum-positive-input-invariant","text":"`bisect_right` on the prefix sum array requires strictly non-decreasing prefix sums, which holds only when all values in `nums` are positive; zero or negative values would break monotonicity and produce wrong answers.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/subsequence-limited-sum-positive-input-invariant.json"},{"id":"subsequence-limited-sum-query-independence","text":"Each query is answered in O(log n) via binary search against a shared prefix array built once in O(n log n); queries do not interact with each other.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/subsequence-limited-sum-query-independence.json"},{"id":"subset-xor-closed-form","text":"The sum of XOR totals over all subsets equals `reduce(or_, nums) * 2^(len(nums)-1)`, reducing subset XOR summation from O(n·2^n) enumeration to O(n) time and O(1) space.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/subset-xor-closed-form.json"},{"id":"substring-negation-pattern","text":"Multiple solutions in this repo reduce ordering/segmentation problems to checking for a forbidden 2-character substring (e.g., `\"ba\" not in s` for all-a's-before-b's).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/substring-negation-pattern.json"},{"id":"subtraction-order-assumes-bst-validity","text":"`node.val - self.prev` (without `abs()`) is correct only because inorder traversal on a valid BST visits values in non-decreasing order; the code does not verify the BST property.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/subtraction-order-assumes-bst-validity.json"},{"id":"subtree-check-is-quadratic","text":"`isSubtree` has O(m * n) worst-case time because `_is_same` (which is O(n)) is called at up to m nodes during the DFS traversal of `root`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/subtree-check-is-quadratic.json"},{"id":"subtree-sum-return-contract","text":"`subtree_sum` always returns the sum of all node values in its subtree, never the tilt; tilt is accumulated separately via the `nonlocal total_tilt` side effect.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/subtree-sum-return-contract.json"},{"id":"sum-base-k1-infinite-loop","text":"`sum_base` with k=1 causes an infinite loop (n //= 1 never decreases n) and k=0 raises ZeroDivisionError — neither is guarded because LeetCode guarantees k >= 2.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sum-base-k1-infinite-loop.json"},{"id":"sum-substitution-avoids-float-precision","text":"`distinctAverages` compares sums instead of averages to determine distinctness, exploiting the fact that dividing by a constant preserves distinctness — this eliminates floating-point precision issues entirely.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sum-substitution-avoids-float-precision.json"},{"id":"sumzero-no-input-validation","text":"`sumZero` performs no bounds checking on `n`; it relies on LeetCode's guarantee that `1 <= n <= 1000`. Passing `n=0` returns `[]` silently.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sumzero-no-input-validation.json"},{"id":"sumzero-output-length-equals-n","text":"`sumZero(n)` always returns exactly `n` elements: `2 * (n // 2)` from pairs plus `n % 2` from the optional zero append.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sumzero-output-length-equals-n.json"},{"id":"sumzero-symmetric-pair-construction","text":"`sumZero(n)` constructs its result by appending `(i, -i)` pairs for `i` in `[1, n//2]`, plus `0` if `n` is odd — guaranteeing uniqueness, zero-sum, and correct length by construction without tracking a running sum.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sumzero-symmetric-pair-construction.json"},{"id":"surface-area-forward-neighbor-no-double-count","text":"Grid adjacency problems use a forward-only neighbor check (right and down only) so each adjacent pair is processed exactly once, preventing double-counting of shared faces or edges.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/surface-area-forward-neighbor-no-double-count.json"},{"id":"surplus-forces-sacrifice","text":"When all children would get $8 but leftover money remains, distribute-money demotes exactly one child to absorb the surplus, because the problem requires distributing all money.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/surplus-forces-sacrifice.json"},{"id":"swap-check-symmetry","text":"The cross-check `s1[i]==s2[j] and s1[j]==s2[i]` is equivalent regardless of which string the swap is applied to, so `are_almost_equal` doesn't need to specify the swap target","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/swap-check-symmetry.json"},{"id":"sweep-ordering-guarantee","text":"Characters within each forward sweep are strictly ascending and within each backward sweep strictly descending, by construction of the index iteration direction.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/sweep-ordering-guarantee.json"},{"id":"system-doubly-terminal-in-structure-and-dynamics","text":"The system has reached a doubly terminal state: the solution space has converged to a provably unique canonical form (structural terminus, established by dual-description convergence) and the quality dynamics have reached an absorbing state with no exit path (dynamic terminus, established by orthogonal defect confinement). Neither what solutions compute nor how well they are engineered can drift under the current architecture — the system is fully determined in both dimensions simultaneously.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/system-doubly-terminal-in-structure-and-dynamics.json"},{"id":"system-explained-by-elimination-and-domain-lock","text":"The repo's complete system character is explained by two orthogonal forces operating at different levels: elimination (of validation, coupling, and computation) produces all structural properties — coherence, quality inversion, and the streaming-dominant architecture — while the LeetCode domain locks these properties into a stable equilibrium by rewarding algorithmic investment and ignoring engineering discipline.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/system-explained-by-elimination-and-domain-lock.json"},{"id":"system-fully-characterized-as-static-equilibrium","text":"The repo constitutes a fully characterized static equilibrium: its mechanism is explained (elimination + domain lock), its quality profile is in stasis at every granularity (macro and micro levels reproduce the same high-algorithmic/low-engineering pattern), and its observable behaviors are quantitatively predictable from two measurable features (abstraction overhead and judge reward signal) — leaving no unexplained systematic variance.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/system-fully-characterized-as-static-equilibrium.json"},{"id":"system-meta-stable-across-all-dimensions","text":"The system exhibits meta-stability: stability holds independently in the orthogonal correctness and quality dimensions (neither can perturb the other), the quantitative predictive relationships between observable features are themselves stable properties (not transient correlations), and together these establish that the system's global state — including the fact of its own stability — is a fixed point with no remaining degree of freedom.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/system-meta-stable-across-all-dimensions.json"},{"id":"systematic-behavior-quantitatively-predictable","text":"Two observable features account for major systematic behaviors in the repo: abstraction overhead predicts convergence strength (zero-abstraction streaming converges most strongly, abstraction-dependent strategies converge proportionally less), and judge reward signal predicts defensive investment (efficiency-improving conditions checked, robustness-improving conditions skipped). Together these two gradients explain the primary patterns in the repo's engineering profile, though other factors may contribute to behaviors not covered by these two dimensions.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/systematic-behavior-quantitatively-predictable.json"},{"id":"tax-amount-assumes-sorted-brackets","text":"`tax_amount` requires `brackets` sorted by `upper_bound` ascending; unsorted input silently produces incorrect results with no validation or error.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tax-amount-assumes-sorted-brackets.json"},{"id":"tax-float-division-imprecision","text":"Tax is accumulated as a float via `percent / 100` division, so results may have floating-point imprecision; tests correctly use `assertAlmostEqual` rather than exact equality.","truth_value":"IN","justification_count":0,"dependent_count":2,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tax-float-division-imprecision.json"},{"id":"tax-min-clamp-marginal-taxation","text":"`min(upper, income)` prevents a bracket from taxing more income than actually earned, which is the core invariant ensuring correct progressive (not flat) taxation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tax-min-clamp-marginal-taxation.json"},{"id":"taxonomy-closed-and-structurally-partitioned","text":"The solution taxonomy is both closed (three strategies exhaust the problem space) and structurally partitioned (two pipeline forms instantiate all preprocessing-dependent strategies), meaning every solution is classifiable by exactly one strategy choice and at most one pipeline shape.","truth_value":"IN","justification_count":1,"dependent_count":3,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/taxonomy-closed-and-structurally-partitioned.json"},{"id":"teemo-last-attack-full-duration","text":"The final attack always contributes exactly `duration` to the total because no subsequent attack can truncate it, encoded as an unconditional `total += duration` after the loop.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/teemo-last-attack-full-duration.json"},{"id":"teemo-overlap-resets-not-stacks","text":"When two attacks overlap (`gap < duration`), only the gap between them counts toward poisoned time — the poison timer resets rather than stacking additively.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/teemo-overlap-resets-not-stacks.json"},{"id":"teemo-single-pass-min-clamping","text":"The teemo-attacking solution computes total poisoned time in O(n) via adjacent-pair comparison with `min(gap, duration)`, avoiding explicit interval construction or merging.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/teemo-single-pass-min-clamping.json"},{"id":"teemo-sorted-precondition","text":"Correctness of the teemo-attacking solution depends on `timeSeries` being non-decreasing; no runtime sort or validation enforces this.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/teemo-sorted-precondition.json"},{"id":"test-colocation-dual-mode-inconsistent","text":"Tests appear in two coexisting patterns — inline unittest classes within solution.py and separate test_solution.py files — but the antecedents show these are complementary rather than incompatible: some problems use both, with the separate test file being the consistent convention and inline tests being an optional addition. No evidence indicates a conflict between the patterns or that the lack of a single enforced standard causes problems.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"unnecessary","source_type":"","url":"/public/leetcode-expert/belief/test-colocation-dual-mode-inconsistent.json"},{"id":"test-files-import-sibling-solution","text":"Each `test_solution.py` imports from its sibling `solution.py` via `from solution import Solution`; the repo-wide \"imported by\" lists are artifacts of shared naming, not actual cross-problem dependencies.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/test-files-import-sibling-solution.json"},{"id":"test-harness-uniform-import-convention","text":"The repo's test harness imports a uniform symbol name from each solution module, leading to semantically incorrect aliases (e.g., `is_univalued` aliasing `largest_sum_after_k_negations`) that exist purely for test infrastructure wiring.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/test-harness-uniform-import-convention.json"},{"id":"test-import-graph-artifact","text":"The \"Imported By\" lists in code exploration prompts show hundreds of test files repo-wide, but each `solution.py` is only truly imported by its co-located `test_solution.py`. The apparent cross-imports are an artifact of the import-graph collection method (likely a shared test harness or conftest pattern).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/test-import-graph-artifact.json"},{"id":"test-import-list-artifact","text":"The large \"Imported By\" lists on solution files (showing ~400+ test files) are artifacts of a shared test runner or dynamic import mechanism, not actual cross-problem dependencies. Each solution is consumed only by its own `test_solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/test-import-list-artifact.json"},{"id":"test-import-list-is-artifact","text":"The large \"Imported By\" lists showing hundreds of test files are artifacts of the repo's shared test infrastructure — each solution is imported only by its co-located `test_solution.py`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/test-import-list-is-artifact.json"},{"id":"tests-colocated-in-solution-file","text":"Some problem solutions bundle `unittest` test cases directly in `solution.py` alongside the solution class, with `unittest.main()` at the bottom, in addition to the separate `test_solution.py` file.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tests-colocated-in-solution-file.json"},{"id":"tests-colocated-with-solutions","text":"Test suites live alongside solutions — either embedded in the same `solution.py` file (with a `unittest` class) or in a sibling `test_solution.py`, making each problem directory independently testable.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tests-colocated-with-solutions.json"},{"id":"third-max-cascading-demotion","text":"When a new global maximum is found, `third_max` demotes `first → second → third` via tuple unpacking in a single statement, guaranteeing no tracked value is lost.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/third-max-cascading-demotion.json"},{"id":"third-max-distinct-invariant","text":"The duplicate-skip guard (`if n in (first, second, third)`) ensures `first`, `second`, and `third` are always mutually distinct when non-`None` throughout execution.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/third-max-distinct-invariant.json"},{"id":"third-max-fallback-to-global-max","text":"When fewer than 3 distinct values exist, `third_max` returns the global maximum (`first`) rather than raising an error or returning a sentinel.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/third-max-fallback-to-global-max.json"},{"id":"third-max-none-sentinel-safety","text":"`third_max` uses `None` as a sentinel for unfilled slots, which is safe because the input domain is `int` only — no value in `nums` can collide with `None`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/third-max-none-sentinel-safety.json"},{"id":"thousand-separator-no-dot-for-small-inputs","text":"Inputs with 3 or fewer digits produce no dot separator because the while-loop condition `len(s) > 3` is never satisfied.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/thousand-separator-no-dot-for-small-inputs.json"},{"id":"thousand-separator-pure-string-ops","text":"The thousand-separator solution uses only string slicing and list operations — no imports, format specifiers, regex, or locale-dependent formatting.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/thousand-separator-pure-string-ops.json"},{"id":"thousand-separator-right-to-left-chunking","text":"The thousand-separator solution removes exactly 3 characters per iteration from the right of the string, guaranteeing uniform chunk sizes except for the leftmost group (1–3 chars).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/thousand-separator-right-to-left-chunking.json"},{"id":"three-consecutive-odds-counter-invariant","text":"In `threeConsecutiveOdds`, the `count` variable always equals the length of the current run of consecutive odd elements ending at the current position, resetting to 0 on any even element.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-consecutive-odds-counter-invariant.json"},{"id":"three-consecutive-odds-early-exit","text":"`threeConsecutiveOdds` returns `True` immediately upon finding the first qualifying triplet, short-circuiting the remainder of the array scan.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-consecutive-odds-early-exit.json"},{"id":"three-consecutive-odds-positive-only-modulo","text":"`threeConsecutiveOdds` checks oddness via `num % 2 == 1`, which is correct only for non-negative integers; negative odds yield `-1` from `%`, but the problem constraint `1 <= arr[i] <= 1000` makes this safe.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-consecutive-odds-positive-only-modulo.json"},{"id":"three-divisors-perfect-square-prime","text":"`isThreeDivisors` encodes the number-theory result that τ(n)=3 iff n=p² for prime p, reducing a divisor-counting problem to a perfect-square check followed by a primality test on the root.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-divisors-perfect-square-prime.json"},{"id":"three-divisors-quarter-root-complexity","text":"The primality check in `isThreeDivisors` runs trial division on `sqrt(n)` up to `isqrt(sqrt(n))`, giving O(n^(1/4)) overall time — faster than the O(√n) brute-force divisor count.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-divisors-quarter-root-complexity.json"},{"id":"three-parts-cumulative-boundary","text":"Partition boundaries are detected via `running_sum == target * (parts_found + 1)`, which relies on parts_found incrementing sequentially from 0 to 1 to 2","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-parts-cumulative-boundary.json"},{"id":"three-parts-divisibility-precondition","text":"The method returns False immediately when the array sum is not divisible by 3, before scanning any elements","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-parts-divisibility-precondition.json"},{"id":"three-parts-linear-complexity","text":"The algorithm performs exactly one pass over the array after the initial sum, achieving O(n) time and O(1) auxiliary space","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-parts-linear-complexity.json"},{"id":"three-parts-nonempty-guarantee","text":"The loop bound `range(len(arr) - 1)` ensures the third partition always contains at least one element when True is returned","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-parts-nonempty-guarantee.json"},{"id":"three-parts-zero-sum-correct","text":"When `total == 0`, `target == 0` and the cumulative check still works correctly — finds two prefixes summing to 0, with the remainder guaranteed to sum to 0","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-parts-zero-sum-correct.json"},{"id":"three-pointer-linear-time-constant-space","text":"The three-pointer intersection algorithm runs in O(n1 + n2 + n3) time with O(1) auxiliary space by always advancing the pointer at the smallest current value.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-pointer-linear-time-constant-space.json"},{"id":"three-pointer-requires-strictly-sorted-input","text":"`arraysIntersection` produces correct results only when all three input arrays are sorted in strictly increasing order (no duplicates within a single array); unsorted input causes the pointer-advance logic to skip valid matches.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/three-pointer-requires-strictly-sorted-input.json"},{"id":"three-strategies-cover-solution-taxonomy","text":"The solution space is largely covered by three strategy families — single-pass streaming for accumulation and counting, sort-then-scan for pair and ordering problems, and closed-form mathematical reduction for structurally reducible problems — though not every solution maps neatly to exactly one category.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/three-strategies-cover-solution-taxonomy.json"},{"id":"tickets-k-must-be-positive","text":"`time_to_buy_tickets` assumes `tickets[k] >= 1`; if `tickets[k]` were 0, the expression `tickets[k] - 1` becomes -1, causing incorrect negative contributions from `min` for post-k elements.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tickets-k-must-be-positive.json"},{"id":"tickets-pure-function-no-deps","text":"`time_to_buy_tickets` is a standalone pure function with zero imports and no side effects, taking `(tickets, k)` and returning an integer.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tickets-pure-function-no-deps.json"},{"id":"tickets-simulation-avoidance","text":"`time_to_buy_tickets` replaces an O(n·max(tickets)) queue simulation with an O(n) single-pass formula that computes each person's contribution based on their position relative to index k.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tickets-simulation-avoidance.json"},{"id":"tickets-split-at-k-boundary","text":"In `time_to_buy_tickets`, people at indices ≤ k contribute `min(t, tickets[k])` seconds and people at indices > k contribute `min(t, tickets[k] - 1)` seconds, because post-k people do not get a turn in k's final round.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tickets-split-at-k-boundary.json"},{"id":"tictactoe-eager-win-check-all-moves","text":"Win detection runs after every move by checking all 8 winning lines, so the first player to complete a line wins immediately and later moves are never evaluated.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tictactoe-eager-win-check-all-moves.json"},{"id":"tictactoe-function-misnamed","text":"The tic-tac-toe solution exports a function named `validateBinaryTreeNodes` instead of a tic-tac-toe-related name, indicating a copy-paste naming error that tests depend on.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tictactoe-function-misnamed.json"},{"id":"tictactoe-trailing-space-returns","text":"All four return values from the tic-tac-toe solution include a trailing space (`\"A \"`, `\"B \"`, `\"Draw \"`, `\"Pending \"`); tests must match this exact format.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tictactoe-trailing-space-returns.json"},{"id":"tie-breaking-earliest-year","text":"`maxAliveYear` uses strict `>` in its comparison so the left-to-right scan naturally returns the earliest year when multiple years share peak population.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tie-breaking-earliest-year.json"},{"id":"time-complexity-sort-then-reduce","text":"`maxValueAfterOperations` runs in O(m * n log n) — dominated by sorting m rows of length n — followed by an O(m * n) column-max scan.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/time-complexity-sort-then-reduce.json"},{"id":"toeplitz-neighbor-equivalence","text":"The Toeplitz check verifies `matrix[i][j] == matrix[i-1][j-1]` for all interior cells rather than enumerating diagonals explicitly; this is equivalent by transitivity of equality along each diagonal.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/toeplitz-neighbor-equivalence.json"},{"id":"toeplitz-short-circuits-on-mismatch","text":"`isToeplitzMatrix` returns `False` on the first cell that differs from its diagonal predecessor, skipping all remaining comparisons.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/toeplitz-short-circuits-on-mismatch.json"},{"id":"toeplitz-trivial-for-single-dimension","text":"A 1×n or m×1 matrix is trivially Toeplitz because the loop ranges `range(1, 1)` are empty, so the method returns `True` without executing any comparisons.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/toeplitz-trivial-for-single-dimension.json"},{"id":"top-projection-counts-nonzero-cells","text":"The xy (top-down) projection area equals the count of cells where `grid[i][j] > 0`, not the sum of cell values — each non-empty stack casts exactly one unit square","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/top-projection-counts-nonzero-cells.json"},{"id":"trailing-space-in-poker-output","text":"All return strings in `best_poker_hand` end with a trailing space (e.g., `\"Flush \"`, `\"Pair \"`), matching LeetCode's expected output format exactly.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/trailing-space-in-poker-output.json"},{"id":"transpose-empty-input-raises","text":"`transpose([])` raises `IndexError` because the code unconditionally accesses `matrix[0]` to determine the column count; this is safe under LeetCode's constraint `m >= 1`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/transpose-empty-input-raises.json"},{"id":"transpose-index-identity","text":"The output of `transpose` satisfies `result[j][i] == matrix[i][j]` for all valid `(i, j)`, achieved by swapping the outer/inner loop indices in a nested list comprehension.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/transpose-index-identity.json"},{"id":"transpose-output-dimensions-swapped","text":"`transpose` always returns an `n × m` matrix from an `m × n` input, constructing a new list-of-lists; it never modifies the input in place.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/transpose-output-dimensions-swapped.json"},{"id":"traversal-accumulation-universal-across-data-structures","text":"The single-traversal accumulation paradigm — visit each element once while maintaining state via accumulators — is a recurring algorithmic shape across data structures: arrays use left-to-right streaming with scalar variables, and trees use DFS with closure-captured variables. Both achieve efficient single-pass O(n) computation, suggesting that traversal-order discipline is a primary mechanism for correctness in these patterns.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/traversal-accumulation-universal-across-data-structures.json"},{"id":"tree-postorder-closure-idiom","text":"Tree solutions combine closure-based DFS (capturing mutable result variables from the enclosing scope for side-effect accumulation) with postorder return values (propagating subtree summaries upward for recursive composition), enabling single-pass O(n) tree computations that both accumulate a global answer and compose local results.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/tree-postorder-closure-idiom.json"},{"id":"tree-serialization-helpers-duplicated","text":"`list_to_tree` and `tree_to_list` BFS serialization helpers are duplicated per tree problem rather than shared from a common module.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tree-serialization-helpers-duplicated.json"},{"id":"tree-to-list-strips-trailing-nones","text":"`tree_to_list` removes trailing `None` values from its BFS serialization, making `[1, None, 2]` and `[1, None, 2, None, None]` equivalent representations.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tree-to-list-strips-trailing-nones.json"},{"id":"tree-to-list-strips-trailing-nulls","text":"`tree_to_list` removes all trailing `None` entries from its BFS level-order output, matching LeetCode's canonical serialization format.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tree-to-list-strips-trailing-nulls.json"},{"id":"tree2str-empty-left-parens-preserved","text":"`tree2str` emits `()` for a missing left child if and only if the right child exists, preserving positional unambiguity in the serialized output.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tree2str-empty-left-parens-preserved.json"},{"id":"tree2str-handles-negative-vals","text":"Negative node values are serialized correctly (e.g., `-1(-2)(-3)`) with no special-case logic — `str()` handles the sign naturally.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tree2str-handles-negative-vals.json"},{"id":"tree2str-local-treenode","text":"`tree2str` defines `TreeNode` locally rather than importing from a shared module, making the solution self-contained for LeetCode submission.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tree2str-local-treenode.json"},{"id":"tree2str-no-unnecessary-right-parens","text":"`tree2str` never emits parentheses for an absent right child, regardless of whether the left child exists — the asymmetric conditional (`if root.left or root.right` vs. `if root.right`) encodes this rule.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tree2str-no-unnecessary-right-parens.json"},{"id":"treenode-canonical-definition","text":"`TreeNode` with `val`, `left`, `right` is the canonical binary tree node definition, redefined per-file to match LeetCode's interface rather than shared from a common module.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/treenode-canonical-definition.json"},{"id":"treenode-defined-in-multiple-files","text":"`TreeNode` is defined locally in multiple solution files (`same-tree/solution.py`, `root-equals-sum-of-children/solution.py`, and likely others) rather than in a single shared location.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/treenode-defined-in-multiple-files.json"},{"id":"treenode-defined-locally-per-solution","text":"`TreeNode` is defined locally in each tree-problem solution file rather than imported from a shared module, making each solution independently runnable.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/treenode-defined-locally-per-solution.json"},{"id":"treenode-is-de-facto-shared-via-inline-copies","text":"`TreeNode` is defined inline in each tree-problem solution file rather than in a shared module, yet hundreds of test files import it from individual solutions — making each copy a critical dependency despite the duplication.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/treenode-is-de-facto-shared-via-inline-copies.json"},{"id":"treenode-is-shared-canonical-definition","text":"`TreeNode` in `convert-sorted-array-to-binary-search-tree/solution.py` is imported by 300+ test files across the repo, serving as the de facto canonical binary tree node definition.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/treenode-is-shared-canonical-definition.json"},{"id":"treenode-redefined-per-problem","text":"`TreeNode` is defined locally in each tree problem's `solution.py` rather than imported from a shared module, matching LeetCode's submission format and keeping each problem directory self-contained","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/treenode-redefined-per-problem.json"},{"id":"treenode-shared-definition-in-preorder","text":"`TreeNode` defined in `binary-tree-preorder-traversal/solution.py` is imported by 400+ test files across the repo, making it the de facto shared binary tree node class — changes to its constructor signature are breaking.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/treenode-shared-definition-in-preorder.json"},{"id":"treenode-shared-dependency","text":"The `TreeNode` class defined in `average-of-levels-in-binary-tree/solution.py` is imported by hundreds of test files across the repo, making it a de facto shared data structure whose signature changes have high blast radius.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/treenode-shared-dependency.json"},{"id":"trial-division-pattern-reuse","text":"The strip-all-factors-then-check-residual pattern (used in `ugly-number`) recurs in `power-of-two`, `power-of-three`, `power-of-four`, and `three-divisors` solutions","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/trial-division-pattern-reuse.json"},{"id":"triangular-number-correctness","text":"A run of `n` identical characters contributes exactly `n*(n+1)/2` single-character substrings, and the integer division is always exact because one of `n` or `n+1` is even","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/triangular-number-correctness.json"},{"id":"tribonacci-base-cases-complete","text":"The three Tribonacci base cases T(0)=0, T(1)=1, T(2)=1 are handled via early returns before the loop, so the loop range `3..n` never executes for n < 3.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tribonacci-base-cases-complete.json"},{"id":"tribonacci-iterative-o1-space","text":"`tribonacci` uses O(1) auxiliary space via a three-variable sliding window `(a, b, c)`, not memoization or a DP array.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tribonacci-iterative-o1-space.json"},{"id":"tribonacci-tuple-swap-correctness","text":"The simultaneous tuple assignment `a, b, c = b, c, a+b+c` evaluates all RHS values before any assignment, ensuring correctness without temporary variables — a Python-specific idiom critical to the sliding-window recurrence.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/tribonacci-tuple-swap-correctness.json"},{"id":"trim-mean-mutates-input","text":"`trimMean` calls `arr.sort()` which modifies the caller's list in-place, destroying original element ordering.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/trim-mean-mutates-input.json"},{"id":"trim-mean-removes-exactly-5-percent-each-end","text":"`trimMean` removes `len(arr) // 20` elements from both the low and high ends, which equals exactly 5% when `len(arr)` is a multiple of 20; silently trims fewer than 5% otherwise.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/trim-mean-removes-exactly-5-percent-each-end.json"},{"id":"trim-mean-safe-under-constraints","text":"Division by zero cannot occur in `trimMean` when `len(arr) >= 20`, since the trimmed slice retains at least `len(arr) - 2*(len(arr)//20)` elements (minimum 18 for a 20-element input).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/trim-mean-safe-under-constraints.json"},{"id":"trim-mean-time-complexity-is-sort-dominated","text":"`trimMean` is O(n log n) dominated by the sort; the subsequent slice and sum are O(n).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/trim-mean-time-complexity-is-sort-dominated.json"},{"id":"triple-optimization-unified-by-pipeline-decomposition","text":"The pipeline architecture simultaneously achieves three optimizations through a single structural decomposition: correctness (construction techniques prevent errors at each phase boundary), efficiency (mathematical reduction and early exit eliminate work within phases), and resource minimization (streaming minimizes time while mutation minimizes space) — these are co-products of the pipeline, not independently layered concerns.","truth_value":"OUT","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/triple-optimization-unified-by-pipeline-decomposition.json"},{"id":"triple-stabilization-across-orthogonal-dimensions","text":"The system is stabilized by three independent mechanisms operating on orthogonal dimensions: correctness is dual-stabilized (paradigmatic convergence + construction techniques), the quality profile is dual-stabilized (domain attractor + self-reinforcing equilibrium), and defect tolerance is self-reinforced by the quality equilibrium itself — making the system triply resilient because any single destabilization affects only one dimension.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"derived","url":"/public/leetcode-expert/belief/triple-stabilization-across-orthogonal-dimensions.json"},{"id":"triplet-no-index-tracking","text":"Despite the problem requiring `i < j < k` ordering, `countTriplets` never tracks indices — the product `a * b * c` (one element from each of three distinct-value groups) maps 1-to-1 to ordered index triples.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/triplet-no-index-tracking.json"},{"id":"triplet-order-independence","text":"The group-contribution sweep in `countTriplets` produces the same result regardless of iteration order over `Counter.values()`, because each triple of distinct groups is counted exactly once when its \"middle\" group (in processing order) is visited.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/triplet-order-independence.json"},{"id":"truncate-sentence-safe-overslice","text":"`truncateSentence` safely handles `k` greater than the word count by returning the full sentence, relying on Python's slice semantics rather than explicit bounds checking.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/truncate-sentence-safe-overslice.json"},{"id":"twenty-dollar-bills-never-tracked","text":"The lemonade-change solution tracks only $5 and $10 bill counts; $20 bills are never stored because they can never be used as change.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/twenty-dollar-bills-never-tracked.json"},{"id":"two-char-alphabet-bounds-answer-to-two","text":"For palindromic-subsequence removal over a 2-character alphabet, the answer is always in `{0, 1, 2}` — remove all of one character in one step, all of the other in a second step. This bound breaks with 3+ characters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-char-alphabet-bounds-answer-to-two.json"},{"id":"two-digit-construction-commutative","text":"The `min(a,b)*10 + max(a,b)` formula produces the correct smallest two-digit number regardless of which array contributes the smaller minimum.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-digit-construction-commutative.json"},{"id":"two-max-tracker-ge-not-gt","text":"In the two-max tracking idiom (`max_product`), the primary branch uses `>=` (not `>`), which is critical for correctness: with `>`, an array of identical values would leave `max2` at the initial value of 0 instead of being promoted.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-max-tracker-ge-not-gt.json"},{"id":"two-out-of-three-set-algebra","text":"The Two Out of Three solution expresses \"appears in >= 2 of 3 arrays\" as the union of all pairwise set intersections: `(s1 & s2) | (s1 & s3) | (s2 & s3)`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-out-of-three-set-algebra.json"},{"id":"two-out-of-three-wrong-name","text":"The function implementing LeetCode 2032 (Two Out of Three) is misnamed `largest_odd`, a copy-paste error from another solution file.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-out-of-three-wrong-name.json"},{"id":"two-paradigms-cover-solution-space","text":"Nearly all solutions follow one of two dominant paradigms — single-pass streaming with O(1) accumulators for counting, tracking, and accumulation problems, or sort-then-two-pointer for pair-finding, ordering, and constraint-satisfaction problems — with the choice determined by whether the problem requires aggregation or search.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/two-paradigms-cover-solution-space.json"},{"id":"two-pointer-backward-fill-avoids-sort","text":"The squares-of-sorted-array solution fills the result array from index n-1 down to 0 using two inward-converging pointers, achieving O(n) time instead of O(n log n) square-then-sort","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-pointer-backward-fill-avoids-sort.json"},{"id":"two-pointer-compaction-extends-streaming-to-in-place-transform","text":"The read/write pointer compaction idiom (used for remove-duplicates, remove-element, move-zeroes) extends single-pass streaming from pure scalar accumulation to in-place array transformation: instead of reducing the input to a scalar accumulator, the write pointer constructs the output array in-place while the read pointer streams through the input, achieving O(1) auxiliary space via mutation rather than via scalar reduction — broadening the streaming paradigm's applicability to problems whose output is a transformed array, not a single value.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/two-pointer-compaction-extends-streaming-to-in-place-transform.json"},{"id":"two-pointer-compaction-family","text":"Problems 26 (remove duplicates), 27 (remove element), and 283 (move zeroes) all use the same read/write pointer compaction pattern with different keep-predicates; the structural code is identical, only the filter condition varies.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-pointer-compaction-family.json"},{"id":"two-pointer-convergence-linear-time","text":"The converging two-pointer pattern in `reverse-only-letters` runs in O(n) time because each pointer advances monotonically inward, collectively visiting each index at most once.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-pointer-convergence-linear-time.json"},{"id":"two-pointer-convergence-pattern","text":"The walk-inward two-pointer technique (left pointer advances right, right pointer advances left, check convergence) recurs across mountain-array, palindrome, and sorted-array solutions.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-pointer-convergence-pattern.json"},{"id":"two-pointer-inward-sweep-pattern","text":"The two-pointer inward sweep (left from 0, right from end, march inward with subset-specific skip logic) is a recurring pattern used by `reverse-vowels-of-a-string` and `reverse-only-letters` for reversing a character subset in-place.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-pointer-inward-sweep-pattern.json"},{"id":"two-pointer-is-dual-cursor-streaming","text":"Two-pointer techniques are a structural variant of single-pass streaming using paired cursors: they share streaming's core properties (monotonic progress, O(1) state, single traversal) but generalize the scan by allowing convergent or divergent cursor movement, making them streaming algorithms with a richer cursor model.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/two-pointer-is-dual-cursor-streaming.json"},{"id":"two-pointer-merge-scan-for-sorted-intersection","text":"`min_common_number` uses the two-pointer merge-scan pattern: advance the pointer on the smaller value, return on equality — the canonical O(n+m) time, O(1) space approach for finding common elements in two sorted arrays.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-pointer-merge-scan-for-sorted-intersection.json"},{"id":"two-pointer-pattern-variants","text":"The repo contains multiple two-pointer variants: inward sweep (valid-palindrome), lockstep with skip (valid-word-abbreviation), and matrix transpose walk (valid-word-square) — all sharing the fail-fast early-return idiom.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-pointer-pattern-variants.json"},{"id":"two-pointer-primary-linear-array-technique","text":"Converging two-pointer patterns — forward/backward fill, inward squeeze, and sorted-pair matching — are the dominant technique for achieving O(n) time on array pair and partition problems.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/two-pointer-primary-linear-array-technique.json"},{"id":"two-pointer-sorted-array-pattern","text":"Solutions pairing min/max elements (e.g., distinct averages) sort once then walk inward with left/right pointers rather than simulating repeated removal, achieving O(n log n) overall.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-pointer-sorted-array-pattern.json"},{"id":"two-preprocessing-paradigms-partition-problems","text":"Problems partition by which preprocessing unlocks linear-time solution: hashing (Counter/set) for membership and frequency queries vs sorting for positional and pair relationships, with the core query type — lookup or comparison — determining which paradigm applies.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"invalid","source_type":"","url":"/public/leetcode-expert/belief/two-preprocessing-paradigms-partition-problems.json"},{"id":"two-solution-conventions-coexist","text":"The repo uses two conventions for solution entry points: `Solution` class with a method (LeetCode boilerplate style, e.g., `runningSum`) and standalone module-level functions (e.g., `is_same_tree`, `can_transform`, `roman_to_int`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-solution-conventions-coexist.json"},{"id":"two-stack-queue-amortized-o1","text":"Every element in `MyQueue` is transferred from `_in_stack` to `_out_stack` exactly once across its lifetime, so `push`, `pop`, and `peek` are all amortized O(1) despite O(n) worst-case transfers.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-stack-queue-amortized-o1.json"},{"id":"two-stack-queue-amortized-via-lazy-transfer","text":"The two-stack queue achieves correct FIFO semantics with amortized O(1) per operation through lazy bulk transfer: each element crosses from input to output stack exactly once across its lifetime, push is worst-case O(1) (never triggers transfer), and the deferred reversal preserves total ordering.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/two-stack-queue-amortized-via-lazy-transfer.json"},{"id":"two-stack-queue-lazy-transfer","text":"`_transfer` only moves elements when `_out_stack` is empty — it never re-reverses elements already in `_out_stack`, which is the key invariant preserving both correctness and amortized cost.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-stack-queue-lazy-transfer.json"},{"id":"two-stack-queue-push-always-o1","text":"`push` always appends to `_in_stack` and never triggers a transfer, making it worst-case O(1) — not just amortized — unlike `pop` and `peek` which may trigger O(n) transfers.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-stack-queue-push-always-o1.json"},{"id":"two-sum-complement-lookup-pattern","text":"`twoSum` uses a hash map keyed by value (not index) to check whether the complement `target - num` has been seen, which is the canonical O(n) complement lookup idiom","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-complement-lookup-pattern.json"},{"id":"two-sum-family-spans-lookup-strategy-space","text":"The Two Sum problem family collectively spans the lookup strategy space: hash map for O(1) complement lookup with check-before-insert ordering (classic), frequency counter for duplicate-aware pairing (III), hash set for tree-traversal membership with check-before-insert preventing self-pairing (IV), and sort plus two-pointer for inequality-bounded search (less-than-k) — demonstrating that a single problem concept exercises all major lookup mechanisms in the repo's abstraction trio.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/two-sum-family-spans-lookup-strategy-space.json"},{"id":"two-sum-iii-add-find-asymmetry","text":"`TwoSum` optimizes `add()` to O(1) at the cost of O(n) `find()`; the inverse tradeoff (precompute all sums on add, O(1) find) would be better when finds dominate.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-iii-add-find-asymmetry.json"},{"id":"two-sum-iii-self-pair-requires-count-two","text":"In `TwoSum.find()`, a number can only pair with itself to reach a target if its count in the `Counter` is >= 2; this prevents `add(3); find(6)` from returning `True`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-iii-self-pair-requires-count-two.json"},{"id":"two-sum-implicit-none-on-no-solution","text":"If no valid pair exists (violating the problem contract), the function silently returns `None` rather than raising","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-implicit-none-on-no-solution.json"},{"id":"two-sum-index-ordering","text":"The returned indices are always in ascending order because values enter `seen` strictly before the current index","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-index-ordering.json"},{"id":"two-sum-instantiates-hash-pipeline","text":"The Two Sum family is a canonical instantiation of the hash-then-stream pipeline: the hash map serves as the O(1) preprocessing structure for complement lookup while the single-pass array scan constitutes the streaming phase, with check-before-insert ordering providing construction-based correctness — paralleling palindrome's instantiation through Counter and demonstrating the pipeline's universality across point-lookup and aggregate-frequency query modes.","truth_value":"IN","justification_count":1,"dependent_count":0,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"insufficient","source_type":"derived","url":"/public/leetcode-expert/belief/two-sum-instantiates-hash-pipeline.json"},{"id":"two-sum-iv-check-before-insert","text":"`findTarget` prevents self-pairing by checking the `seen` set *before* inserting the current node's value — the ordering of check-then-add is the critical invariant.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-iv-check-before-insert.json"},{"id":"two-sum-iv-ignores-bst-property","text":"`findTarget` uses a generic hash-set approach that works on any binary tree; it does not exploit BST ordering, trading potential O(log n) space for implementation simplicity.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-iv-ignores-bst-property.json"},{"id":"two-sum-less-than-k-monotonic-convergence","text":"Each loop iteration moves exactly one pointer inward, guaranteeing termination in at most n-1 steps","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-less-than-k-monotonic-convergence.json"},{"id":"two-sum-less-than-k-returns-neg-one","text":"The function returns `-1` (not `None` or an exception) when no pair sum is strictly less than `k`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-less-than-k-returns-neg-one.json"},{"id":"two-sum-less-than-k-sort-mutates","text":"`max_sum_under_k` mutates the input list via in-place sort; callers that need the original order must copy first","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-less-than-k-sort-mutates.json"},{"id":"two-sum-less-than-k-strict-inequality","text":"The comparison is `s < k` (strict), not `s <= k`; a pair summing exactly to `k` is excluded","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-less-than-k-strict-inequality.json"},{"id":"two-sum-less-than-k-time-complexity","text":"The algorithm runs in O(n log n) time and O(1) auxiliary space via sort + two-pointer","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-less-than-k-time-complexity.json"},{"id":"two-sum-no-self-pair","text":"An element cannot pair with itself; the lookup-before-insert order prevents `seen[num]` from matching the current index","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-no-self-pair.json"},{"id":"two-sum-single-pass-linear","text":"`twoSum` runs in O(n) time and O(n) space via a single-pass hash map, never iterating the array more than once","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/two-sum-single-pass-linear.json"},{"id":"twos-complement-mask-pattern","text":"Solutions handling signed 32-bit integers use `num &= 0xFFFFFFFF` to reinterpret negative Python integers as unsigned 32-bit two's complement values, bridging Python's arbitrary-precision integers to fixed-width behavior.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/twos-complement-mask-pattern.json"},{"id":"typing-import-for-annotations","text":"The repo consistently uses `from typing import List` for type annotations rather than Python 3.9+ built-in `list[]` syntax.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/typing-import-for-annotations.json"},{"id":"typing-list-used-for-compatibility","text":"Solutions consistently use `typing.List` for type annotations rather than the built-in `list[str]` syntax available in Python 3.9+, maintaining backward compatibility across the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/typing-list-used-for-compatibility.json"},{"id":"ugly-number-complexity","text":"The total number of divisions across all three primes is O(log n), since each division at least halves `n`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ugly-number-complexity.json"},{"id":"ugly-number-one-is-ugly","text":"`is_ugly(1)` returns `True` because 1 has no prime factors, so the loop body never executes and `n == 1` holds","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ugly-number-one-is-ugly.json"},{"id":"ugly-number-trial-division-pattern","text":"`is_ugly` uses the strip-and-check-residual pattern: divide out all factors of 2, 3, and 5, then check if the remainder is 1","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ugly-number-trial-division-pattern.json"},{"id":"ugly-number-zero-guard","text":"`is_ugly(0)` returns `False` and never enters the division loop; without the `n <= 0` guard, `0 % 2 == 0` would loop forever","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/ugly-number-zero-guard.json"},{"id":"uncommon-concat-then-split","text":"Concatenating with a space and splitting is equivalent to splitting each sentence independently and merging, because `str.split()` handles multiple consecutive spaces","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/uncommon-concat-then-split.json"},{"id":"uncommon-counts-globally","text":"A word appearing twice in one sentence and zero times in the other is excluded; frequency is counted across the union, not per-sentence","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/uncommon-counts-globally.json"},{"id":"uncommon-output-order-is-insertion-order","text":"The returned list preserves the left-to-right first-occurrence order of words across the combined input (Python 3.7+ dict ordering guarantee)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/uncommon-output-order-is-insertion-order.json"},{"id":"uniform-frequency-set-idiom","text":"`len(set(counter.values())) == 1` is used as the canonical check for whether all character frequencies are equal throughout the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/uniform-frequency-set-idiom.json"},{"id":"union-by-rank-increments-on-tie-only","text":"Rank is incremented only when merging two roots of equal rank, maintaining it as an upper bound on subtree height.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/union-by-rank-increments-on-tie-only.json"},{"id":"union-find-uses-path-splitting","text":"The `find` function in `find-if-path-exists-in-graph/solution.py` uses iterative path splitting (`parent[x] = parent[parent[x]]`), which halves path length per traversal, not full recursive path compression that flattens to the root.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/union-find-uses-path-splitting.json"},{"id":"unknown-chars-treated-as-present","text":"Characters outside `{'A', 'L', 'P'}` fall into the `else` branch and behave identically to `'P'` (resetting late counter, not incrementing absences)","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/unknown-chars-treated-as-present.json"},{"id":"unlimited-swaps-equals-independent-sort","text":"For problems where unlimited swaps are allowed within a partition (e.g., same-parity digits), the optimal strategy reduces to sorting each partition group independently in descending order — this pattern appears in `largest-number-after-digit-swaps-by-parity` and likely recurs across similar problems","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/unlimited-swaps-equals-independent-sort.json"},{"id":"valid-palindrome-case-insensitive-at-compare","text":"Case normalization happens at comparison time via `.lower()`, not by preprocessing the entire string — the original string is never mutated or copied.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-palindrome-case-insensitive-at-compare.json"},{"id":"valid-palindrome-empty-is-palindrome","text":"An empty string or a string with no alphanumeric characters returns `True` because the outer loop condition `left < right` is never satisfied.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-palindrome-empty-is-palindrome.json"},{"id":"valid-palindrome-inner-loop-guards","text":"The inner skip loops re-check `left < right`, which prevents index-out-of-bounds on strings containing no alphanumeric characters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-palindrome-inner-loop-guards.json"},{"id":"valid-palindrome-uses-o1-space","text":"`isPalindrome` uses O(1) auxiliary space via two-pointer inward sweep; it never allocates a filtered or reversed copy of the input string.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-palindrome-uses-o1-space.json"},{"id":"valid-parentheses-final-stack-empty-check","text":"The final `return not stack` is required to reject inputs with unmatched openers (e.g., `\"(\"`); without it, any string whose closers all match would pass regardless of leftover openers.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-parentheses-final-stack-empty-check.json"},{"id":"valid-parentheses-match-dict-dual-use","text":"The `match` dict serves both as a closer-detection set (`ch in match`) and as a closer-to-opener lookup, eliminating the need for a separate set or if-chain.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-parentheses-match-dict-dual-use.json"},{"id":"valid-parentheses-no-index-error","text":"Short-circuit evaluation of `not stack or stack.pop() != match[ch]` guarantees `pop` is never called on an empty list; a lone closer like `\")\"` returns `False` without raising `IndexError`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-parentheses-no-index-error.json"},{"id":"valid-parentheses-single-pass-stack","text":"`is_valid` uses a single-pass stack-based approach with O(n) time and O(n) worst-case space; it short-circuits on the first mismatch.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-parentheses-single-pass-stack.json"},{"id":"valid-word-hyphen-boundary-safe","text":"The hyphen validation in `is_valid` checks `i == 0 or i == len(token) - 1` and returns `False` before accessing `token[i-1]` or `token[i+1]`, guaranteeing no `IndexError`","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-word-hyphen-boundary-safe.json"},{"id":"valid-word-punctuation-position-before-count","text":"A punctuation character not at the final position causes immediate rejection in `is_valid`, independent of `punct_count` — position is checked before count matters","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-word-punctuation-position-before-count.json"},{"id":"valid-word-single-pass-validation","text":"`is_valid` validates all character constraints (digits, hyphens, punctuation) in a single left-to-right pass with early returns — no regex or multi-pass scanning","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-word-single-pass-validation.json"},{"id":"valid-word-square-boundary-as-logic","text":"The three-part boundary condition (`j >= len(words)`, `i >= len(words[j])`, character mismatch) both enforces the word-square invariant and prevents all `IndexError` scenarios in a single expression.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-word-square-boundary-as-logic.json"},{"id":"valid-word-square-handles-ragged-input","text":"`valid_word_square` correctly handles words of different lengths without padding; a missing character position is treated as a structural mismatch.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-word-square-handles-ragged-input.json"},{"id":"valid-word-square-single-direction-sufficient","text":"Iterating only over existing characters in rows (not separately over columns) is sufficient to validate the word square because any extra column character at `(j, i)` would be caught when row `j` is iterated as the outer loop.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/valid-word-square-single-direction-sufficient.json"},{"id":"visit-all-points-order-is-fixed","text":"`minimum-time-visiting-all-points/solution.py` visits points strictly in input order — it solves a sequential traversal, not the traveling salesman problem.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/visit-all-points-order-is-fixed.json"},{"id":"visit-before-enqueue-prevents-duplicates","text":"In `matrix-cells-in-distance-order/solution.py`, marking cells as visited at enqueue time (not dequeue time) ensures each cell enters the queue at most once, preventing duplicate work and incorrect output.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/visit-before-enqueue-prevents-duplicates.json"},{"id":"vowel-set-module-level","text":"The `VOWELS` set in `count-the-number-of-vowel-strings-in-range/solution.py` is allocated once at module load, not per method call, paired with a module-level `is_vowel` helper outside the `Solution` class","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/vowel-set-module-level.json"},{"id":"vowel-strings-range-no-precomputation","text":"`vowelStrings` performs a single O(n) linear scan with no prefix sums or caching — repeated queries over the same array would each pay full cost","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/vowel-strings-range-no-precomputation.json"},{"id":"vowel-substring-consonant-break","text":"The inner loop `break` on consonants guarantees no substring containing a consonant is ever counted, and prunes all extensions from position `i` past the first consonant","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/vowel-substring-consonant-break.json"},{"id":"vowel-substrings-quadratic-by-design","text":"`count_vowel_substrings` is O(n²) worst-case by design, acceptable given the problem's n ≤ 100 constraint — an O(n) sliding-window solution exists but is not used here","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/vowel-substrings-quadratic-by-design.json"},{"id":"water-bottles-flat-function","text":"The water bottles solution uses a bare `numWaterBottles` function rather than a `Solution` class, diverging from the LeetCode class-based template used by other solutions in the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/water-bottles-flat-function.json"},{"id":"water-bottles-loop-terminates","text":"The water bottles simulation loop terminates for all valid inputs because `empties` strictly decreases each iteration when `numExchange >= 2`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/water-bottles-loop-terminates.json"},{"id":"water-bottles-simulation-not-closed-form","text":"The water bottles solution uses iterative greedy simulation (O(log n) rounds) even though an O(1) closed-form exists: `numBottles + (numBottles - 1) // (numExchange - 1)`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/water-bottles-simulation-not-closed-form.json"},{"id":"weakest-rows-ignores-sorted-row-property","text":"The k-weakest-rows solution uses `sum(row)` to count soldiers, ignoring the constraint that 1s always precede 0s — a property that would allow O(log n) binary search per row instead of O(n) summation.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/weakest-rows-ignores-sorted-row-property.json"},{"id":"weakest-rows-silent-truncation-on-large-k","text":"If `k > len(mat)`, the k-weakest-rows solution silently returns fewer than `k` elements via Python's slice behavior rather than raising an error.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/weakest-rows-silent-truncation-on-large-k.json"},{"id":"weakest-rows-stable-sort-tiebreak","text":"The k-weakest-rows solution relies on Python's stable sort guarantee for index-based tiebreaking rather than encoding row index as a secondary sort key.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/weakest-rows-stable-sort-tiebreak.json"},{"id":"week-k-total-is-28-plus-7k","text":"Each 0-indexed complete week `k` contributes exactly `28 + 7k` to the total; the formula sums this series as `28W + 7·W(W-1)/2` where `W` is the number of complete weeks.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/week-k-total-is-28-plus-7k.json"},{"id":"well-spaced-early-exit","text":"`well_spaced_string` returns `False` on the first letter pair that violates its distance constraint, short-circuiting without examining remaining letters.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/well-spaced-early-exit.json"},{"id":"well-spaced-exclusive-distance","text":"The distance formula `i - first_seen[c] - 1` counts characters *strictly between* the two occurrences, excluding both endpoints — matching the LeetCode problem's definition.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/well-spaced-exclusive-distance.json"},{"id":"well-spaced-first-seen-dict-pattern","text":"`well_spaced_string` uses the single-pass first-seen-index dict pattern: record each character's first index, act on the second occurrence — the same pattern used by two-sum, first-duplicate, and related problems.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/well-spaced-first-seen-dict-pattern.json"},{"id":"well-spaced-third-occurrence-bug","text":"If a letter appeared three times (violating the precondition), the third occurrence would silently compare against the first occurrence's index rather than the second — a latent bug guarded only by the problem's guarantee.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/well-spaced-third-occurrence-bug.json"},{"id":"within-domain-correctness-comprehensive","text":"Solutions achieve comprehensive correctness for all inputs within LeetCode's stated constraints, covering both edge cases (empty inputs, zero, single elements) and general cases (via construction techniques including exact arithmetic, sentinel initialization, and streaming invariants).","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/within-domain-correctness-comprehensive.json"},{"id":"word-abbreviation-colocated-tests","text":"`valid-word-abbreviation/solution.py` colocates implementation and 16 `unittest` test cases in a single module, runnable via `python -m unittest` — this is described as the standard layout across the repo.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/word-abbreviation-colocated-tests.json"},{"id":"work-elimination-at-two-abstraction-levels","text":"Solutions eliminate unnecessary computation at two levels: mathematical reduction removes entire computational phases (closed-form replaces iteration), while early-exit pruning removes unnecessary iterations within remaining phases — together minimizing work from both above and below.","truth_value":"OUT","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T09:26:29","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/work-elimination-at-two-abstraction-levels.json"},{"id":"wrap-case-output-is-sorted","text":"In the most-visited-sector solution, the wrap-around case (`start > end`) concatenates `range(1, end+1)` before `range(start, n+1)`, producing ascending order because `end < start` is a precondition of that branch.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/wrap-case-output-is-sorted.json"},{"id":"wrapper-name-mismatch-minimize-the-difference","text":"The module-level wrapper in `find-first-palindromic-string-in-the-array/solution.py` is named `minimizeTheDifference` despite solving a palindrome problem — likely a copy-paste artifact from the code generation pipeline.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/wrapper-name-mismatch-minimize-the-difference.json"},{"id":"wrapper-name-mismatch-pattern","text":"Some solutions have wrapper functions whose names don't match the problem semantics (e.g., `min_months` wrapping a pair-counting problem), suggesting automated generation of wrapper names rather than manual authoring.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/wrapper-name-mismatch-pattern.json"},{"id":"wrong-method-name-mctFromLeafValues","text":"`missing-number-in-arithmetic-progression/solution.py` has its method named `mctFromLeafValues` (from LeetCode 1130) but implements the missing-number-in-AP algorithm (LeetCode 1228) — a copy-paste naming bug.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/wrong-method-name-mctFromLeafValues.json"},{"id":"wrong-method-name-min-start-value","text":"`minimum-value-to-get-positive-step-by-step-sum/solution.py` has its method named `maxSideLength` (from LeetCode 1292) but implements `minStartValue` (LeetCode 1413) — a copy-paste naming bug.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/wrong-method-name-min-start-value.json"},{"id":"x-matrix-full-scan-required","text":"The X-matrix check must visit all `n*n` cells because off-diagonal zeros must be verified, not just diagonal non-zeros; checking only diagonals would miss non-zero off-diagonal elements.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/x-matrix-full-scan-required.json"},{"id":"xor-accumulator-identity-zero","text":"The XOR operation solution initializes its accumulator to `0` because `0` is the identity element for XOR (`x ^ 0 = x`), following the standard reduce-over-XOR idiom.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/xor-accumulator-identity-zero.json"},{"id":"xor-binary-flip-pattern","text":"The `^ 1` idiom for binary value inversion (0↔1) appears across multiple solutions in the repo, including `flipping-an-image`, `complement-of-base-10-integer`, and `number-complement`.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/xor-binary-flip-pattern.json"},{"id":"xor-cancellation-finds-extra-char","text":"`findTheDifference` uses XOR cancellation (`reduce(xor, ...)`) over the ordinals of `s + t` to isolate the single extra character — every matched character cancels to zero.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/xor-cancellation-finds-extra-char.json"},{"id":"xor-decode-deterministic","text":"Given `encoded` and `first`, the XOR decode produces exactly one valid original array — the decoding is unique because XOR is its own inverse (`a ^ b ^ b = a`).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/xor-decode-deterministic.json"},{"id":"xor-for-bit-diff","text":"XOR is the canonical idiom in this repo for isolating differing bit positions between two integers; `minBitFlips` and `hammingDistance` are functionally identical implementations of Hamming distance.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/xor-for-bit-diff.json"},{"id":"xor-instantiates-streaming-for-bit-domain","text":"XOR's three roles in the repo (cancellation for isolating unique elements, diffing for detecting bit changes, flipping for bitwise inversion) align naturally with the single-pass streaming paradigm — each role operates via simple accumulation or per-element transformation compatible with a left-to-right scan over O(1) state. This makes XOR a primary instantiation of the streaming shape for bit-manipulation problems, analogous to how frequency-counting accumulators serve the same role in other domains.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/xor-instantiates-streaming-for-bit-domain.json"},{"id":"xor-mask-width-matches-input","text":"The complement mask is always exactly `num.bit_length()` bits wide via `(1 << bit_length) - 1`, so the complement never introduces bits above the MSB of the input — this is what distinguishes it from a fixed-width (e.g., 32-bit) complement.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/xor-mask-width-matches-input.json"},{"id":"xor-op-virtual-array","text":"The XOR operation solution never allocates the array `nums[i] = start + 2*i`; elements are computed inline during the XOR fold, keeping space at O(1).","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/xor-op-virtual-array.json"},{"id":"xor-shift-produces-all-ones","text":"For any integer with alternating bits, `n ^ (n >> 1)` produces a value of the form `2^k - 1` (all ones), which is the invariant the solution checks.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/xor-shift-produces-all-ones.json"},{"id":"xor-universal-bit-primitive","text":"XOR serves as the universal primitive for bit-level computation across the repo, instantiated in three distinct roles: cancellation (isolating unique or extra elements via the self-inverse property), diffing (counting positional bit differences for Hamming distance), and flipping (toggling binary values via `^ 1`) — each exploiting a different algebraic property of the same operation.","truth_value":"IN","justification_count":1,"dependent_count":1,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"","url":"/public/leetcode-expert/belief/xor-universal-bit-primitive.json"},{"id":"zero-coupling-cost-invisible-at-runtime","text":"The costs of zero-coupling isolation — tooling confusion, naming drift, convention divergence, duplicated definitions — are exclusively non-runtime phenomena; at execution time, duplication is free (every copy is independently correct) and isolation's side effects (misleading imports, stale aliases) never manifest.","truth_value":"IN","justification_count":1,"dependent_count":2,"challenges":[],"last_reviewed":"2026-06-07T22:02:22","review_result":"pass","source_type":"derived","url":"/public/leetcode-expert/belief/zero-coupling-cost-invisible-at-runtime.json"},{"id":"zero-element-skipped-in-digit-sum","text":"A `0` element contributes nothing to `digit_sum` because the `while num > 0` loop body never executes for zero — correct under the LeetCode constraint `nums[i] >= 1` but would silently drop zeros if the constraint were relaxed.","truth_value":"IN","justification_count":0,"dependent_count":1,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/zero-element-skipped-in-digit-sum.json"},{"id":"zero-init-assumes-nonneg-input","text":"`max_product` initializes `max1 = max2 = 0`, which is only correct because the problem guarantees all elements are >= 1; negative inputs would never beat the initial zero and the tracker would silently return a wrong result.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/zero-init-assumes-nonneg-input.json"},{"id":"zero-input-returns-false","text":"Passing `num=0` to `is_perfect_square` returns `False` (the loop body never executes because `lo=1 > hi=0`), even though 0 is technically a perfect square — a known edge-case gap.","truth_value":"OUT","justification_count":0,"dependent_count":4,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/zero-input-returns-false.json"},{"id":"zero-input-returns-wrong-result","text":"`subtract_product_and_sum(0)` returns 1 (loop never executes, product=1 minus sum=0) which is mathematically incorrect, but the problem guarantees `n >= 1`","truth_value":"OUT","justification_count":0,"dependent_count":2,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/zero-input-returns-wrong-result.json"},{"id":"zero-on-empty-qualifying-set","text":"`average_even_divisible_by_three` returns 0 (not an error) when no elements satisfy the divisibility-by-6 filter, guarding against ZeroDivisionError with an explicit `if count` check.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/zero-on-empty-qualifying-set.json"},{"id":"zero-removal-required-for-correctness","text":"The `- {0}` set difference in `minOperations` is necessary for correctness: without it, an all-zeros input like `[0, 0, 0]` would incorrectly return `1` instead of `0`.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/zero-removal-required-for-correctness.json"},{"id":"zero-special-cased-in-hex-conversion","text":"`to_hex` special-cases zero with an early return because the digit-extraction loop requires `num > 0` to execute; without the guard, zero input produces an empty string.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/zero-special-cased-in-hex-conversion.json"},{"id":"zip-silent-truncation-risk","text":"`busyStudent` uses `zip(startTime, endTime)` which silently truncates to the shorter list if lengths differ — no error raised on mismatched inputs.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/zip-silent-truncation-risk.json"},{"id":"zip-truncates-silently-on-length-mismatch","text":"`min_moves_to_seat` uses `zip(sorted(seats), sorted(students))` — if the two lists differ in length, `zip` silently truncates to the shorter one, producing a wrong answer with no error.","truth_value":"IN","justification_count":0,"dependent_count":0,"challenges":[],"last_reviewed":null,"review_result":null,"source_type":"","url":"/public/leetcode-expert/belief/zip-truncates-silently-on-length-mismatch.json"}],"count":1790}