count char frequency in string with scala
<p>I search a way to count the different chars from a string.
The problem is that's <em>not allowed to use any functions from the scala-api or to use vars</em> (only val).</p>

<p>I want same result like that</p>

<pre><code>val fruit: String = "dasisteintest"
println(fruit.groupBy(identity).mapValues(_.size))
Map(e -&gt; 2, s -&gt; 3, n -&gt; 1, t -&gt; 3, a -&gt; 1, i -&gt; 2, d -&gt; 1)
</code></pre>

<p>In every try I made, I have at the end a <code>list[(Char,Int)]</code> where I have to change the Int. But because it's an immutable list I can't change it.
How can I implement that counting char algorithm?</p>