1. Engineering
  2. Computer Science
  3. please use python3 to solve the following question...

Question: please use python3 to solve the following question...

Question details

Please use Python3 to solve the following question:

We define a k-subsequence of an array as follows It is a subsequence of contiguous elements in the array, i.e. a subarray . The sum of the subsequences elements, s, is evenly divisible by k (ie: s % k-0). Given an array of integers, determine the number of k su sequences it contains. For example, k ) (5, 10, 11, 9,5).(10),110, 11, 9)(10,11, 9,5), 111, 9), 111, 9,5),15 and he array nums , a n·5 The subsequences are: 5 ii Function Description Complete the function kSub in the editor below. The function must return a long integer that represents the number of k-subsequences in the array nums kSub has the following parameter(s) k: an integer nums[nums(o]...numsn-1]): an array of integers Constraints 1sns3x 105 1sks 100 1 s numslils 10

Sample Input 0 Sample Output 0 4

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution