Given the collection of the {Price, Quantity} pair, I need to collect all quantities at the same price point. What is the easiest way to achieve it?
Contaminated, it would be possible to implement a solution using a Hashmap with keys, since price and value are aggregated quantities. But as far as I know, Float not a secure key for a Hashmap . Therefore, this decision is error prone.
What is recommended to solve this problem?
source share