The function checks if the array elements are consecutive If elements are consecutive , then returns true , else returns false
static bool areConsecutive ( int [ ] arr , int n ) { if ( n < 1 ) return false ;