โ† Infosys questions

Distinct pairs with sum divisible by m

Filed under Infosys

Given an array of n integers and an integer m, find the total number of distinct pairs (arr[i], arr[j]) with i < j such that their sum (arr[i] + arr[j]) is divisible by m.

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 Infosys questions

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