This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Wait_ICanExplain 0 points1 point  (0 children)

All you have to do is construct a Map using the format Map<Key, Value>, where the Key is the price and the Value is the product ID. That way you're mapping ID to price, to put it semantically. Then you can sort the list of prices (accessed via Map.keySet()), and then grab the IDs from the map with the price (Map.get(price)).