Problem seems to be with parenthesis. Enclose inner expression in parenthesis, as shown below:
scala
map + (k -> (map.getOrElse(k, 0) + 1))
Other post that you mentioned had different problem. In that post, Int was used as type parameter, which is not the case here.