Finding whether Clockwise or Anti - clockwise path take minimum flip .
if ( valClockwise <= valAnticlockwise ) { if ( ! isOpposite ) cout << " Clockwise ▁ " << valClockwise << endl ; else cout << " Anti - clockwise ▁ " << valAnticlockwise << endl ; } else { if ( ! isOpposite ) cout << " Anti - clockwise ▁ " << valAnticlockwise << endl ; else cout << " Clockwise ▁ " << valClockwise << endl ; } }