Given an integer array nums and an integer k, return the number of non-empty subarrays whose sum is divisible by k.
A subarray is a contiguous slice of the array. Note that nums may contain negative numbers, which is where most incorrect solutions break.