Skip to content

Conversation

@nikhilsaimarri
Copy link

No description provided.

Implement search in a 2D matrix using binary search.
Implement search in a rotated sorted array using binary search.
@super30admin
Copy link
Owner

Strengths:

  • Clear and logical implementation of the solutions.
  • Good use of comments to explain the steps.
  • Correct handling of edge cases in both problems.

Areas for Improvement:

  • For the 2D matrix problem, consider using binary search to find the appropriate row to improve time complexity from O(m + log n) to O(log m + log n).
  • The variable names could be more descriptive in some places (e.g., 'n' could be 'length' or 'size').
  • The solution for the rotated sorted array could be simplified by combining the pivot finding and target search into a single binary search, as shown in the reference solution.

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

Successfully merging this pull request may close these issues.

2 participants