โ† OYO questions

Count reachable values from d using +/- a and b within [0, 10^9]

Filed under OYO

Given a, b, and d, find the number of distinct non-negative values in [0, 10^9] reachable by adding/subtracting a or b from d.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related OYO questions

Collected from public candidate posts and coding forums. Updated Nov 2026.