18 "output_type": "execute_result"
22 "load 'array-numbers.rb'"
27 "execution_count": 15,
38 "execution_count": 15,
40 "output_type": "execute_result"
45 " def pandigital?(start=1)\n",
46 " self.to_digits.sort == (start..9).to_a\n",
53 "execution_count": 16,
64 "execution_count": 16,
66 "output_type": "execute_result"
70 "192384576.pandigital?"
75 "execution_count": 17,
86 "execution_count": 17,
88 "output_type": "execute_result"
97 "execution_count": 18,
108 "execution_count": 18,
110 "output_type": "execute_result"
114 "19238457.pandigital?"
119 "execution_count": 19,
130 "execution_count": 19,
132 "output_type": "execute_result"
136 "1923845706.pandigital?"
141 "execution_count": 20,
152 "execution_count": 20,
154 "output_type": "execute_result"
158 "1923845706.pandigital?(0)"
163 "execution_count": 25,
174 "execution_count": 25,
176 "output_type": "execute_result"
185 "execution_count": 31,
196 "execution_count": 31,
198 "output_type": "execute_result"
203 " def concat_product(n)\n",
204 " (1..n).flat_map {|m| (self * m).to_digits}.to_i\n",
211 "execution_count": 34,
222 "execution_count": 34,
224 "output_type": "execute_result"
228 "192.concat_product(3).pandigital?"
233 "execution_count": 35,
244 "execution_count": 35,
246 "output_type": "execute_result"
250 "9.concat_product(5).pandigital?"
255 "execution_count": 48,
266 "execution_count": 48,
268 "output_type": "execute_result"
272 "(1..10**5).to_a.product((2..5).to_a).select {|n, m| n.concat_product(m).pandigital?}.map {|n, m| n.concat_product(m)}.max"
277 "execution_count": null,
287 "display_name": "Ruby 2.4.0",
292 "file_extension": ".rb",
293 "mimetype": "application/x-ruby",