title: Analyze frequency of chars in string
body: <p>I'm trying to build program that analyzes the frequency of letters in string, and then switch the most frequently occurring letter with the second most frequently occurring letter.</p>
  
  <p>So it supposed to take few steps:</p>
  
  <ol>
  <li><p>Detection of the most high frequency char show in the string</p></li>
  <li><p>Detection of the most second frequency char show in the string</p></li>
  <li><p>Switch between the letters</p></li>
  <li><p>Print it</p></li>
  </ol>
  
  <p>My idea was to make an array with all the letters, and then use loop to pass over the string, compare it with the array and then — I don't know how to proceed from here.</p>
  
  <p>So when the input is like this:</p>
  
  <ul>
  <li><strong>donald trump will make america great again</strong></li>
  </ul>
  
  <p>the output after the algorithm will be:</p>
  
  <ul>
  <li>don<strong>e</strong>ld trump will m<strong>e</strong>ke <strong>e</strong>meric<strong>e</strong> gr<strong>ae</strong>t <strong>e</strong>g<strong>e</strong>in</li>
  </ul>
  
  <p>I'm trying to write the program but I don't know where to begin.</p>