Create Test_3.java

This commit is contained in:
Mandeep Moun
2025-10-28 22:10:22 -06:00
committed by GitHub
parent 066d52c29b
commit 510fa793c8

View File

@@ -0,0 +1,17 @@
public class Test_3{
public int search(int [][] matrix, int to_search){
for(int i = 0; i < matrix.lenght; i++){
for(int j = 0; j < matrix[i].legth; j++) {
if (matrix[i][j] == to_search){
return true;
}
}
}
return false;
boolean result = this.contains(new int[][] {
{1,2,3},
{22,42,45},
{38,26,16}}, 42);
}