aboutsummaryrefslogtreecommitdiff
path: root/challenge-060/shawak/ruby
diff options
context:
space:
mode:
authorMaximilian <Shawak@users.noreply.github.com>2020-05-12 07:57:18 +0200
committerGitHub <noreply@github.com>2020-05-12 07:57:18 +0200
commit39f9e201a205916546764b254a0252e361255bb5 (patch)
treec4b2e61817e090c32b20d51d58971d3614281434 /challenge-060/shawak/ruby
parent153c901e19d715ce5e5bfab6b996f55ff5f407b6 (diff)
downloadperlweeklychallenge-club-39f9e201a205916546764b254a0252e361255bb5.tar.gz
perlweeklychallenge-club-39f9e201a205916546764b254a0252e361255bb5.tar.bz2
perlweeklychallenge-club-39f9e201a205916546764b254a0252e361255bb5.zip
task #2 solution
Diffstat (limited to 'challenge-060/shawak/ruby')
-rw-r--r--challenge-060/shawak/ruby/ch-2.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/challenge-060/shawak/ruby/ch-2.rb b/challenge-060/shawak/ruby/ch-2.rb
new file mode 100644
index 0000000000..d6c4f05030
--- /dev/null
+++ b/challenge-060/shawak/ruby/ch-2.rb
@@ -0,0 +1,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