13 " (1..self).inject(:*) || 1\n",
15 " alias :! :factorial\n",
29 "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
34 "output_type": "execute_result"
38 "(1..100).each do |n|\n",
39 " (1..n).each do |r|\n",
59 "output_type": "execute_result"
63 "(1..10).to_a.product((1..10).to_a).select {|n, r| n >= r}.map {|n, r| n.! / (r.! * (n - r).!)}.select {|c| c> 100}.length"
81 "output_type": "execute_result"
85 "(1..100).to_a.product((1..100).to_a).select {|n, r| \n",
86 " n >= r}.map {|n, r| \n",
87 " n.! / (r.! * (n - r).!)}.select {|c| \n",
88 " c > 10 ** 6}.length"
93 "execution_count": null,
103 "display_name": "Ruby 2.4.0",
108 "file_extension": ".rb",
109 "mimetype": "application/x-ruby",