Easy c++ solution
\nclass Solution {\npublic:\n    int kadane(vector<int> &arr)\n    {\n      int sum = 0, maxsum = 0;\n      for(int it : arr)\n      {\n          sum = max(sum,
```\nclass Solution {\npublic:\n    int kadane(vector<int> &arr)\n    {\n      int sum = 0, maxsum = 0;\n      for(int it : arr)\n      {\n          sum = max(sum, 0) + it;\n          maxsum = max(sum, maxsum);\n      }\n      return maxsum;\n    }\n    \n    int kConcatenationMaxSum(vector<int>& arr, int k) {\n     const int mod = 1e9 + 7;\n     if( k == 1)\n     return kadane(arr);\n     int n = arr.size();\n     int sum = 0;\n     for(int it : arr)\n     {\n         sum = (sum + it)%mod;\n     }\n     arr.reserve(2 * n);\n     for (int i = 0; i < n; ++i)\n         arr.push_back(arr[i]);\n     int ans = kadane(arr);\n     if(sum <= 0)\n     return ans;\n     ans = (ans + long(k-2)*sum)%mod;\n     return ans;\n    }\n};\n```
['C']