Find two non | Function to check if two non - intersecting subarrays with equal sum exists or not ; Sort the given array ; Traverse the array ; Check for duplicate elements ; If no duplicate element is present in the array ; Given array ; Size of array
function findSubarrays ( arr , N ) { arr . sort ( ) ; var i = 0 ; for ( i = 0 ; i < N - 1 ; i ++ ) { if ( arr [ i ] == arr [ i + 1 ] ) { document . write ( " " ) ; return ; } } document . write ( " " ) ; } var arr = [ 4 , 3 , 0 , 1 , 2 , 0 ] ; var N = arr . length ; findSubarrays ( arr , N ) ;