title: Find a graph, which has 6 vertices, each one is an end or a beggining of an edge and for which the code returts number 2
body: <p>I am trying to create a graph, which has 6 vertices, all of it's vertrices is a beginning or an end of an oriented edge and the following code returns number 2. Array G in the code is an adjacency matrix.</p>
  
  <pre><code>public static int exam(boolean[][] g){
   int r = 0;
   for (int i=0; i&lt;g.length; i++){
    for (int j = i+1; j&lt;g.length; j++){
     if (g[i][j] &amp;&amp; g[j][i]){
      r++;
     }
    }
   }
   return r;
  }
  </code></pre>
  
  <p>My solution is this <a href="https://i.stack.imgur.com/PBpKi.png" rel="nofollow noreferrer">graph</a></p>
  
  <p>Is it correct? Thanks!</p>