Repository navigation
Fix matrix binary search missing values at row starts - #15548
Miladkhoshdel wants to merge 1 commit into
Conversation
Multiple Pull Request Detected@Miladkhoshdel, we are extremely excited that you want to submit multiple algorithms in this repository but we have a limit on how many pull request a user can keep open at a time. This is to make sure all maintainers and users focus on a limited number of pull requests at a time to maintain the quality of the code. This pull request is being closed as the user already has an open pull request. Please focus on your previous pull request before opening another one. Thank you for your cooperation. User opened pull requests (including this one): #15548, #15547, #15546, #15545 |
|
Can you reopen this PR ? |
|
Superseded by #15560, which contains the same fix. I opened a replacement because I couldn't reopen this PR. Please continue the review there; this PR can remain closed. |
Describe your change
Fix
mat_bin_search()missing a target that equals the first element of a row after the first row.For example,
mat_bin_search(3, [[1, 2], [3, 4]])previously returned[-1, -1]instead of[1, 0].The row-selection loop used
<, stopping before searching a row whose first element equaled the target. Changing the condition to<=allows that row to be searched.This PR changes one condition in one algorithm file. Existing doctests remain unchanged.
Validation:
git diff --checkpassed.The repository-wide Ruff check still fails on the existing
ICN001error inmaths/zellers_congruence.py, addressed separately by #15547.Checklist