I'm trying to translate this algorithm I wrote in Java to Scala, but I'm having trouble with the containsValue() method that is present in Java. I want to do something like if (hashMap.containsValue(value)) but I have looked through the scala documentation and have only found a contains(key) method. How do you implement or use hashmap.containsValue(value) in Scala I'm still new to Scala, but here's what I have so far in Scala:

def retString(s: String)

{

val map = new mutable.HashMap[Int, Char]

for (c <- s.toCharArray)

{

//if(!map.containsValue(c)) goes here

}

}

`

The full algorithm I'm trying to convert is removeDuplicates I wrote in Java: