Python 1-Liner Solution
Code\n\n\nclass Solution:\n    def kConcatenationMaxSum(self, arr: List[int], k: int) -> int:\n        return (max(list(accumulate(chain(*[arr]*(2-(k==1))),\n  
# Code\n```\n\nclass Solution:\n    def kConcatenationMaxSum(self, arr: List[int], k: int) -> int:\n        return (max(list(accumulate(chain(*[arr]*(2-(k==1))),\n                   lambda x,y: max(0,x+y), initial = 0))) + (k-2)*sum(arr)*(sum(arr)>0)*(k>1))%1000000007\n```
['Python3']