codedecks-in / LeetCode-Solutions

This repository consists of solutions to the problem from LeetCode platform. Subscribe to our Channel for more updates
https://www.youtube.com/c/codedecks
MIT License
821 stars 415 forks source link

search-a-2d-matrix-ii #485

Open shashantsah opened 3 months ago

shashantsah commented 3 months ago

Description

We need to efficiently search for a target value in a matrix where rows and columns are sorted in ascending order. The matrix is structured such that lower values are towards the top-left corner and higher values are towards the bottom-right corner.

Approach

The provided solution utilizes a two-pointer approach starting from the bottom-left corner of the matrix:

Begin from the bottom-left corner (matrix[n-1][0]).

Put check marks:

How Has This Been Tested?

Make sure all below guidelines are followed else PR will get Reject:

welcome[bot] commented 3 months ago

I can tell this is your first pull request! Thank you I'm so honored. :tada::tada::tada: I'll take a look at it ASAP!