Simple Python Solution
\n    def kConcatenationMaxSum(self, arr: List[int], k: int) -> int:\n        def max_sum(lst):\n            n = len(lst)\n            max_ending_here, max_so_f
```\n    def kConcatenationMaxSum(self, arr: List[int], k: int) -> int:\n        def max_sum(lst):\n            n = len(lst)\n            max_ending_here, max_so_far = lst[0], lst[0]\n            for x in lst[1:]:\n                max_ending_here = max(max_ending_here + x, x)\n                max_so_far = max(max_so_far, max_ending_here)\n            return max_so_far\n        \n        if not arr:\n            return 0\n        s = sum(arr)\n        if k == 1:\n            return max(0, max_sum(arr)) % (10 ** 9 + 7)\n        else:\n            return max(0, (k - 2) * max(s, 0) + max_sum(arr + arr)) % (10 ** 9 + 7)\n```
[]