2020-06-07 04:47:15 +04:00
|
|
|
from typing import List
|
2020-03-27 20:14:22 +04:00
|
|
|
|
|
|
|
from piggybank.currencies import CURRENCIES
|
|
|
|
|
2020-06-07 04:47:15 +04:00
|
|
|
__all__ = ["complement_list_of_coins"]
|
2020-03-27 20:14:22 +04:00
|
|
|
|
|
|
|
|
2020-06-05 03:51:29 +04:00
|
|
|
def complement_list_of_coins(coins: List[int], currency: str,
|
2020-03-27 20:14:22 +04:00
|
|
|
_reversed: bool = False) -> List[int]:
|
2020-06-05 03:51:29 +04:00
|
|
|
"""Complements list of coins up to the count of currency's coins."""
|
2020-06-07 04:47:15 +04:00
|
|
|
offset_array = [0] * (len(CURRENCIES[currency]) - len(coins))
|
2020-06-04 05:11:29 +04:00
|
|
|
return offset_array + coins if not _reversed else coins + offset_array
|