task: Add type hints to inversions.py#14262
Open
nupurvavhal wants to merge 3 commits intoTheAlgorithms:masterfrom
Open
task: Add type hints to inversions.py#14262nupurvavhal wants to merge 3 commits intoTheAlgorithms:masterfrom
nupurvavhal wants to merge 3 commits intoTheAlgorithms:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Python type hints to the inversion-counting implementation in divide_and_conquer/inversions.py to improve readability and editor/static-analysis support.
Changes:
- Annotated
count_inversions_bf()parameter/return types. - Annotated
count_inversions_recursive()and_count_cross_inversions()parameter/return types. - Added a return annotation to
main().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fd44b0a to
b4a6c84
Compare
mindaugl
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your change:
Added type hints to count_inversions_bf, count_inversions_recursive, and helper functions for better code clarity and IDE support. Tested locally with python3 divide_and_conquer/inversions.py.
Checklist: