This repository has been archived on 2026-10-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2024-03-21 11:45:04 -07:00

26 lines
563 B
Java

public class RowCompare
{
public static boolean isRow(int[] arr, int[][] mat, int limit) {
if (limit < 0 || limit > mat.length) {
return false;
}
for (int i = 0; i < limit; i++) {
if (mat[i].length == arr.length) {
boolean rowMatch = true;
for (int j = 0; j < arr.length; j++) {
if (mat[i][j] != arr[j]) {
rowMatch = false;
break;
}
}
if (rowMatch) {
return true;
}
}
}
return false;
}
}