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