C++ | One pass | Easy to understand
\nclass Solution\n{\n    public:\n        int distanceBetweenBusStops(vector<int> &distance, int start, int destination)\n        {\n            int dist1, dist
```\nclass Solution\n{\n    public:\n        int distanceBetweenBusStops(vector<int> &distance, int start, int destination)\n        {\n            int dist1, dist2, sum = 0;\n            //we will start iterating from start position\n            int j = start;\n            int size = distance.size();\n\n            /*iterate completely from start to start to cover both the distances\n              1) start -> destination\n              2) destination -> start */\n            while (size)\n            {\n                sum += distance[j];\n                j++;\n                \n                if (j == distance.size())\n                    j = 0;\n                //destination reached from start - store the result\n                //now calculate distance from destination to start \n                if (j == destination)\n                {\n                    dist1 = sum;\n                    sum = 0;\n                }\n                size--;\n            }\n            //storing result from destination to start\n            dist2 = sum;\n            return min(dist1, dist2);\n        }\n};\n```
['C', 'C++']