You are viewing a single comment's thread. Return to all comments →
Could you explain:
Optional<Integer> res = ransom.entrySet().stream() .map(e -> magazine.getOrDefault(e.getKey(), 0) - e.getValue()) .filter(e -> e < 0) .findFirst();
How did you know how the order of the .entrySet, .stream, .map, etc...?
I understand what the Optional class does, I am just not experienced with this syntax.
Seems like cookies are disabled on this browser, please enable them to open this website
Hash Tables: Ransom Note
You are viewing a single comment's thread. Return to all comments →
Could you explain:
How did you know how the order of the .entrySet, .stream, .map, etc...?
I understand what the Optional class does, I am just not experienced with this syntax.