Search 2D Matrix II: Top-Right Start

Day 43/100 | #100DaysOfDSA 🧩🚀 Today’s problem: Search a 2D Matrix II Interesting matrix pattern here. Matrix properties: • Each row is sorted left → right • Each column is sorted top → bottom Key idea: Start from the top-right corner. Why? • If current value > target → move left • If current value < target → move down This way we eliminate one row or column every step. Time Complexity: O(m + n) Space Complexity: O(1) Big takeaway: Choosing the right starting point can simplify the entire search. Matrix patterns getting stronger day by day. 🔥 Day 43 done. #100DaysOfCode #LeetCode #DSA #Algorithms #Matrix #BinarySearch #Java #CodingJourney #ProblemSolving #InterviewPrep #TechCommunity

  • graphical user interface, text

To view or add a comment, sign in

Explore content categories