fork(1) download
  1. f=lambda x,y:x<y and f(x|x+1,y&y-1)or(x,y)
  2.  
  3. for (x,y) in (2,3), (3,2), (8,23), (42,81), (38,41), (16,73), (17,17):
  4. print '%2d, %2d -> %2d, %2d' % ( (x,y) + f(x,y) )
Success #stdin #stdout 0.01s 8968KB
stdin
(75, 41), (92, 33), (73, 53), (84, 36), (26, 44), (20, 61), (10, 98), (94, 41), (53, 6), (12, 25)
stdout
 2,  3 ->  3,  2
 3,  2 ->  3,  2
 8, 23 -> 31,  0
42, 81 -> 63,  0
38, 41 -> 47, 32
16, 73 -> 23,  0
17, 17 -> 17, 17