Closed jyotirmoydotdev closed 1 year ago
Please assign this issue to me.
I've submitted a pull request, so there's no need to assign anyone. I'm simply awaiting the merge.
@neetcode-gh, could you please merge the pull request at your earliest convenience?
Description: The code in the file go/0074-search-a-2d-matrix.go is incorrect and fails to pass a significant number of test cases on LeetCode. This issue aims to address the problems in the code and provide a corrected version.
Problem Description: The current code utilizes a binary search approach to find the target value in a 2D matrix. However, there is a logical issue in the code that causes it to fail for specific input scenarios.
Proposed Changes: The proposed changes to the code include modifying the condition in line 21
if top >= bot
toif !(top <= bot)
for correct logic. This change will ensure that the code behaves correctly in all cases.Steps to Reproduce: To reproduce the issue, you can run the current code on LeetCode, where it fails to pass 107 out of 133 test cases.
Expected Behavior: After the proposed changes, the corrected code is expected to pass all the test cases on LeetCode and provide the correct result for the given problem.