package hackerrank;

import java.util.Scanner;

/**
 * https://www.hackerrank.com/challenges/service-lane
 */
public class ServiceLane {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
    }
}

@@ -139,92 +139,686 @@
    p
-ublic static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);
+rivate static int serviceLane(int%5B%5D widths, int i, int j) %7B%0A        int min = Integer.MAX_VALUE;%0A        for (int x = i; x %3C= j; x++) %7B%0A            min = Math.min(widths%5Bx%5D, min);%0A        %7D%0A        return min;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int n = in.nextInt();%0A        int testCases = in.nextInt();%0A        int%5B%5D widths = new int%5Bn%5D;%0A        for (int i = 0; i %3C n; i++) %7B%0A            widths%5Bi%5D = in.nextInt();%0A        %7D%0A        for (int t = 0; t %3C testCases; t++) %7B%0A            int i = in.nextInt();%0A            int j = in.nextInt();%0A            System.out.println(serviceLane(widths, i, j));%0A        %7D
 %0A   

Solve Service Lane