{"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","source":"entries/2026/06/06/roman-to-integer-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"roman-subtraction-lookahead-pattern","truth_value":"IN","reason":"premise"}]}}