JAVA icon indicating copy to clipboard operation
JAVA copied to clipboard

MATRIX SEARCH

Open akshitagupta15june opened this issue 4 years ago • 6 comments

STAR THIS REPO!

Given an n x m matrix, where every row and column is sorted in increasing order, and a number x . Find if element x is present in the matrix or not.

Input Format

First line consists of two space separated integers N and M, denoting the number of element in a row and column respectively. Second line of each test case consists of N*M space separated integers denoting the elements in the matrix in row major order. Third line of each test case contains a single integer x, the element to be searched. Constraints

1 <= N,M <= 30 0 <= A[i] <= 100000

Output Format

Print 1 if the element is present in the matrix, else 0.

Sample Input

3 3 3 30 38 44 52 54 57 60 69

62

Sample Output

0

akshitagupta15june avatar Sep 26 '20 17:09 akshitagupta15june

ADD IN SEARCHING SORTING REPO

akshitagupta15june avatar Sep 26 '20 17:09 akshitagupta15june

Hey! I would like to give a shot at this! I will post a pull request on the 1st of October. Could you please assign it to me?

debangeedas avatar Sep 26 '20 19:09 debangeedas

Hey! I would like to give a try! I will post a pull request on the 1st

thakareabhi avatar Sep 27 '20 03:09 thakareabhi

Hey @akshitagupta15june would you mind assigning it to me? Just to be sure!

debangeedas avatar Sep 28 '20 07:09 debangeedas

@akshitagupta15june i can do it please assign it to me

ap-jain avatar Sep 28 '20 12:09 ap-jain

@akshitagupta15june please assign it to me i will do it

anjanayraina avatar Oct 20 '21 06:10 anjanayraina