-
-
Notifications
You must be signed in to change notification settings - Fork 46.7k
Create first_missing_positive.py #11186
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
Create first_missing_positive.py #11186
Conversation
|
:return: The smallest missing positive integer. | ||
|
||
Examples: | ||
>>> first_missing_positive([1, 2, 0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add doctests for
>>> first_missing_positive([])
>>> first_missing_positive([0])
>>> first_missing_positive([1])
>>> first_missing_positive([1.1, 2.2, 3.3])
>>> first_missing_positive([-1, -2, -3])
>>> first_missing_positive("ABC")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the feedback .. i have done it
@@ -1,6 +1,6 @@ | |||
def first_missing_positive(nums: list[int]) -> int: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing type hints is a bad idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hint was added
:return: The smallest missing positive integer. | ||
|
||
Examples: | ||
>>> first_missing_positive([1, 2, 0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the feedback .. i have done it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed the hint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hint added
Co-authored-by: Christian Clauss <[email protected]>
Co-authored-by: Christian Clauss <[email protected]>
Co-authored-by: Christian Clauss <[email protected]>
@cclauss i have made the adjustments, could you please review it. ? i really appreciate it. |
Describe your change:
Checklist: