title: How did a vector become a matrix?
body: <p>So I found this code on the internet, but as I'm not that familiar with C++. I found difficult to understand this: how does a vector suddenly becomes a matrix?</p>
  
  <pre><code>int main(){
  
  int n;
  string v[MAX];
  
  cin &gt;&gt; n; 
  
  for(int i=0;i&lt;n;i++) 
   cin &gt;&gt; v[i];
  
  for(int i=0;i&lt;n-1;i++){
      int y1,y2;
      y1=v[i].size();
      y2=v[i+1].size();
      for(int j=0; j&lt;y1 &amp;&amp; j&lt;y2 ;j++)
          if(v[i][j]!=v[i+1][j]){  // here &lt;-
              int x1,x2;
              x1=(int) v[i][j]-'A';
              x2=(int) v[i+1][j] - 'A';
              m[x1][0]=true; 
              m[x2][0]=true;
              m[x1][x2+1]=true; 
              break;
          }
   }
  </code></pre>