Easiest C++ solution || Beginner-friendly approach || O(N) time complexity
Code\n\nclass Solution {\npublic:\n    int waysToSplitArray(vector<int>& nums) {\n        long long int sumLeft = 0, sumRight = 0, ans = 0;\n        for(int i=0
# Code\n```\nclass Solution {\npublic:\n    int waysToSplitArray(vector<int>& nums) {\n        long long int sumLeft = 0, sumRight = 0, ans = 0;\n        for(int i=0; i<nums.size(); i++)\n            sumRight += nums[i];\n        for(int i=0; i<nums.size()-1; i++){\n            sumLeft += nums[i];\n            sumRight -= nums[i];\n            if(sumLeft >= sumRight)\n                ans++;\n        }\n        return ans;\n    }\n};\n```
['C++']