JAVA || Simple Solution ||O(n)
Intuition\nit will be easy just do it with one condition and math.min\n\n# Approach\none for loop \n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexi
# Intuition\nit will be easy just do it with one condition and math.min\n\n# Approach\none for loop \n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\n\n# Code\n```**\n//Dev Bhayani**\nclass Solution {\n    public int distanceBetweenBusStops(int[] distance, int start, int destination) {\n        int sum=0,sum1=0,s=0;\n        for(int i=0;i<distance.length;i++)\n        {\n            sum+=distance[i];\n        }\n       if(start<destination)\n       {\n           for(int i=start;i<destination;i++)\n           {\n               sum1+=distance[i];\n           }\n       }\n       else\n       {\n           for(int i=destination;i<start;i++)\n           {\n               sum1+=distance[i];\n           }\n       }\n        return Math.min(sum1,sum-sum1);\n    }\n}\n```
['Array', 'Linked List', 'Doubly-Linked List', 'Shortest Path', 'Java']