✅C++ || Easy to Understand || Simple Sum || O(N)
Please Upvote If It Helps\n\n store total sum of nums in right_sum and iterate over nums\n\n add nums[i] in left sum and subtract nums[i] from right sum\n* when
**Please Upvote If It Helps**\n\n* store total sum of nums in right_sum and iterate over nums\n\n* add nums[i] in left sum and subtract nums[i] from right sum\n* when condition (left_sum>=right_sum) match increase valid_split by 1.\n\n```\nclass Solution {\npublic:\n    int waysToSplitArray(vector<int>& nums) \n    {\n        int valid_split=0;\n        long long right_sum=0;\n        long long left_sum =0;\n        \n        //counting the total sum and store it into the right sum\n        for(int i=0; i<nums.size(); i++) \n            right_sum += nums[i];\n        \n        for(int i=0; i<nums.size()-1; i++)\n        {\n            // add nums[i] in left sum \n            // subtract nums[i] from right sum\n            left_sum += nums[i];  \n            right_sum -= nums[i]; \n            \n            //check whether left_sum is greater than or equal to right_sum\n            //if it is , then increase split by 1\n            if(left_sum >= right_sum) \n                valid_split++; \n        }\n        return valid_split;    \n    }\n};\n```
[]