package leetcode;

import java.util.List;

/**
 * https://leetcode.com/problems/shift-2d-grid/
 */
public class Problem1260 {
    public List<List<Integer>> shiftGrid(int[][] grid, int k) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1260 prob = new Problem1260();
        System.out.println(prob.shiftGrid(new int[][]{
            {1, 2, 3},
            {4, 5, 6},
            {7, 8, 9}
        }, 1)); // [[9,1,2],[3,4,5],[6,7,8]]
        System.out.println(prob.shiftGrid(new int[][]{
            {3, 8, 1, 9},
            {19, 7, 2, 5},
            {4, 6, 11, 10},
            {12, 0, 21, 13}
        }, 4)); // [[12,0,21,13],[3,8,1,9],[19,7,2,5],[4,6,11,10]]
        System.out.println(prob.shiftGrid(new int[][]{
            {1, 2, 3},
            {4, 5, 6},
            {7, 8, 9}
        }, 9)); // [[1,2,3],[4,5,6],[7,8,9]]
    }
}

@@ -12,16 +12,44 @@
 tcode;%0A%0A
+import java.util.ArrayList;%0A
 import j
@@ -63,16 +63,16 @@
 l.List;%0A
-
 %0A/**%0A * 
@@ -207,24 +207,153 @@
 d, int k) %7B%0A
+        int m = grid.length;%0A        int n = m %3E 0 ? grid%5B0%5D.length : 0;%0A        List%3CList%3CInteger%3E%3E answer = new ArrayList%3C%3E();%0A
         // T
@@ -355,16 +355,17 @@
  // TODO
+:
 %0A       
@@ -376,12 +376,14 @@
 urn 
-null
+answer
 ;%0A  

Update problem 1260