Skip to content

Commit ed7e540

Browse files
refactor 1184
1 parent fa29e41 commit ed7e540

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

src/main/java/com/fishercoder/solutions/_1184.java

-28
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,5 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 1184. Distance Between Bus Stops
5-
*
6-
* A bus has n stops numbered from 0 to n - 1 that form a circle. We know the distance between all pairs of neighboring stops where distance[i] is the distance between the stops number i and (i + 1) % n.
7-
* The bus goes along both directions i.e. clockwise and counterclockwise.
8-
* Return the shortest distance between the given start and destination stops.
9-
*
10-
* Example 1:
11-
* Input: distance = [1,2,3,4], start = 0, destination = 1
12-
* Output: 1
13-
* Explanation: Distance between 0 and 1 is 1 or 9, minimum is 1.
14-
*
15-
* Example 2:
16-
* Input: distance = [1,2,3,4], start = 0, destination = 2
17-
* Output: 3
18-
* Explanation: Distance between 0 and 2 is 3 or 7, minimum is 3.
19-
*
20-
* Example 3:
21-
* Input: distance = [1,2,3,4], start = 0, destination = 3
22-
* Output: 4
23-
* Explanation: Distance between 0 and 3 is 6 or 4, minimum is 4.
24-
*
25-
* Constraints:
26-
* 1 <= n <= 10^4
27-
* distance.length == n
28-
* 0 <= start, destination < n
29-
* 0 <= distance[i] <= 10^4
30-
* */
313
public class _1184 {
324
public static class Solution1 {
335
public int distanceBetweenBusStops(int[] distance, int start, int destination) {

0 commit comments

Comments
 (0)