Skip to content

Bug Report for search-2d-matrix #4222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rchomko opened this issue Jun 3, 2025 · 0 comments
Open

Bug Report for search-2d-matrix #4222

rchomko opened this issue Jun 3, 2025 · 0 comments

Comments

@rchomko
Copy link

rchomko commented Jun 3, 2025

Bug Report for https://neetcode.io/problems/search-2d-matrix

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

not really a bug, but you probably want to change the problem to return the indices, not just True False or this simple code works and no need for binary search:
class Solution:
def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
for i in range(len(matrix)):
if target in matrix[i]:
return True
return False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant