title: String comparison looping function from interview
body: <p>Input should be a string and an integer J. The function needs to print out the string as entered, but if a character is the same as any of the last J characters, put a X in between.</p>
  
  <ol>
  <li><code>DoSomething("AA",2)</code> should output <code>AXXA</code>; needs to have 2 characters printed before it prints the same one.</li>
  <li><code>DoSomething("ABB",2)</code> should output <code>ABXXB</code></li>
  <li><code>DoSomething("ABABA",3)</code> should output <code>ABXXABXXA</code>.</li>
  </ol>
  
  <p>I tried doing this in PowerShell first:</p>
  
  <pre><code>DoSomething -string 'AA' -cool 3
  </code></pre>
  
  <p>Should output AXXXA</p>
  
  <pre><code>DoSomething -string 'AB' -cool 3
  </code></pre>
  
  <p>Should output AB</p>
  
  <pre><code>DoSomething -string 'ABA' -cool 3
  </code></pre>
  
  <p>Should output ABXXA</p>
  
  <pre><code>DoSomething -string 'AA' -cool 1
  </code></pre>
  
  <p>Should output AXA</p>
  
  <pre><code>DoSomething -string 'ABC' -cool 1
  </code></pre>
  
  <p>Should output ABC</p>
  
  <pre><code>DoSomething -string 'AAA' -cool 2
  </code></pre>
  
  <p>Should output AXXAXXA</p>