Live Batches
Masterclasses
Menu
Free Courses
Account
Login / Sign Up
Problem Submissions Solution

Search in a 2D Matrix

Difficulty: Medium

Acceptance: 86.00%

Points: 30.00

You are given an m × n integer matrix matrix with the following properties: Each row is sorted in ascending order. The first element of each row is greater than the last element of the previous row. Given an integer target, return true if the target exists in the matrix, otherwise return false.

Topics

Companies

Articles

Examples:

N/A

Constraints:
  • 1 = m, n = 100
  • -104 = matrix[i][j], target = 104
Companies:
Samsung
Topics:
Recursion Binary Search
Locked Content
Access Restricted: Please Login to access the code editor and test cases.