title: No viable conversion from returned value of type 'int' to function return type (vectors)
body: <p>I am trying the hackerrank question and they gave said to give the output as &quot;Print two space-separated integers describing the respective numbers of times the best (highest) score increased and the worst (lowest) score decreased.&quot; Now, whenever I try to give only cout, it throws an error saying &quot;Non-void function does not return a value&quot;. Now normally, I used to give return 0 in these situations but here it is saying &quot;No viable conversion from returned value of type 'int' to function return type.&quot; I really don't know how to either return int in a vector function or simply put, how to return the answers back to the compiler.</p>
  <p>Here is my function</p>
  <pre class="lang-cpp prettyprint-override"><code>vector&lt;int&gt; breakingRecords(vector&lt;int&gt; scores) {
      int min=0,max=0;
      int maxUpdate=0;
      int minUpdate=0;
      for(int i=0;i&lt;scores.size();i++)
      {
          if(i==0)
          {
              min=max=scores[0];
              break;
          }
          if(scores[i]&gt;scores[i-1])
          {
              max=scores[i];
              maxUpdate++;
          }
          else if(scores[i]&lt;scores[i-1])
          {
              min=scores[i];
              minUpdate++;
          }
      }
      return 0;
  }
  </code></pre>
  <p>Note: If my logic has any error then please don't correct it. I want to find errors in my logic on my own just help me get my code run.</p>