Python icon indicating copy to clipboard operation
Python copied to clipboard

MATRIX SEARCH

Open akshitagupta15june opened this issue 5 years ago • 8 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

can you assign this to me as a part of hacktoberfest 2020

sagarr70 avatar Sep 26 '20 21:09 sagarr70

ok

akshitagupta15june avatar Sep 28 '20 04:09 akshitagupta15june

should I contribute

tausiq2003 avatar Oct 01 '21 09:10 tausiq2003

Yes you can

shubhcoder2104 avatar Oct 01 '21 09:10 shubhcoder2104

i will contribute for hacktoberfest 2021. So please accept

tausiq2003 avatar Oct 01 '21 13:10 tausiq2003

please assign me

tausiq2003 avatar Oct 05 '21 17:10 tausiq2003

Hello Akshita, hope everything is good. If this one is still available then please assign it to me, I'll finish this in few hrs.

AvinashDwivedi avatar Oct 21 '22 22:10 AvinashDwivedi