Simple Solution Using Kadane's
\nclass Solution:\n    def kConcatenationMaxSum(self, arr: List[int], k: int) -> int:\n        def kadanes(nums):\n            curr_sum = nums[0]\n            b
```\nclass Solution:\n    def kConcatenationMaxSum(self, arr: List[int], k: int) -> int:\n        def kadanes(nums):\n            curr_sum = nums[0]\n            best_sum = nums[0]\n\n            for i in range(1, len(nums)):\n                curr_sum = max(curr_sum+nums[i], nums[i])\n                best_sum = max(curr_sum ,best_sum)\n\n            return best_sum\n\n\n        if k == 1:\n            return kadanes(arr) % (10**9 + 7)\n\n        else:\n            sm = sum(arr)\n\n            if sm < 0:\n                return kadanes(arr+arr) % (10**9 + 7) if result >= 0 else 0\n            else:\n                return (kadanes(arr+arr)+(k-2)*sm) % (10**9 + 7)\n```
[]