|
| 1 | +package com.fishercoder; |
| 2 | + |
| 3 | +import com.fishercoder.common.utils.CommonUtils; |
| 4 | +import com.fishercoder.solutions._37; |
| 5 | +import org.junit.BeforeClass; |
| 6 | +import org.junit.Test; |
| 7 | + |
| 8 | +public class _37Test { |
| 9 | + private static _37.Solution1 solution1; |
| 10 | + private static char[][] board; |
| 11 | + |
| 12 | + @BeforeClass |
| 13 | + public static void setup() { |
| 14 | + solution1 = new _37.Solution1(); |
| 15 | + } |
| 16 | + |
| 17 | + @Test |
| 18 | + public void test1() { |
| 19 | + board = new char[][]{ |
| 20 | + {'5', '3', '.', '.', '7', '.', '.', '.', '.'}, |
| 21 | + {'6', '.', '.', '1', '9', '5', '.', '.', '.'}, |
| 22 | + {'.', '9', '8', '.', '.', '.', '.', '6', '.'}, |
| 23 | + {'8', '3', '.', '.', '6', '.', '.', '.', '3'}, |
| 24 | + {'4', '.', '.', '8', '.', '3', '.', '.', '1'}, |
| 25 | + {'7', '.', '.', '.', '2', '.', '.', '.', '6'}, |
| 26 | + {'.', '6', '.', '.', '7', '.', '2', '8', '.'}, |
| 27 | + {'.', '.', '.', '4', '1', '9', '.', '.', '5'}, |
| 28 | + {'.', '.', '.', '.', '8', '.', '.', '7', '9'} |
| 29 | + }; |
| 30 | + CommonUtils.print2DCharArray(board); |
| 31 | + solution1.solveSudoku(board); |
| 32 | + CommonUtils.print2DCharArray(board); |
| 33 | + } |
| 34 | +} |
0 commit comments