Skip to main content
-2, complete program
Source Link
ngn
  • 15.3k
  • 2
  • 43
  • 87

APL (Dyalog Classic), 2929 27 bytes

{⊃{(⊃⍵~⍳⊃⍺),⊃⌽⍺∩⍳⊃⌽⍵}/⍸¨⍺=⊂⍵}⍸¨⎕=⊂⎕

Try it online!Try it online!

prompts for the array and then for var1,var2

APL (Dyalog Classic), 29 bytes

{⊃{(⊃⍵~⍳⊃⍺),⊃⌽⍺∩⍳⊃⌽⍵}/⍸¨⍺=⊂⍵}

Try it online!

APL (Dyalog Classic), 29 27 bytes

⊃{(⊃⍵~⍳⊃⍺),⊃⌽⍺∩⍳⊃⌽⍵}/⍸¨⎕=⊂⎕

Try it online!

prompts for the array and then for var1,var2

Source Link
ngn
  • 15.3k
  • 2
  • 43
  • 87

APL (Dyalog Classic), 29 bytes

{⊃{(⊃⍵~⍳⊃⍺),⊃⌽⍺∩⍳⊃⌽⍵}/⍸¨⍺=⊂⍵}

Try it online!