Skip to content

Add sol3 for project_euler problem_03 #1553

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 5 commits into from
Nov 7, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update sol3.py
add type hint 
remove unused variable
  • Loading branch information
jwmneu authored Nov 7, 2019
commit 63509849f08d842e1ffdf48d43d98e753523a90b
3 changes: 1 addition & 2 deletions project_euler/problem_03/sol3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""


def solution(n):
def solution(n:int)->int:
"""Returns the largest prime factor of a given number n.

>>> solution(13195)
Expand Down Expand Up @@ -41,7 +41,6 @@ def solution(n):
raise TypeError("Parameter n must be int or passive of cast to int.")
if n <= 0:
raise ValueError("Parameter n must be greater or equal to one.")
prime = 1
i = 2
ans = 0
if n==2:
Expand Down