Easy C++ and Python solution using Kadane Algorithm
Code\nC++ []\nclass Solution {\npublic:\n    int kConcatenationMaxSum(vector<int>& arr, int k) {\n        long long m = 0, c = 0, MOD = 1e9+7;\n        for(int 
# Code\n```C++ []\nclass Solution {\npublic:\n    int kConcatenationMaxSum(vector<int>& arr, int k) {\n        long long m = 0, c = 0, MOD = 1e9+7;\n        for(int i = 0; i < arr.size(); i++) {\n            c += arr[i];\n            m = max(m, c);\n            if(c < 0) {\n                c = 0;\n            }\n        }\n        if(k == 1) {\n            return m % MOD;\n        } else {\n            vector<int> p = arr;\n            p.insert(p.end(), arr.begin(), arr.end());\n            m = 0, c = 0;\n            for(int i = 0; i < p.size(); i++) {\n                c += p[i];\n                m = max(m, c);\n                if(c < 0) {\n                    c = 0;\n                }\n            }\n           long long sum = 0;\n        for (auto& num : arr) {\n            sum += num;\n        }\n        long long o = m + ((k - 2) * sum);\n        return (sum < 0) ? m % MOD : o % MOD;\n\n        }\n    }\n};\n```\n```python []\nclass Solution(object):\n    def kConcatenationMaxSum(self, arr, k):\n        def mss(arr):\n            m=c=0\n            for i in range(len(arr)):\n                c+=arr[i]\n                m=max(m,c)\n                if c<0:\n                    c=0\n            return m\n        MOD=1000000007\n        if k==1:\n            return mss(arr)%MOD\n        else:\n            p=arr*2\n            m=mss(p)\n            o=m+((k-2)*sum(arr))\n            return m%MOD if sum(arr)<0 else o%MOD\n```
['Python', 'C++', 'Python3']