Finding common elements in two arrays of different size

后端 未结 10 897
隐瞒了意图╮
隐瞒了意图╮ 2020-12-14 18:08

I have a problem to find common elements in two arrays and that\'s of different size.

Take , Array A1 of size n and Array A2 o

10条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 18:35

    In APL:

    ∪A1∩A2
    

    example:

          A1←9, 4, 6, 2, 10, 10
          A1
    9 4 6 2 10 10
    
          A2←14, 3, 6, 9, 10, 15, 17, 9
          A2
    14 3 6 9 10 15 17 9
    
          A1∩A2
    9 6 10 10
          ∪A1∩A2
    9 6 10 
    

提交回复
热议问题