1 2 3 4 1/4 Completed Question 4 Triplets count You are given the following: • An integer N Array A containing N positiv
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
1 2 3 4 1/4 Completed Question 4 Triplets count You are given the following: • An integer N Array A containing N positiv
Question 4 Triplets count You are given the following: • An integer N Array A containing N positive integers (1-based) • Positive integer B ● Task 27°C Cloudy For each integer u, such that 0 ≤u< B, determine the number of triplets (i, j, k) satisfying 1 ≤i<j<k≤N and A, + Aj + Ak when divided by B leaves u as remainder. Mathematically, (A; + Aj + Ak) mod B = u. Example Assumptions • T = 1 • N = 3 ● A = [1, 2, 3] Max. score: 50.00 • B = 4
1 2 3 4 1/4 Completed