HF RL Explorer

online shop promotions: add feature

online shop promotions: add feature: a task in smol-software-harbor (Harbor dataset). Add a new module promos/best.py with best discount(subtotal cents, coupons) that finds the best way to use a customer's coupons (each a dict with a code , see apply coupon in promos/engine.py ): either a single…

The task

Add a new module `promos/best.py` with `best_discount(subtotal_cents, coupons)` that finds the best way to use a customer's coupons (each a dict with a `code`, see `apply_coupon` in `promos/engine.py`): either a single coupon, or one percent coupon followed by one fixed coupon marked `"stackable": True`, the fixed…

Part of efederici/smol-software-harbor.