SmartNews interview question

Subarray mod K problem. Very similar to Leetcode 974