Intersection of Two Arrays III


  • 0

    Given two sorted arrays each without duplicated elements, write a function to compute their intersection (common elements).

    Example:
    Given nums = [1, 2, 3, 5] and nums2 = [3, 4, 5, 7], return [3, 5].

    Note:

    • Each common element should only appear once in the result.
    • The result also needs to be sorted.

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.