138. Intersection of two sorted arrays

easy  - accepted / - tried

Given 2 sorted array of integers, find the elements that exist in both arrays.

intersect(
  [1,2,2,3,4,4],
  [2,2,4,5,5,6,2000]
)
// [2,2,4]
  1. The arrays might have duplicate numbers.
  2. The order of returning result doesn't matter.
  3. What is the time & space cost of your approach? Could you improve it?

What is time & space complexity of your approach?

(1)
(136)