How to count matching symbols in two words? If the words are same length, then it's trivial: 'APL'+.='SPL'
Maiden attempt:
∇N←A IS B
N←⌊/≢¨A B
N←(N↑A)+.=N↑B∇
Another approach:
'APL'{+/∊((⍳≢⍺)∘.=⍳≢⍵)×⍺∘.=⍵}'SPLENDID'
However, I don't like both of them.
Maiden attempt:
∇N←A IS B
N←⌊/≢¨A B
N←(N↑A)+.=N↑B∇
Another approach:
'APL'{+/∊((⍳≢⍺)∘.=⍳≢⍵)×⍺∘.=⍵}'SPLENDID'
However, I don't like both of them.