key observation to solve this problem
We need the solve a function:F(A, K)\nwhat is its realtion with F(A, K-1)?\na simple observation is that F(A, K) >= F(A, K-1).\nSo when will F(A, K) > F(A, K-1)
We need the solve a function:**F(A, K)**\nwhat is its realtion with **F(A, K-1)**?\na simple observation is that F(A, K) >= F(A, K-1).\nSo when will F(A, K) > F(A, K-1)?\n**key observation here**: THe necessary condition\uFF08NOTE:not sufficient) is that all total K arrays must be utilized to make it greater than F(A, K-1).\n\npython code:\n```\ndef kConcatenationMaxSum(self, arr: List[int], k: int) -> int:\n\tdef mss(arr):\n\t\tacc = res = 0\n\t\tfor n in arr:\n\t\t\tacc += n\n\t\t\tif acc < 0:\n\t\t\t\tacc = 0\n\t\t\tres = max(acc, res)\n\t\treturn res\n\tr1, r2 = mss(arr), mss(arr * 2)\n\tif k == 1:\n\t\treturn r1\n\telse:\n\t\treturn max(r2, sum(arr) * k - (sum(arr) - r1)) %(10**9+7)\n```
[]