diff --git a/Python/Divide_Players_Into_Teams_Of_Equal_Skills.py b/Python/Divide_Players_Into_Teams_Of_Equal_Skills.py index e483c1a..c83dd79 100644 --- a/Python/Divide_Players_Into_Teams_Of_Equal_Skills.py +++ b/Python/Divide_Players_Into_Teams_Of_Equal_Skills.py @@ -1,3 +1,5 @@ +from typing import List + class Solution: def dividePlayers(self, skill: List[int]) -> int: # Step 1: Sort the skill array @@ -11,7 +13,8 @@ def dividePlayers(self, skill: List[int]) -> int: # Check if the sum of current pair matches the required total_skill if skill[i] + skill[-i - 1] != total_skill: return -1 # Invalid configuration, return -1 + # Calculate the chemistry (product of pair) and add it to the sum chemistry_sum += skill[i] * skill[-i - 1] - return chemistry_sum # Return total chemistry \ No newline at end of file + return chemistry_sum # Return total chemistry