Easy Faster Efficient Kadane application Java Soln
\nclass Solution {\n    private int kadane(int [] arr){\n        int csum = arr[0];\n        int msum = arr[0];\n        \n        for(int i = 1; i < arr.length
```\nclass Solution {\n    private int kadane(int [] arr){\n        int csum = arr[0];\n        int msum = arr[0];\n        \n        for(int i = 1; i < arr.length; i++){\n            int val = arr[i];\n            if(csum > 0){\n                csum += val;\n            } else {\n                csum = val;\n            }\n            msum = Math.max(csum, msum);\n        }\n        return msum;\n    }\n    private int kadaneOfTwo(int [] arr){\n        int [] narr = new int[2 * arr.length];\n        for(int i = 0; i < arr.length; i++){\n            narr[i] = arr[i];\n        }\n        for(int i = 0; i < arr.length; i++){\n            narr[i + arr.length] = arr[i];\n        }\n        return kadane(narr);\n    }\n    public int kConcatenationMaxSum(int[] arr, int k) {\n        long sum = 0;\n        for(int val : arr){\n            sum += val;\n        }\n        if(k == 1){\n            return kadane(arr);\n        } else if(sum < 0){\n            int res = kadaneOfTwo(arr);\n            return res < 0 ? 0 : res;\n        } else{\n            return (int)((kadaneOfTwo(arr) + (k - 2) * sum) % (1e9 + 7));\n        }\n    }\n}\n```
['Java']