title: partial_sort not working correctly for vector
body: <p>Trying to solve 'move zeros' question. I have to shift all zeros of vector at last and then all other numbers need to be arranged in ascending order.</p>
  <pre><code>class Solution {
  public:
      
      void moveZeroes(vector&lt;int&gt;&amp; nums) {
          int position = nums.size()-1;
          for(int i=0;i&lt;nums.size();i++){
              if(nums[i]==0 &amp;&amp; nums[position]!=0 &amp;&amp; position&gt;=i){
                  int temp=nums[i];
                  nums[i]=nums[position];
                  nums[position]=temp;
                  
                  position-=1;
              }
              for(int i=0;i&lt;nums.size();i++){
                  cout&lt;&lt;nums[i]&lt;&lt;&quot; &quot;;
                  
              }
              
              cout&lt;&lt;endl;
          }
          std::partial_sort(nums.begin(), nums.begin()+position, nums.end());
      }
  };
  </code></pre>
  <p><a href="https://i.stack.imgur.com/rq0Cb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rq0Cb.png" alt="enter image description here" /></a></p>