Easy Solution
\nclass Solution {\npublic:\n    int kConcatenationMaxSum(vector<int>& arr, int k) {\n        int sum = arr[0], mx = arr[0];\n        int n = arr.size();\n     
```\nclass Solution {\npublic:\n    int kConcatenationMaxSum(vector<int>& arr, int k) {\n        int sum = arr[0], mx = arr[0];\n        int n = arr.size();\n        int64_t total = accumulate(arr.begin(), arr.end(), 0), mod = 1e9+7;\n        for(int i=1; i<n* min(k, 2); i++){\n            sum = max(arr[i%n], sum+arr[i%n]);\n            mx = max(mx, sum);\n        }\n        \n        return max<int64_t>({0, mx, total * max(0, k - 2) + mx}) % mod;\n    }\n};\n```
[]