Company: Ibm_23sep
Difficulty: medium
Split Into Two Problem Description Given an array of integers, find the number of ways to split the entire array into two non-empty subarrays, left and right, such that the sum of elements in the left subarray is greater than the sum of elements in the right subarray. Complete the function splitIntoTwo in the editor with the following parameter: int arr[n]: an integer array The function is expected to return an int , representing the number of ways to split the array such that the left sum is greater than the right sum. Input Format for Custom Testing Input from stdin will be processed as follows and passed to the function. In the first line, there is a single integer n . Each of the next n lines contains an integer, arr[i] . Examples Example 1: Input: arr = [10, 4, -8, 7] Output: 2 Explanation: There are three ways to split the array into two non-empty subarrays: Left: [10] , Right: [4, -8, 7] . Left sum = 10, Right sum = 3. Since 10 > 3, this split satisfies the condition. Left: [10,