Java program to count number of sub - arrays whose sum is even using brute force Time Complexity - O ( N ^ 2 ) Space Complexity - O ( 1 )
import java . io . * ; class GFG { static int countEvenSum ( int arr [ ] , int n ) { int result = 0 ;