akshitagit / akshitagit/Python

MATRIX SEARCH

Đang mở
#89 8 bình luận 0 reaction 1 người được giao Được @sagarr70 nhận Xem trên GitHub
algorithms datastructures DSA good first issue hacktoberfest hacktoberfest2020 hactoberfest
Ngôn ngữ chính
Python
Star
124
Fork
109
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.