Done puzzel 56
authorNeil Smith <neil.git@njae.me.uk>
Sun, 9 Apr 2017 15:21:46 +0000 (16:21 +0100)
committerNeil Smith <neil.git@njae.me.uk>
Sun, 9 Apr 2017 15:21:46 +0000 (16:21 +0100)
euler56.ipynb [new file with mode: 0644]

diff --git a/euler56.ipynb b/euler56.ipynb
new file mode 100644 (file)
index 0000000..cfea324
--- /dev/null
@@ -0,0 +1,68 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "true"
+      ]
+     },
+     "execution_count": 1,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "load 'array-numbers.rb'"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "972"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "(1...100).to_a.product((1...100).to_a).map {|a, b| (a ** b).to_digits.sum}.max"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {
+    "collapsed": true
+   },
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Ruby 2.4.0",
+   "language": "ruby",
+   "name": "ruby"
+  },
+  "language_info": {
+   "file_extension": ".rb",
+   "mimetype": "application/x-ruby",
+   "name": "ruby",
+   "version": "2.4.0"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}