C++ Solution with simple loop
Simple solution in C++ using a single loop\n\nFirst of all I make sure that the start is always small than the destination (swap if need)\n\nLoop over all dista
Simple solution in C++ using a single loop\n\nFirst of all I make sure that the start is always small than the destination (swap if need)\n\nLoop over all distance and look if the distance is for clockwise (between start and destination numerically) else it\'s for counterclockwise\nreturn the smallest value\n\n```\nclass Solution {\npublic:\n    int distanceBetweenBusStops(vector<int>& distance, int start, int destination) {\n        int clockwise = 0;\n        int counterClockwise = 0;\n        int size = distance.size();\n        int tmp = start;\n\n        // Make start always shorter than destination\n        if (start > destination) {\n            start = destination;\n            destination = tmp;\n        }\n        \n        for (int i = 0; i < size; i++) {\n            if (i >= start && i < destination)\n                clockwise += distance[i];\n            else\n                counterClockwise += distance[i];\n        }\n        return (clockwise < counterClockwise) ? clockwise : counterClockwise;\n    }\n};\n```
[]