Easy Java Solution using Arrays - O(n)
This is one of the easiest question, where we need to compare leftsum and rightsum\n\nNote that we have to take leftSum and rightSum as long type and not of int
This is one of the easiest question, where we need to compare leftsum and rightsum\n\nNote that we have to take leftSum and rightSum as long type and not of int type looking at the constraints given in the problem.\n\nSteps: \n1.First Calculate the sum of all elements present in the array.\n2.Then Calculate left sum and rightSum for every index.\n3.Compare leftSum and rightSum and if leftSum>rightSum, then increment the value of count.\n4.return the count.\n\n```\n\nclass Solution {\n    public int waysToSplitArray(int[] nums) {\n        int n = nums.length;\n        int count = 0;\n        long sum = 0;\n        long leftSum = 0;\n        long rightSum = 0;\n        \n        for(int i=0;i<n;i++){\n            \n            sum += nums[i];\n        }\n        \n        for(int j = 0;j<n-1;j++){\n            leftSum += nums[j];\n            rightSum = sum-leftSum;\n    \n            if(leftSum>=rightSum){\n                count++;\n            }\n        }\n        \n        return count;\n    }\n}\n```\n\n## Please upvote if it helped.
['Array', 'Java']