Gridland Metro

Sort by

recency

|

416 Discussions

|

  • + 0 comments

    The int in the boilercode needs to be changed to long. Some of the test cases have large n and m, and result will exceed 32bits (int size).

  • + 0 comments

    test cases are not flushed out- i got away with writing bad code.

    test case needed:

    4 10 3 8 3 5 8 7 8 8 4 8

  • + 0 comments

    Is it expected that the C++ boilerplate does not parse the input integers correctly and that we have to debug that as well?

  • + 0 comments

    Branded merchandise tied to "Gridland Metro" is gaining attention as the game continues to captivate its players. Fans can find a range of collectible items, from stylish apparel to limited-edition accessories, all designed to enhance the connection with the unique gameplay experience. Whether you’re a strategy enthusiast or just discovering the game’s charm, these branded products offer a way to express your fandom and bring a piece of Gridland Metro into everyday life.

  • + 0 comments

    // where i am doing wrong

    public static long gridlandMetro(int n, int m, int k, List<List<Integer>> track) {
        Map<Integer,int[]> realPath = new HashMap<>();
        long result = 0;
        for(int i =0;i<k;i++){
            List<Integer> l1 = track.get(i);
            int row = l1.get(0);
            int c1 = l1.get(1);
            int c2 = l1.get(2);
            if(realPath.containsKey(row)){
                 int[] coloums = realPath.get(row);
                int c21 = coloums[0];
                int c22 = coloums[1];
                if(c21>c1){
                   coloums[0] = c1;
                }
                if(c22<c2){
                    coloums[1] = c2;
                }
                realPath.put(row, coloums);
            }else{
                int[] coloums = new int[2];
                coloums[0] = c1;
                coloums[1] = c2;
                realPath.put(row, coloums);
            }
        }
        for(int i =1;i<=n;i++){
            if(realPath.containsKey(i)){
                int[] coloums = realPath.get(i);
                int c21 = coloums[0];
                int c22 = coloums[1];
                int incr = (m+c21)-(c22+1);
                result+=incr;
            }else{
                result+=m;
            }
        }
        return result;
    }