Program to divide the array into N continuous subarray so that the sum of each subarray is odd
Start from the first element of the array. Use a variable cur_sum to keep track of the current sum. Iterate the array till the cur_sum becomes odd, that becomes the first subarray. Then make cur_sum = 0 and start iterating the remaining array. Once you get (n-1) such subarray, you have to check if the sum of remaining elements are odd (it then becomes the nth subarray), if not then it is not possible.
The problem gives two inputs : The array(arr) and the times the number of subarrays to be made out of it(n). The sum of the subarrays should be odd 
It is already clear that if all the numbers are even. The odd sum subarray is not possible. For an odd sum , the continuous 2 numbers should be either odd+even or even+odd . But I can't seem to break them into N subarrays. Please Help with the logic.
I can be completely wrong with the logic. I just can't seem to get the hang of it.