title: How can I write a method that takes in a string input and prints the first most repeated character in that string
body: <p>I was trying to make a function that can iterate through any string and return the most common character within that string. My progress is shown below. I was trying to insert the character array into a dictionary where I could then print out the dictionary containing every character and their count. For the people that Think no effort was put in, I merely left out all of the code that I have tried and commented out. Didn't see any use for that so only the essentials were included. </p>
  
  <pre><code>let str = "sunday, monday, happy days"
  
  var charStr = Array(str.characters)
  var charDict = Dictionary&lt;Character,Int&gt;()
  print("This is the character string array: " , charStr)
  </code></pre>