13 lines
456 B
Python
13 lines
456 B
Python
from typing import List
|
|
|
|
from piggybank.currencies import CURRENCIES
|
|
|
|
__all__ = ["complement_list_of_coins"]
|
|
|
|
|
|
def complement_list_of_coins(coins: List[int], currency: str,
|
|
_reversed: bool = False) -> List[int]:
|
|
"""Complements list of coins up to the count of currency's coins."""
|
|
offset_array = [0] * (len(CURRENCIES[currency]) - len(coins))
|
|
return offset_array + coins if not _reversed else coins + offset_array
|