C ++ program to check Clockwise or counterclockwise order in an array
#include <bits/stdc++.h> NEW_LINE using namespace std ; bool check_order ( vector < int > arr ) { int cnt = 0 ; for ( int i = 0 ; i < arr . size ( ) - 1 ; i ++ ) { if ( abs ( arr [ i + 1 ] - arr [ i ] ) > 1 ) cnt ++ ; }