Filter=: (#~`)(`:6) assert 'ac' -: 1 0 1"_ Filter 'abc' intersect=:-.^:2 assert 'ab' -: 'abc'intersect'razb' odometer=: (4$.$.)@:($&1) Note 'odometer 2 3' 0 0 0 1 0 2 1 0 1 1 1 2 ) common=: 0 e. ~: assert common 1 2 1 assert -. common 1 2 3 o=: '123456789' {~ [: -.@:common"1 Filter odometer@:(#&9) NB. o is y unique digits, all of them f=: ,:"1/&g~ NB. f computes a table of all numerators and denominators pairs mask=: [: