Strategy/algorithm to divide pot to chips
https://softwareengineering.stackexchange.com/questions/157458
-
04-11-2019 - |
문제
I want to split poker pot to chips.
Example:
Pot = $17.500.
I have the endless piles of chips. I have the following types of chips: ChipsTypes = [$1, $5, $10, $25, $100, $500, $1.000, $5.000, $10.000, and so on]. Index starts from 0.
I want to get an array that says which chips I have to take to divide the pot and in which order to have minimum number of denominations and chips after pot-to-chips conversion. For example Result = [7, 5] means that I have to take 3 * $5.000 + 5 * $500 which $17.500.
Is there is any strategy or algorithm that would suit my need?
올바른 솔루션이 없습니다
제휴하지 않습니다 softwareengineering.stackexchange