summaryrefslogtreecommitdiff
path: root/problem33.ijs
blob: fedc03092439bbfe17d090118113483988696ae5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
digits =. 10&#.^:_1
funny =. dyad define"0
	f =. x%y
	'n1 n2' =. digits x
	'd1 d2' =. digits y
	cross1 =. (n2 = d1) *. f = n1%d2
	cross2 =. (n1 = d2) *. f = n2%d1
	(1,f){~ cross1+.cross2
)
pairs =. ,funny/~x:10+i.90
fractions =. ;pairs#~1>pairs
problem33 =: {: 2 x: */fractions