package leetcode;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * https://leetcode.com/problems/01-matrix/
 */
public class Problem542 {
    public List<List<Integer>> updateMatrix(List<List<Integer>> matrix) {
        // TODO
        return new ArrayList<>();
    }

    private static void print(List<List<Integer>> matrix) {
        for (int i = 0; i < matrix.size(); i++) {
            System.out.println(matrix.get(i));
        }
    }

    public static void main(String[] args) {
        Problem542 prob = new Problem542();

        // 0 0 0
        // 0 1 0
        // 0 0 0
        print(prob.updateMatrix(Arrays.asList(
            Arrays.asList(0, 0, 0),
            Arrays.asList(0, 1, 0),
            Arrays.asList(0, 0, 0)
        )));

        // 0 0 0
        // 0 1 0
        // 1 2 1
        print(prob.updateMatrix(Arrays.asList(
            Arrays.asList(0, 0, 0),
            Arrays.asList(0, 1, 0),
            Arrays.asList(1, 1, 1)
        )));
    }
}

@@ -998,16 +998,454 @@
     )));
+%0A%0A        // 0 0 0%0A        // 1 1 1%0A        // 2 2 2%0A        print(prob.updateMatrix(Arrays.asList(%0A            Arrays.asList(0, 0, 0),%0A            Arrays.asList(1, 1, 1),%0A            Arrays.asList(1, 1, 1)%0A        )));%0A%0A        // 0 1 0%0A        // 1 2 1%0A        // 2 3 2%0A        print(prob.updateMatrix(Arrays.asList(%0A            Arrays.asList(0, 1, 0),%0A            Arrays.asList(1, 1, 1),%0A            Arrays.asList(1, 1, 1)%0A        )));
 %0A    %7D%0A%7D

Update problem 542