C++ || swap || min || max || easy
\n\n# Code\n\nclass Solution {\npublic:\n    int distanceBetweenBusStops(vector<int>& distance, int start, int destination) {\n        int n = distance.size();\
\n\n# Code\n```\nclass Solution {\npublic:\n    int distanceBetweenBusStops(vector<int>& distance, int start, int destination) {\n        int n = distance.size();\n        int sum=0,suma=0;\n        if(start>destination){\n            std::swap(start,destination);\n        }\n        // int g=min(destination,start);\n        // int h = max(destination,start);\n        for(int i=start;i<destination;i++){\n            sum += distance[i];\n        }\n        cout<<" sum: "<<sum;\n        int ts=0;\n        for(int i=0;i<n;i++){\n            ts += distance[i];\n        }\n        cout<<"ts: "<<ts;\n        suma=abs(ts-sum);\n        return min(sum,suma);\n       \n\n        \n    }\n};\n```
['C++']