如何在insde字符串之间节省空间

时间:2018-01-17 18:20:43

标签: javascript string

需要在加入后节省空间,如第一行代码

node:
    build: docker/node
    environment:
      - NODE_ENV=dev
    container_name: symfony4-windock-node
    tty: true

或一行:

public class SudokuVerify {
    public static void main(String[] args) {
        int[][] arr = { { 5, 3, 4, 6, 7, 8, 9, 1, 2 },
                { 6, 7, 2, 1, 9, 5, 3, 4, 8 }, { 1, 9, 8, 3, 4, 2, 5, 6, 7 },
                { 8, 5, 9, 7, 6, 1, 4, 2, 3 }, { 4, 2, 6, 8, 5, 3, 7, 9, 1 },
                { 7, 1, 3, 9, 2, 4, 8, 5, 6 }, { 9, 6, 1, 5, 3, 7, 2, 8, 4 },
                { 2, 8, 7, 4, 1, 9, 6, 3, 5 }, { 3, 4, 5, 2, 8, 6, 1, 7, 9 } };
        boolean flag = true;
        int ExpectedVal = (1 ^ 2 ^ 3 ^ 4 ^ 5 ^ 6 ^ 7 ^ 8 ^ 9);
        int ActualVal = 0;
//---># Checking for row Validation**
        for (int row = 0; row < 9; row++) {
            ActualVal = 0;
            for (int col = 0; col < 9; col++) {
                ActualVal ^= arr[row][col];
            }
            if (ActualVal != ExpectedVal) {
                flag = false;
                break;
            }
        }
//---># **Checking for col Validation**
        if (flag) {
            for (int row = 0; row < 9; row++) {
                ActualVal = 0;
                for (int col = 0; col < 9; col++) {
                    ActualVal ^= arr[col][row];
                }
                if (ActualVal != ExpectedVal) {
                    flag = false;
                    break;
                }
            }
        }
//---># **Checking for inside box Validation**
        if (flag) {
            for (int i = 0; i < 9; i += 3) {

                if (flag) {
                    for (int j = 0; j < 9; j += 3) {
                        ActualVal = 0;
                        for (int ii = i; ii < (i + 3); ii++) {
                            for (int jj = j; jj < (j + 3); jj++) {
                                ActualVal ^= arr[ii][jj];
                            }
                            System.out.println();
                        }
                        if (ActualVal != ExpectedVal) {
                            flag = false;
                            break;
                        }
                    }
                } else
                    break;

            }
        }
        if (flag)
            System.out.println("Passes");
        else {
            System.out.println("Faied");
        }
    }
}

0 个答案:

没有答案