Here you can find the source of equalByRows(boolean[][] a, boolean[][] b)
public static boolean equalByRows(boolean[][] a, boolean[][] b)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; public class Main { public static boolean equalByRows(boolean[][] a, boolean[][] b) { if (a.length != b.length) return false; boolean eqRow; boolean[] bUsed = new boolean[b.length]; Arrays.fill(bUsed, false); for (int i = 0; i < a.length; i++) { eqRow = false;// w ww. j a va 2 s .c om for (int j = 0; j < b.length; j++) { if (!bUsed[j]) { if (Arrays.equals(a[i], b[j])) { eqRow = true; bUsed[j] = true; break; } } } if (!eqRow) return false; } return true; } }