Solved LeetCode Search a 2D Matrix II in Java

Day 77/100 Completed ✅ 🚀 Solved LeetCode – Search a 2D Matrix II (Java) ⚡ Implemented an efficient approach by starting from the top-right corner of the matrix and eliminating rows or columns based on comparison with the target. This reduces the search space at every step, achieving O(m + n) time complexity. 🧠 Key Learnings: • Smart traversal in a sorted 2D matrix • Eliminating search space using row & column properties • Moving left (col--) when value is greater • Moving down (row++) when value is smaller • Better than brute-force (O(m × n)) approach 💯 This problem improved my understanding of matrix traversal strategies and how to optimize searching using sorted properties. 🔗 Profile: https://lnkd.in/gaJmKdrA #leetcode #datastructures #algorithms #java #matrix #problemSolving #optimization #arrays #100DaysOfCode 🚀

  • graphical user interface, text

To view or add a comment, sign in

Explore content categories