You are given two integer arrays nums1 and nums2.
The numbers of nums1 and nums2 are placed on two separate horizontal lines in their original order. You may draw connecting lines between elements where a line connects nums1[i] and nums2[j] such that:
nums1[i] == nums2[j]
The line does not intersect with any other drawn line.
Return the maximum number of uncrossed connecting lines that can be drawn.
Note: A connecting line cannot intersect another line at any point, including its endpoints, which means each position in
nums1andnums2can be connected at most once.
Constraints:
nums1.length, nums2.length
nums1[i], nums2[j]
You are given two integer arrays nums1 and nums2.
The numbers of nums1 and nums2 are placed on two separate horizontal lines in their original order. You may draw connecting lines between elements where a line connects nums1[i] and nums2[j] such that:
nums1[i] == nums2[j]
The line does not intersect with any other drawn line.
Return the maximum number of uncrossed connecting lines that can be drawn.
Note: A connecting line cannot intersect another line at any point, including its endpoints, which means each position in
nums1andnums2can be connected at most once.
Constraints:
nums1.length, nums2.length
nums1[i], nums2[j]