Sort by

recency

|

1332 Discussions

|

  • + 0 comments
    def service_lane(width, cases):
        return [min(width[x[0]:(x[1] + 1)]) for x in cases]
    
  • + 0 comments

    I was driving on the freeway the other day when my check engine light suddenly came on. Luckily, there was a service lane running alongside, but I kept thinking—what if the lane gets too narrow? It reminded me of that Paradise Highway scenario where you have to find the widest vehicle that can still squeeze through the narrowest part.

    Funny enough, just last weekend I installed the best line lock kit — the GT1R Line Lock Kit—on my R35. It won’t turn it into a Funny Car, but man, it makes burnouts effortless. No more messing with brake lines or fittings—it came with everything I needed. Just wired in a trigger and I was done. Definitely glad I had it installed before this unexpected detour.

  • + 0 comments

    Notably, you need to change the inputs for the function to cases and widths, as well as removing n from both the function and the part of the program that calls the function in main to avoid a segmentation fault, especially when dealing with dynamic data like rta cabinets wholesale dimensions.

  • + 0 comments

    Instead of passing the length of width, directly pass width in parameter.

    public static List<Integer> serviceLane(List<List<Integer>> cases, List<Integer> width) {
        // Write your code here
       
            List<Integer> maxSizeVehicle = new ArrayList<Integer>();
            for (List<Integer> i : cases) {
                int a = 0;
                for (int j = i.get(0); j <= i.get(1); j++) {
                    if (j == i.get(0)) {
                        a = width.get(j);
                    } else if (a > width.get(j)) {
                        a = width.get(j);
                    } else if (a == width.get(j)) {
                         a = width.get(j);
                    }
                    if (j == i.get(1)) {
                        maxSizeVehicle.add(a);
                    }
                }
            }
            return maxSizeVehicle;
        }
    
  • + 0 comments

    Notably, you need to change the inputs for the function to cases and widths, as well as removing n from both the function and the part of the program that calls the function in main to avoid a segmentation fault.