The intersection of two sorted arrays

后端 未结 8 1421
臣服心动
臣服心动 2020-11-29 02:21

Given two sorted arrays: A and B. The size of array A is La and the size of array B is Lb. How

8条回答
  •  有刺的猬
    2020-11-29 02:59

    Very Simple with the PYTHON

    Example: A=[1,2,3,5,7,9,90] B=[2,4,10,90]

    Here we go three lines of code

    for i in A:
         if(i in B):
            print(i)
    

    Output:2, 90

提交回复
热议问题