title: reverseCase along with swap Integer in kotlin
body: <p>I am trying to write an effective code to reverse Case in kotlin .</p>
  <p><em>HeLLo 5worLD6</em>  -&gt; <strong>hEllO 6WORld5</strong>
  5 and 6 are swap as they have equal difference</p>
  <p>Initially I am trying to swap digit's but forEachIndex doesn't change in my existing list . Why?</p>
  <pre><code>val uniqueWords = str.split(&quot; &quot;).map { it.toCharArray() }
      uniqueWords.forEachIndexed { index, chars -&gt;
          chars.forEachIndexed { charIndex, c -&gt;
              val endIndex = chars.lastIndex - charIndex
              if(c.isDigit() &amp;&amp; chars[endIndex].isDigit()){
                  chars[charIndex] = chars[endIndex]
                  chars[endIndex] = c
              }
          }
      }
  </code></pre>
  <p>val mVal = uniqueWords // but it doesn't swap integers</p>