Minimize coins with overpay and change | Snowflake Coding Question