title: Merge Sorted Arrays: LeetCode Submission has different output than LeetCode Playground and Visual Studio [C#]
body: <p>Trying to attempt to solve 88. Merge Sorted Array with C# using a for and a while loop. Leetcode instructs to save the correct output in [nums1] array instead of a return output. These are the assumptions and inputs for the merge sorted array.</p>
  <ol>
  <li><p>Prompt:
  <a href="https://i.stack.imgur.com/wpEW4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wpEW4.png" alt="enter image description here" /></a></p>
  </li>
  <li><p>My Code:</p>
  </li>
  </ol>
  <pre><code>
  public void Merge(int[] nums1, int m, int[] nums2, int n) {
          if (m == 0)
          {
              Console.WriteLine(&quot;Num 1 Before: {0}&quot;, nums1[0]);
              nums1 = (int[])nums2.Clone();
              Console.WriteLine(&quot;Num 1 After: {0}&quot;, nums1[0]);
          }
          
          else if ( n != 0 )
          {
              int arrTwoIt = 0;
              for ( int i = m; i &lt;m+n; i++)
              {
                  nums1[i] = nums2[arrTwoIt++];
              }
              
              int arrOneIt = 0;
              arrTwoIt = m;
              while (arrOneIt &lt; m)
              {
                  if (nums1[arrOneIt] &gt; nums1[arrTwoIt])
                  {
                      int leftItemTemp = nums1[arrOneIt];
                      nums1[arrOneIt] = nums1[arrTwoIt];
                      nums1[arrTwoIt++] = leftItemTemp;
                  }
                  
                  arrOneIt++;
              }
          }
      }
  </code></pre>
  <ol start="3">
  <li>Input: {0}, 0,  {1} , 1</li>
  <li>Output: LeetCode Playground:</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/OeT51.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OeT51.png" alt="enter image description here" /></a></p>
  <ol start="5">
  <li>Output: Visual Studios:</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/69EXh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/69EXh.png" alt="enter image description here" /></a></p>
  <ol start="6">
  <li>LeetCode Submission Output:</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/EUMem.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EUMem.png" alt="enter image description here" /></a></p>
  <p>I am not sure where to go from there. Im not sure what I am missing. Any help is appreciated.</p>