{"results":[{"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":""},{"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":""},{"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":""},{"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":""},{"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":""},{"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":""},{"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":""},{"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":""},{"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":""},{"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":""},{"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"},{"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":""},{"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":""},{"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":""},{"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":""},{"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":""},{"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":""},{"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":""},{"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":""},{"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"}],"count":53,"limit":20,"offset":0}