#3729

Count Distinct Subarrays Divisible by K in Sorted Array

international master · 2050 · lc hard +32 · 27.4% accepted · 59 likes · top 5%

Description

Given an integer array nums sorted in non-descending order and a positive integer k, return the count of distinct subarrays whose element sum is divisible by k.

Code

1
2
3