{"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","source":"entries/2026/06/06/number-of-arithmetic-triplets-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"arithmetic-triplets-set-lookup-linear","truth_value":"IN","reason":"premise"}]}}