Simple C# solution with explanation
The basic idea is:\n1. If the sum of the array is negative or less than zero.\n    Then attempt to find the maximum sum subset in the concatenation of min(2, k)
The basic idea is:\n1. If the sum of the array is negative or less than zero.\n    Then attempt to find the maximum sum subset in the concatenation of min(2, k).\n\t\n2. If the sum of the array is postive.\n    Then attempt to find the best maximum sum subset in the concatenation of min(2, k). The best subset provides the right index to start and end with, and if you can imagine to insert the (k-2) arrays in the middle.\n\t\n\tSo, If k is greater than 2, add the (k-2)*(sum of array).\t\n\n\n```\n\npublic class Solution {\n    public int KConcatenationMaxSum(int[] arr, int k) {      \n        Int64 maxSum = 0;\n        int len = arr.Length;\n        \n        // Find the total sum of the array.\n        Int64 arrSum = 0;    \n        for(int i=0;i<len;i++)\n        {\n            arrSum += arr[i];\n        }\n        \n        maxSum = Math.Max(arrSum, maxSum);\n        \n        // Get the minimum, to consider the case when there is only one array.\n        int  loops = Math.Min(2, k);\n        \n        // Find the max sub array, when two arrays are concatenated.\n        Int64 sum=0;\n        for(int j=0;j<len*loops;j++)\n        {            \n                sum += arr[j%len];\n                if (sum>maxSum)\n                {\n                    maxSum = sum;\n                }\n            \n            // Reset the sum if it reaches negative.\n            if(sum<0) sum=0;\n        }\n        \n        // If the indiviaul array sum is greater than 0, add k>2, and the rest of the arrary sums.\n        if (k>2 && arrSum>0)\n        {\n            maxSum += (k-2)*arrSum;\n        }   \n        \n        return (int)(maxSum%(1000000007));\n    }\n}\n```\n
[]