Only for the rich

  • 5
  • Locked
Our customer is the Monte Vegas Casino on Planet Diabloblo. Extremely arrogant guys, but they pay well. They've asked us to make an automatic mailing list for potential customers. Don't worry. The junior programmer (you) has been assigned a simple task: create a (last name, salary) dictionary and remove any entries for people whose salary is less than 500 credits.
You can't complete this task, because you're not signed in.
Comments (9)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
ImDevin
Level 15 , Old Town, United States
30 April 2021, 17:19
wow, you don't even have to loop through with map.values().removeIf(); Felt almost like cheating, after the last couple of tasks. You can do it the regular way too, however. Happy coding! :)
Anonymous #11074513
Level 10 , Taiwan, Province of China
21 September 2022, 00:35
可以請教你怎麼做到嗎? 可能我想像力有限>"<
Lex Icon
Level 17 , Sofia, Bulgaria
13 December 2020, 12:10
HINT: try to solve it with:
map.values().removeIf();
Khongpak Phupkdee
Level 15 , Chiangrai, Thailand
5 May 2021, 13:10
Thank you, it very useful and saves time. and without loop Add HINT from Lex Icon You can't use
map.remove(value)
because JAVA8+ It not support
Petros
Level 23 , Columbia, United States
25 July 2020, 01:20
Took 10 minutes to solve and half of that was entering keys and values. As opposed to a WHOLE day for the previous two exercises lol. I hope we get more solidified on HashMaps.
Andrei
Level 41
5 November 2020, 09:45
you could enter keys and values with a loop!
15 March 2020, 22:44
After hours of trying i got it : use Iterator it and to remove just use it.remove();
Geoff Green
Level 10 , Calgary, Canada
11 February 2020, 18:07
Hint: https://dzone.com/articles/removing-elements-from-a-map-in-java
Janusz
Level 11 , Radomsko, Poland
23 August 2019, 08:07
What is wrong?