mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-19 19:03:02 +08:00
from __future__ import annotations (#2464)
* from __future__ import annotations * fixup! from __future__ import annotations * fixup! from __future__ import annotations * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -2,12 +2,12 @@
|
||||
# https://www.guru99.com/fractional-knapsack-problem-greedy.html
|
||||
# https://medium.com/walkinthecode/greedy-algorithm-fractional-knapsack-problem-9aba1daecc93
|
||||
|
||||
from typing import List, Tuple
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def fractional_knapsack(
|
||||
value: List[int], weight: List[int], capacity: int
|
||||
) -> Tuple[int, List[int]]:
|
||||
value: list[int], weight: list[int], capacity: int
|
||||
) -> tuple[int, list[int]]:
|
||||
"""
|
||||
>>> value = [1, 3, 5, 7, 9]
|
||||
>>> weight = [0.9, 0.7, 0.5, 0.3, 0.1]
|
||||
|
Reference in New Issue
Block a user