From: Neil Smith Date: Sun, 9 Apr 2017 15:21:46 +0000 (+0100) Subject: Done puzzel 56 X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=72753dc77398c7394b75ad13a197b2514c7a0180;p=project-euler.git Done puzzel 56 --- diff --git a/euler56.ipynb b/euler56.ipynb new file mode 100644 index 0000000..cfea324 --- /dev/null +++ b/euler56.ipynb @@ -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 +}