Skip to content

Fix mypy error at maths #4613

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 6 commits into from
Aug 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions maths/greedy_coin_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"""


def find_minimum_change(denominations: list[int], value: int) -> list[int]:
def find_minimum_change(denominations: list[int], value: str) -> list[int]:
"""
Find the minimum change from the given denominations and value
>>> find_minimum_change([1, 5, 10, 20, 50, 100, 200, 500, 1000,2000], 18745)
Expand Down Expand Up @@ -75,7 +75,7 @@ def find_minimum_change(denominations: list[int], value: int) -> list[int]:
if __name__ == "__main__":

denominations = list()
value = 0
value = "0"

if (
input("Do you want to enter your denominations ? (yY/n): ").strip().lower()
Expand Down
2 changes: 1 addition & 1 deletion maths/triplet_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def make_dataset() -> tuple[list[int], int]:
dataset = make_dataset()


def triplet_sum1(arr: list[int], target: int) -> tuple[int, int, int]:
def triplet_sum1(arr: list[int], target: int) -> tuple[int, ...]:
"""
Returns a triplet in the array with sum equal to target,
else (0, 0, 0).
Expand Down
2 changes: 1 addition & 1 deletion maths/two_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def two_sum(nums: list[int], target: int) -> list[int]:
>>> two_sum([3 * i for i in range(10)], 19)
[]
"""
chk_map = {}
chk_map: dict[int, int] = {}
for index, val in enumerate(nums):
compl = target - val
if compl in chk_map:
Expand Down