python-solution- day02
\nclass Solution:\n    def minSubarray(self, nums: List[int], p: int) -> int:\n        s = sum(nums)\n        r = s % p\n        if r == 0:\n            return 
```\nclass Solution:\n    def minSubarray(self, nums: List[int], p: int) -> int:\n        s = sum(nums)\n        r = s % p\n        if r == 0:\n            return 0\n        \n        pt = {0: -1}\n        c = 0\n        n = len(nums)\n        \n        for i, num in enumerate(nums):\n            c = (c + num) % p\n            \n            re = (c - r) % p\n            \n            if re in pt:\n                n = min(n, i - pt[re])\n            \n            pt[c] = i\n        \n        return n if n < len(nums) else -1\n```
['Python3']