Driver Code
int main ( int argc , char const * argv [ ] ) { int arr [ ] = { -5 , -1 , 7 , 5 , 1 , -2 } ; int n = sizeof ( arr ) / sizeof ( arr [ 0 ] ) ; cout << longestSubArr ( arr , n ) << endl ; return 0 ; }