Skip to content

Update FindMax.py #588

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

Merged
merged 1 commit into from
Nov 1, 2018
Merged

Update FindMax.py #588

merged 1 commit into from
Nov 1, 2018

Conversation

ashwek
Copy link
Member

@ashwek ashwek commented Nov 1, 2018

Issues in previous code:
Line 3 math module is not used so we don't have to import it
Line 5, max = 0 will give wrong answer (0) when the list contains only -ve elements, as 0 will always be larger than the elements.

Issues in previous code:
`Line 3` math module is not used so we don't have to import it
`Line 5`, `max = 0` will give wrong answer (0) when the list contains only -ve elements, as 0 will always be larger than the elements.
@yanglbme
Copy link
Member

yanglbme commented Nov 1, 2018

thx

@yanglbme yanglbme merged commit 32db8be into TheAlgorithms:master Nov 1, 2018
@ashwek ashwek deleted the fix---FindMax branch November 1, 2018 17:52
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