4 ms simple c++
\'\'\'\nclass Solution {\npublic:\n    int distanceBetweenBusStops(vector& d, int start, int destination) {\n        int fwd = 0, bwd = 0;\n        int temp = s
\'\'\'\nclass Solution {\npublic:\n    int distanceBetweenBusStops(vector<int>& d, int start, int destination) {\n        int fwd = 0, bwd = 0;\n        int temp = start < destination?start:destination;\n        if(temp != start){destination = start; start = temp;}\n        for(int i = start; i  < destination; i++)fwd += d[i];\n        if(!start)for(int i = d.size()-1;i >= destination;i--)bwd += d[i];\n        else\n        {\n            for(int i = start-1; i >= 0 ;i--)bwd += d[i];\n            for(int i = d.size()-1;i >= destination;i--)bwd += d[i];\n        }\n        return fwd<bwd?fwd:bwd;\n    }\n};\n\'\'\'
['C++']