aboutsummaryrefslogtreecommitdiff
path: root/challenge-060/shawak/ruby/ch-2.rb
blob: d6c4f050303136e42818911b5b8774ba01b009b2 (plain)
1
2
3
4
5
6
7
8
l=gets.split.map &:to_i
x,y=$<.map &:to_i
puts ((10**(x-1))..(10**x)-1).select{|x|x<y&&(x.digits-l).size<1}.join', '

# stdin:
# 0 1 2 5
# 2
# 21