Scala Collections: Use the Set value to find the key from the Map object.
This is a scala question.
I currently have the following two collection objects:
val keywordLookup = Map("a" -> "1111",
"b" -> "2222",
"c" -> "3333",
"d" -> "4444",
"e" -> "5555")
val keywordList = Set("1111", "3333")
The Lookup keyword is a search object. The List keyword contains a list of values that I need to find the ids from the keywordLookup object.
I would like to get the following result:
Map("a" -> "1111", "c" -> "3333")
+3
source to share
3 answers