title: Check if sum of subarray is a multiple of target
body: <p>I encountered this problem, where I have to check if there exists a subarray sum that is a multiple of a target value, and if the length of the subarray is at least 2.</p>
  <p>I've looked at one of the solution, which is below</p>
  <pre><code>class Solution():
      def checkSubarraySum(self, nums, k):
          &quot;&quot;&quot;
          :type nums: List[int]
          :type k: int
          :rtype: bool
          &quot;&quot;&quot;
          dic = {0:-1}
          summ = 0
          for i, n in enumerate(nums):
              if k != 0:
                  summ = (summ + n) % k
              else:
                  summ += n
              if summ not in dic:
                  dic[summ] = i
              else:
                  if i - dic[summ] &gt;= 2:
                      return True
          return False
  </code></pre>
  <p>What I don't understand is why it is &quot;i - dic[summ] &gt;= 2&quot; instead of greater or equal to 1? I assume it is checking whether the length is greater than 2, so wouldn't the difference of two indexes plus one be the length of the subarray?</p>