Get lowest integer that is not in set
You could try for a more functional expression that matches problem description more closely:

 Stream.from(1).filter(!set.contains(_)).head


[Caveat: I'm not a scala programmer, I have no idea how idiomatic this is]