title: How to write For loop with two index value in Kotlin?
body: <p>I have java code like the following:</p>
  <pre class="lang-java prettyprint-override"><code>class Solution {
  
      public String longestCommonPrefix(String[] strs) {
          // Argument checks
          if (strs == null || strs.length == 0) return &quot;&quot;;
          if (strs.length == 1) return strs[0];
          
          StringBuilder sb = new StringBuilder();
          Arrays.sort(strs);
          char[] first = strs[0].toCharArray();
          char[] last = strs[strs.length - 1].toCharArray();
          for (int i = 0, j = 0; i &lt; first.length &amp;&amp; j &lt; last.length; i++, j++) {
              if (first[i] != last[j]) break;
              sb.append(first[i]);
          }
          return sb.toString();
      }
  }
  </code></pre>
  <p>My question is how I write for loop like <code>for (int i = 0, j = 0; i &lt; first.length &amp;&amp; j &lt; last.length; i++, j++)</code> in Kotlin? Thanks!</p>
  <p>===== Update ======== 29 July 2022</p>
  <p>I think I am providing a bad code example here... please focus on the question: how I write for loop like <code>for (int i = 0, j = 0; i &lt; first.length &amp;&amp; j &lt; last.length; i++, j++)</code> in Kotlin?</p>