d7bb0b2 - right approach (see below)
notice different sorting in the answer.
let's figure out where the sorting comes from.
Collectors.toMap(i->symbols.get(i), i->1.0/exchangeRate.get(i)));
Sort by alphabet
So, answer: C
C is correct
1- first map not considered order. (stream)
{EUR=0.8354916868577157, GBP=0.7544322897019993, USD=1.0, CNY=6.418098009491084}
2- second map sorted by natural order of the key and uses linkedhash, then output format values to two decimal
CNY -> 6.42
EUR -> 0.84
GBP -> 0.75
USD -> 1.00
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ASPushkin
3 months, 4 weeks agoBugmenot240411
8 months agod7bb0b2
1 year agod7bb0b2
1 year agoduydn
1 year, 2 months agoue02765
1 year, 2 months agoStavok
1 year, 7 months agopikosss
1 year, 10 months agoRP384
1 year, 11 months agoRP384
1 year, 11 months ago