<p>You are given two integer arrays <code>nums1</code> and <code>nums2</code>. We write the integers of <code>nums1</code> and <code>nums2</code> (in the order they are given) on two separate horizontal lines.</p>
<p>We may draw connecting lines: a straight line connecting two numbers <code>nums1[i]</code> and <code>nums2[j]</code> such that:</p>
<ul>
<li><code>nums1[i] == nums2[j]</code>, and</li>
<li>the line we draw does not intersect any other connecting (non-horizontal) line.</li>
</ul>
<p>Note that a connecting line cannot intersect even at the endpoints (i.e., each number can only belong to one connecting line).</p>
<p>Return <em>the maximum number of connecting lines we can draw in this way</em>.</p>