We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Loop through the index of the array for x. Do the same for y for each x, but y is always greater then the current x. Check if the arrayvalues of the positions x and y as a sum is divisible by k. If true add 1 to the sum. Return the sum.
All in one line.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Divisible Sum Pairs
You are viewing a single comment's thread. Return to all comments →
Loop through the index of the array for x. Do the same for y for each x, but y is always greater then the current x. Check if the arrayvalues of the positions x and y as a sum is divisible by k. If true add 1 to the sum. Return the sum. All in one line.