You are viewing a single comment's thread. Return to all comments →
A naive rust approach:
fn divisibleSumPairs(n: i32, k: i32, ar: &[i32]) -> i32 { let mut x = 1; let mut n_pairs = 0; for &i in ar { for &j in &ar[x..] { if (i + j) % k == 0 { n_pairs += 1; } } x += 1; } n_pairs }
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 →
A naive rust approach: