-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
Difficulty: Easy/Search in a Row-Column sorted matrix/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<h2><a href="https://www.geeksforgeeks.org/problems/search-in-a-matrix17201720/1">Search in a Row-Column sorted matrix</a></h2><h3>Difficulty Level : Difficulty: Easy</h3><hr><div class="problems_problem_content__Xm_eO"><p><span style="font-size: 14pt;">Given a 2D integer matrix <strong>mat</strong>[][] of size <strong>n x m</strong>, where every row and column is sorted in increasing order and a number <strong>x</strong>,<strong> </strong>the task is to find whether element <strong>x</strong> is present in the matrix.</span></p> | ||
<p><strong><span style="font-size: 14pt;">Examples:</span></strong></p> | ||
<pre><span style="font-size: 14pt;"><strong>Input</strong>: mat[][] = [[3, 30, 38],[20, 52, 54],[35, 60, 69]], x = 62 | ||
<strong>Output</strong>: false | ||
<strong>Explanation</strong>: 62 is not present in the matrix, so output is false.<br></span></pre> | ||
<pre><span style="font-size: 14pt;"><strong>Input</strong>: mat[][] = [[18, 21, 27],[38, 55, 67]], x = 55 | ||
<strong>Output</strong>: true | ||
<strong>Explanation</strong>: 55 is present in the matrix.</span></pre> | ||
<pre><span style="font-size: 14pt;"><strong>Input</strong>: mat[][] = [[1, 2, 3],[4, 5, 6],[7, 8, 9]], x = 3 | ||
<strong>Output</strong>: true | ||
<strong>Explanation</strong>: 3 is present in the matrix.<br></span></pre> | ||
<p><span style="font-size: 14pt;"><strong>Constraints</strong>:<br>1 <= n, m <=1000<br>1 <= mat[i][j] <= 10<sup>9 <br></sup>1<= x <= 10<sup>9</sup></span></p></div><p><span style=font-size:18px><strong>Company Tags : </strong><br><code>Paytm</code> <code>Accolite</code> <code>Amazon</code> <code>Microsoft</code> <code>Snapdeal</code> <code>MakeMyTrip</code> <code>Ola Cabs</code> <code>Oracle</code> <code>Visa</code> <code>Goldman Sachs</code> <code>Directi</code> <code>Adobe</code> <code>SAP Labs</code> <code>Groupon</code> <code>InMobi</code> <code>One97</code> <code>Polycom</code> <code>TinyOwl</code> <br><p><span style=font-size:18px><strong>Topic Tags : </strong><br><code>Searching</code> <code>Matrix</code> <code>Data Structures</code> <code>Algorithms</code> |