public static void lattice_paths(int x, int y) {
        long[][] array = new long[x + 1][y + 1];

        for (int i = 0; i <= x; i++) {
            for (int j = 0; j <= y; j++) {
                if (i == 0 && j == 0) {
                    array[i][j] = 1;
                } else {
                    array[i][j] = ((i > 0) ? array[i - 1][j] : 0) + ((j > 0) ? array[i][j - 1] : 0);
                }
            }
        }

        System.out.println(array[x][y]);
    }