From 657d46101d6073895fad1fcb13a1d6b340bb6679 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 11 Jun 2020 16:36:09 +0200 Subject: [PATCH] calc_profit always returns an int (#2090) * calc_profit always returns an int * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> --- greedy_method/greedy_knapsack.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/greedy_method/greedy_knapsack.py b/greedy_method/greedy_knapsack.py index 92dd81aaa..ed6399c74 100644 --- a/greedy_method/greedy_knapsack.py +++ b/greedy_method/greedy_knapsack.py @@ -15,10 +15,9 @@ weight[i] >= 0 Calculate the maximum profit that the shopkeeper can make given maxmum weight that can be carried. """ -from typing import Union -def calc_profit(profit: list, weight: list, max_weight: int) -> Union[str, int]: +def calc_profit(profit: list, weight: list, max_weight: int) -> int: """ Function description is as follows- :param profit: Take a list of profits