Matrix Array Contains

[Solved] Matrix Array Contains | Solidity - Code Explorer | yomemimo.com
Question : matrix array contains.

Answered by : breakable-boar-edft0g4450w9

import java.util.Scanner;
import java.util.Arrays;
public class arrayContains2D { public static void main(String[] args) { int[][] m = new int[][] { { 1, 2, 3 }, { 1, 2, 3, 4}, }; Scanner input = new Scanner(System.in); System.out.println("Check if number is inside of an array"); int n = input.nextInt(); if (Arrays.asList(m).contains(n)) { System.out.println("True"); } else { System.out.println("False"); } }
}

Source : | Last Update : Sun, 09 Oct 22

Answers related to matrix array contains

Code Explorer Popular Question For Solidity