[Python3] 6-liner Kadane
\nclass Solution:\n    def kConcatenationMaxSum(self, arr: List[int], k: int, mod = 10 ** 9 + 7) -> int:\n        def Kadane(arr, res = 0, cur = 0):\n          
```\nclass Solution:\n    def kConcatenationMaxSum(self, arr: List[int], k: int, mod = 10 ** 9 + 7) -> int:\n        def Kadane(arr, res = 0, cur = 0):\n            for num in arr:\n                cur = max(num, num + cur)\n                res = max(res, cur)\n            return res\n        return ((k - 2) * max(sum(arr), 0) + Kadane(arr * 2)) % mod if k > 1 else Kadane(arr) % mod\n```
[]