diff --git a/maths/greedy_coin_change.py b/maths/greedy_coin_change.py index 5a7d9e8d8..5233ee1cb 100644 --- a/maths/greedy_coin_change.py +++ b/maths/greedy_coin_change.py @@ -41,7 +41,7 @@ Following is minimal change for 456 : """ -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) @@ -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() diff --git a/maths/triplet_sum.py b/maths/triplet_sum.py index 22fab17d3..af77ed145 100644 --- a/maths/triplet_sum.py +++ b/maths/triplet_sum.py @@ -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). diff --git a/maths/two_sum.py b/maths/two_sum.py index 5209acbc7..12ad332d6 100644 --- a/maths/two_sum.py +++ b/maths/two_sum.py @@ -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: