title: what is the use of == a.end() in find() c++ stl in if conditional?
body: <p>i just solved a codeforces problem and i found something new about the find() c++ stl in the author's tutorial solution...but i cant understand that. here, in <code>find(a.begin(), a.end(), s-i) == a.end()</code> what does the<code>==a.end()</code> do?</p>
  
  <p>(link to the question: <a href="http://codeforces.com/contest/1293/problem/A" rel="nofollow noreferrer">http://codeforces.com/contest/1293/problem/A</a>)</p>
  
  <pre><code>//Author's tutorial solution
  #pragma GCC optimize("Ofast")
  
  #include &lt;bits/stdc++.h&gt;
  using namespace std;
  
  #define endl '\n'
  
  int n, s, k;
  vector&lt;int&gt; a;
  
  void Input() {
      cin &gt;&gt; n &gt;&gt; s &gt;&gt; k; a.clear(); a.resize(k);
      for (auto &amp;z: a) cin &gt;&gt; z;
  }
  
  void Solve() {
      for (int i=0; i&lt;=k; i++) {
          if (s-i &gt;= 1 &amp;&amp; find(a.begin(), a.end(), s-i) == a.end()) {cout &lt;&lt; i &lt;&lt; endl; return;} //SEE HERE
          if (s+i &lt;= n &amp;&amp; find(a.begin(), a.end(), s+i) == a.end()) {cout &lt;&lt; i &lt;&lt; endl; return;} //SEE HERE
      }
      assert(false); 
  
  int main(int argc, char* argv[]) {
      ios_base::sync_with_stdio(0); cin.tie(NULL);
      int T; cin &gt;&gt; T; while (T--) {Input(); Solve();} return 0;
  }
  </code></pre>