akshitagit / akshitagit/Python

MATRIX SEARCH

Ouverte
#89 8 commentaires 0 réactions 1 personne assignée Réclamée par @sagarr70 Voir sur GitHub
algorithms datastructures DSA good first issue hacktoberfest hacktoberfest2020 hactoberfest
Langage dominant
Python
Étoiles
124
Forks
109
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.