โ† OYO questions

Count elements formed by adding/subtracting operations

Filed under OYO

Given an array A and integers a, b, and d, count how many elements x in A can be represented as x = d + n*a + m*b, where n and m are any integers (positive, negative, or zero).

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.