aboutsummaryrefslogtreecommitdiff
path: root/challenge-134/conor-hoekstra/apl/ch-2.apl
blob: ca45f28b717c7d315236b3fe0c419e8fe3c08623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
distinctTermCount  {
     t  (∘.×)
     'Distinct Terms:',∪,t
     'Count:',≢∪,t
}

⍝ Tests
      3 distinctTermCount 3
1 2 3
2 4 6
3 6 9
Distinct Terms: 1 2 3 4 6 9
Count: 6
      
      3 distinctTermCount 5 
1 2 3  4  5
2 4 6  8 10
3 6 9 12 15
Distinct Terms: 1 2 3 4 5 6 8 10 9 12 15
Count: 11