- require 'set'
- p (123..329).map { |i| [i, i<<1, i*3] if Set.new("#{i}#{i<<1}#{i*3}".gsub("0",'').bytes).size == 9}.compact!
- #输出 [[192, 384, 576], [219, 438, 657], [273, 546, 819], [327, 654, 981]]
- #该片段来自于http://www.codesnippet.cn/detail/290520133656.html
来源: http://www.codesnippet.cn/detail/290520133656.html