Java program to count number of sub - arrays with even sum using an efficient algorithm Time Complexity - O ( N ) Space Complexity - O ( 1 )
import java . io . * ; class GFG { public static long countEvenSum ( int a [ ] , int n ) {