← OYO questions

Count elements reachable by adding/subtracting a and b to d

Filed under OYO

Given a starting integer d, two step values a and b, and an array of target integers targets, determine how many target integers can be formed by repeatedly adding or subtracting a and b to d any…

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.