Created
December 5, 2023 23:17
-
-
Save jaroslawjanas/5ca7a5cddd8888e641c502d5bf5fb4fd to your computer and use it in GitHub Desktop.
AoC 2023 - Day 1.ipynb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "nbformat": 4, | |
| "nbformat_minor": 0, | |
| "metadata": { | |
| "colab": { | |
| "provenance": [], | |
| "toc_visible": true, | |
| "authorship_tag": "ABX9TyPQ8/hp00RB98ddNfVsY1jK", | |
| "include_colab_link": true | |
| }, | |
| "kernelspec": { | |
| "name": "python3", | |
| "display_name": "Python 3" | |
| }, | |
| "language_info": { | |
| "name": "python" | |
| } | |
| }, | |
| "cells": [ | |
| { | |
| "cell_type": "markdown", | |
| "metadata": { | |
| "id": "view-in-github", | |
| "colab_type": "text" | |
| }, | |
| "source": [ | |
| "<a href=\"https://colab.research.google.com/gist/jaroslawjanas/5ca7a5cddd8888e641c502d5bf5fb4fd/aoc-2023-day-1.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "# Advent of Code 2023" | |
| ], | |
| "metadata": { | |
| "id": "PLPtOMFkVYn7" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "# Puzzle - Part 1" | |
| ], | |
| "metadata": { | |
| "id": "UaMwBA4kVi4i" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "**--- Day 1: Trebuchet?! ---**\n", | |
| "\n", | |
| "Something is wrong with global snow production, and you've been selected to take a look. The Elves have even given you a map; on it, they've used stars to mark the top fifty locations that are likely to be having problems.\n", | |
| "\n", | |
| "You've been doing this long enough to know that to restore snow operations, you need to check all **fifty stars** by December 25th.\n", | |
| "\n", | |
| "Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants **one star**. Good luck!\n", | |
| "\n", | |
| "You try to ask why they can't just use a **weather machine** (_\"not powerful enough\"_) and where they're even sending you (_\"the sky\"_) and why your map looks mostly blank (_\"you sure ask a lot of questions\"_) and hang on did you just say the sky (_\"of course, where do you think snow comes from\"_) when you realize that the Elves are already loading you into a trebuchet (_\"please hold still, we need to strap you in\"_).\n", | |
| "\n", | |
| "As they're making the final adjustments, they discover that their calibration document (your puzzle input) has been **amended** by a very young Elf who was apparently just excited to show off her art skills. Consequently, the Elves are having trouble reading the values on the document.\n", | |
| "\n", | |
| "The newly-improved calibration document consists of lines of text; each line originally contained a specific **calibration value** that the Elves now need to recover. On each line, the calibration value can be found by combining the **first digit** and the **last digit** (in that order) to form a single **two-digit number**.\n", | |
| "\n", | |
| "For example:\n", | |
| "\n", | |
| "```\n", | |
| "1abc2\n", | |
| "pqr3stu8vwx\n", | |
| "a1b2c3d4e5f\n", | |
| "treb7uchet\n", | |
| "```\n", | |
| "\n", | |
| "In this example, the calibration values of these four lines are `12`, `38`, `15`, and `77`. Adding these together produces `142`.\n", | |
| "\n", | |
| "Consider your entire calibration document. What is the sum of all of the calibration values?" | |
| ], | |
| "metadata": { | |
| "id": "-Dzt9c3dVj7Y" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Input" | |
| ], | |
| "metadata": { | |
| "id": "RJ_39L89YeMJ" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 1, | |
| "metadata": { | |
| "id": "JqC_70moVVMg" | |
| }, | |
| "outputs": [], | |
| "source": [ | |
| "input = \\\n", | |
| "\"\"\"eightqrssm9httwogqshfxninepnfrppfzhsc\n", | |
| "one111jxlmc7tvklrmhdpsix\n", | |
| "bptwone4sixzzppg\n", | |
| "ninezfzseveneight5kjrjvtfjqt5nineone\n", | |
| "58kk\n", | |
| "5b32\n", | |
| "1dtwo\n", | |
| "six7two7sixtwo78\n", | |
| "mvhsixpptztjh13sixthree2\n", | |
| "six1bqqvrxndt\n", | |
| "fourmk5grmqone944nbvtj\n", | |
| "twofiveqxfivezpkvfvxt5eightjhnpl\n", | |
| "fpfqp7three7\n", | |
| "scmlf76ninegjzjkj97two\n", | |
| "fivetkhfnnx22\n", | |
| "sevenxvbcbsvxr7eighttwo\n", | |
| "1hvhqqmrs1bgttshthg6\n", | |
| "4bvnccbdh4onefztdrpq62vvbnvpxxvgrngnfjgfk\n", | |
| "653spgrvd\n", | |
| "sixctlhkjmmxh2fourfivenine37\n", | |
| "229mjp3txmqsxxqdbnnnbrtrcctgzseven\n", | |
| "jfourdbpcjc39bhglgnine\n", | |
| "bvnltxdmsp7twoxzpdjdvkxeight4twothree\n", | |
| "jlvcdrkhzh8seven3\n", | |
| "418oneeight\n", | |
| "53flcrlvqdeight84frmdcsixchcbc\n", | |
| "114sixone1eight2\n", | |
| "xrbtzbklqsl11\n", | |
| "bhfhszrhzgrhsfd2threeseventwosevenoneseven\n", | |
| "four9one\n", | |
| "5p\n", | |
| "twovhjpdxmcxshnhv5vs\n", | |
| "qkkqeightcxcltnn7one9pmhlmvsxnine\n", | |
| "4cbptmvp1\n", | |
| "84xgm\n", | |
| "bzsmqhkrdtdmhhjgrjsdfour1ninetwo61\n", | |
| "onetwoeightgflhlgksevennine7two6\n", | |
| "mbjhkhfour6\n", | |
| "8cvqk6eightonethree1\n", | |
| "qhbllbnlkr3rcsmjvztgd\n", | |
| "18eight4\n", | |
| "hhc6onegvkgkqs5mvsone\n", | |
| "66bnfj\n", | |
| "one99xvrhninefive\n", | |
| "eight96nxcjjddmseightxvgsixfiverrzpvmgnl\n", | |
| "rpgpczdsxpjgql39\n", | |
| "855dnthhxld6eight\n", | |
| "four29twosspz1\n", | |
| "sixfiveqvrbcdr9fourlrkpkmxphlsbone\n", | |
| "341\n", | |
| "mhqjjg9six9nine\n", | |
| "7pvjctsgvsix64\n", | |
| "75twotwothreegcvssgbvhpzcnbgteight\n", | |
| "7keight8eight\n", | |
| "52threerhfmklssxcptmnlr4hqc4\n", | |
| "xndfqvgxn3five\n", | |
| "974lknineseven\n", | |
| "rlnsix3\n", | |
| "771m1\n", | |
| "xvtjhq7six64threeeightgspmxgv\n", | |
| "4sbqdxbmmzj6fiveone\n", | |
| "onesvvch4rvhmvncnk\n", | |
| "mkzsftp69six6\n", | |
| "fiveptnn7\n", | |
| "94lsgsjxrrghxxsr4\n", | |
| "1grnvgpeightjthqmrfnszpfhfninefive9mbtf\n", | |
| "qtsdfour2\n", | |
| "5mfhmskpcvqbxjzzxt4lq3sevenkv\n", | |
| "rbhjk1cdzjhtzkcbtvmfm\n", | |
| "nine4eightpmrptkb\n", | |
| "bfiveeight1lxzkzvbtkkgxxs38\n", | |
| "mxcgbjqvhd1sevensevenrgp7two\n", | |
| "fourxrdzzmjfmtr62one\n", | |
| "sevenppqtlhvtwo7phlrbssxb\n", | |
| "dhbnjmxg3bsgbhmlfiveseventwo\n", | |
| "twoonemrbftgtzeightqjmjctmq55\n", | |
| "ggk2lt586dfzqbjsvj1one\n", | |
| "jtgpzjjtwo86seventwo\n", | |
| "37nine4onebqvsnmvg277\n", | |
| "hmpnzmqsfour6\n", | |
| "xzfhgzllmcbc56vpbpbbjffmgr3jrc\n", | |
| "5lclone\n", | |
| "hjbvkdtmrgvpfive9sevenfive1nlzqlkfrg\n", | |
| "htwonetgxvjdkrvjsfjjbfmcthseven29\n", | |
| "six89bdlssd\n", | |
| "3eight6one\n", | |
| "vtbsix2twolzrhfr1\n", | |
| "vhdcvtj5\n", | |
| "167nsnmgxhtvn54fivedcbgrhm\n", | |
| "4three1five82four\n", | |
| "15eightonethreesixthree\n", | |
| "dvhtsccljt51\n", | |
| "pbnfrxblk3sevenxjcmcvhlgrghpbgdnpl8xsr3fiveoneightq\n", | |
| "242three8\n", | |
| "2fivehgqfxgl8kpdknxhmk5bmmsbz\n", | |
| "fivejvjeight6fsqgtpvcb\n", | |
| "1threelgkbhlhhlmrbvxqqgf\n", | |
| "klmqfgfg1gnine253psn8\n", | |
| "47eight\n", | |
| "eight83mvdtsqppjhgjnsvngfive\n", | |
| "7mcmzvsv6seven\n", | |
| "56seven98three4three\n", | |
| "pfnbthreegthreefknjm4five\n", | |
| "2nqgrdcshfpjfpqdrvnq1twoccpmxpxvv\n", | |
| "xtwo7threemxbtpsvjkgrfivethree2\n", | |
| "9pkdfourfour1zjvczkhpbj\n", | |
| "1three2\n", | |
| "pkkbphkgqfivellrnvnkdxpql3\n", | |
| "ppc62\n", | |
| "one73ptfxsbbpqqgctdjhzjsjc91\n", | |
| "nine7threefourvvk\n", | |
| "six59542xcxqcbnrvzfbshcxxddz2\n", | |
| "ftsfj2ninesix1hdjsrpkonelklfpltv\n", | |
| "ninehmxgkqbmhvtlvdmdtvpeighttqfour1three\n", | |
| "frbnineeight4168ksmjstpqvzhnn\n", | |
| "rgnrntwohvqhgxxfkonefour4mfdr5ftgtjjv\n", | |
| "3ninejbszdvdgznfourxpcxspqxnthlngkncvnineccq\n", | |
| "threemjglxtp5cqmtwotwo2seventwonerkl\n", | |
| "eightsevensevenlmbjzprggthree1eight\n", | |
| "57nineninezdcf\n", | |
| "cqoneighteightjnrfkplvninefivemck18mnhszhkv4\n", | |
| "tbvdcsjsvmxtshv3fourseven4kmxvvfour9\n", | |
| "bxcsix19six8dnqsbx\n", | |
| "7five81ncchkdk\n", | |
| "four4ck7rtjmjpccpeightone\n", | |
| "fivetwo6nine1tdczktmfninelrbnnine\n", | |
| "onetwo9twoeight5sevensix\n", | |
| "cvvtbmninebneightsix1dnnfkgmnm\n", | |
| "h7three3\n", | |
| "tpnzsdm9sixtg5sixqvcqsq3\n", | |
| "1sevenzmbcpgtfrjvq\n", | |
| "r8757\n", | |
| "fournineseven6fourfour\n", | |
| "798dpbrkfourtwoxdrgqkrkmfeight7\n", | |
| "threebvqqjcldjx4nine5\n", | |
| "3hbl\n", | |
| "twodndcfddkvfivermvkrfzsnqthree5\n", | |
| "mhdcvsixmnqlvmvxmxfour3ct\n", | |
| "25dpfsrbcllhtwothree2pthreezfhjx\n", | |
| "dcfggnine1onetwoone\n", | |
| "vtbmbpgffive2hdmzjzqqqc4one\n", | |
| "zg11\n", | |
| "txrknhvhbv183\n", | |
| "dlvscqszz82nvtpb7tktvtgjbml\n", | |
| "twofour5sevensmqfjrjcndmvcvqdfsrsix\n", | |
| "446sixeight6rbrltdzf\n", | |
| "132ncq1\n", | |
| "4ninezdfzgvzf4four7qkzstcq\n", | |
| "7rx5xntgxfpmvsevenzmzmbjlc3fivefive\n", | |
| "threeseven7tshthree\n", | |
| "gnbqhninecjnhlpcfivenine18\n", | |
| "gjntwonenllmzgqsvq36lc45fourdrtzlctr\n", | |
| "3tqgbfrk\n", | |
| "zldl3zxpfbpveight\n", | |
| "2ninetgppcvqrq\n", | |
| "7one1sixeighttxcnhltwooneeight\n", | |
| "bsm3hslqcr8xslndqnnvfpzvprlkt\n", | |
| "khvptwo7kkbznndpqsevensevenvlr\n", | |
| "sevenscneight8one4qnkc\n", | |
| "2v\n", | |
| "2threerjnineonev\n", | |
| "68qhknonebtxvmqh\n", | |
| "3btb\n", | |
| "kcxbqzbjqt3twofourfxdlprsxkzlmflbveight\n", | |
| "9bmdcninecjdv7\n", | |
| "ceightwoninelkbbfxgsv9fb5n\n", | |
| "ztwo2\n", | |
| "7four9cpkclqxtrmpdgzxgtwo\n", | |
| "8dghrmgprdjeight8knnb852one\n", | |
| "2three36eightfournone2\n", | |
| "6ztwofkzlhvjdrxtsmlbgczf\n", | |
| "knine6ninebpmzjbkg9tttkhtgcklbfive\n", | |
| "sevenv3\n", | |
| "411one4483\n", | |
| "88jvjggxqfour3zrbvbxjzmthree\n", | |
| "fivelqcnqfvgp18t\n", | |
| "fivejceightqlsdrmrnbzfbjskstzrllxrdlcxpjkvf1\n", | |
| "832\n", | |
| "sixfive77rhkjdhvbpdfjxpkmfdq66qqtfpfs\n", | |
| "fv6svkbnsgtpznblnvkvk5\n", | |
| "sixsevenfoursixeight486\n", | |
| "gsbfrjpngshpmlxf2\n", | |
| "gbmmmvdhffbbcq3\n", | |
| "5fivehxx28\n", | |
| "snjxttwo1zd5sixklfl\n", | |
| "szsvdzsix3nine32nine\n", | |
| "onervkhknmnsix3four363\n", | |
| "1btphrrvxdeightonekdhv8\n", | |
| "gkphmq73lfhflk66xpfive2\n", | |
| "611four3gnjsdkvksjdxfiveeight\n", | |
| "klbvb9zk4eightninetwo\n", | |
| "mreight59sevengqbhnspvhqcj2six\n", | |
| "hnvgkmljlpthsgjrzmsevensix6fcvtxddbnx5\n", | |
| "ckfvkblhvv6gbsnlsevenktblt29three\n", | |
| "eightfoursevendnsghkfsg8fivextnnine\n", | |
| "5hrdqmfjq\n", | |
| "twojcvkkjklzmfive2fourxqgdsdgzrjltwo7\n", | |
| "onetwonvxnxnntxcthree3\n", | |
| "threentwonine6\n", | |
| "sprfmxlqvb9jnbzltskxppqzdscrvhpfvjjcqhxcf\n", | |
| "sixhfour95\n", | |
| "41fourqhpjbztknqnfpxvzc\n", | |
| "two23sevenfgmmnszone113\n", | |
| "one41seven57\n", | |
| "oneninebqqklhk6gmdzddbhgzqcmxxfnmrvr\n", | |
| "4mkpgv87eightckzjjfm\n", | |
| "vhgdmvncxn88ldbt7464\n", | |
| "gcczfprplf7\n", | |
| "6eightninesxthreefive99\n", | |
| "two69fivecjxjhgjmgvttl9\n", | |
| "mztbzjmgxnpkfrqnrbgkgfourjjfjtone8eight\n", | |
| "63mggldkcprlz\n", | |
| "6sevenfourfive\n", | |
| "1zvmrdnpzcsqqmxscn\n", | |
| "five5tkgb8rrztmcfivebknjd\n", | |
| "7pscpfive\n", | |
| "eight9sixgfvhvlcnineeight\n", | |
| "seven99fourtwojvxfrqmrdlthree\n", | |
| "sppcgnjzeight93j\n", | |
| "fivek7seventhree\n", | |
| "twornbhtrlnznpctrxhqtngzdtnvfb2\n", | |
| "sevenfivefour63five38nlrxfcjpm\n", | |
| "qvtdcspc4zxmmhpklhcdlznqfg46lct5one\n", | |
| "1bnndtnsfjdsevenfivetwo3k85\n", | |
| "8five9six\n", | |
| "3ltcc7trmmhbbbpjfive\n", | |
| "cmbchhhczmqlp3\n", | |
| "nctz78twodljcqvplcqg\n", | |
| "nine4sevenpnbbztpvkbgztb\n", | |
| "zseven9eight\n", | |
| "fourktzscmnrvddnnzsqfnfctzpdvtwo9\n", | |
| "nrtbgdjpm2ldcfdm5jjhx9\n", | |
| "jq9two68kjttwo67\n", | |
| "lnneightfourzqz6lgvxnthreeseven7\n", | |
| "fiveglp85\n", | |
| "ninefouronesix7k1three\n", | |
| "3five5sevendhtmjhbh2\n", | |
| "rbjhnmmgsvmtk8four\n", | |
| "vtrvvjsixhnctwocvskgzt3two3\n", | |
| "kxfive5threezgtd2\n", | |
| "2fivemcnngtzxsgbxmvbl\n", | |
| "eightlrlztkvhfivefour5\n", | |
| "2twojcq7qrrbddmpsb\n", | |
| "3twosixthreebqtoneone2\n", | |
| "nine9six3vlmpqbgjjqdftldpq\n", | |
| "tgrglqfxxc2onetwo76oneonex\n", | |
| "one48one\n", | |
| "fivesgsnrzsms6one\n", | |
| "fiveseven1tzhxdknkseven4\n", | |
| "3sprtonefivelxg47\n", | |
| "twotwoseven3ninenqdvxgm\n", | |
| "nskjpvvqeightnine93fivecngkjcd3\n", | |
| "ltfxscllxk9pjznpnmhfmrzmqbq\n", | |
| "4nineeight6four7\n", | |
| "fjtpj763\n", | |
| "four6six73htbstbbpztwofj\n", | |
| "oneonetwo2five43three\n", | |
| "five8bgcjnlzcgqpfkn\n", | |
| "11mcn\n", | |
| "9twovhkltdpkqzc65six\n", | |
| "8fkprfkg9xfjxspqpshlfkqpnrt\n", | |
| "4sblrf7745\n", | |
| "lblxmbzfour6187tggqllj\n", | |
| "dhdmlx71mbbxtvhszhsvcm\n", | |
| "six1qbqglfsssx\n", | |
| "164tsthbb2\n", | |
| "8nineldrtltqfivebqnrthrm\n", | |
| "sevenlsjbsklhxxfiveclbldxxtrdllxzthree6eight\n", | |
| "18gnkrxfmnineone\n", | |
| "six4threetwoeightgcn\n", | |
| "vmknclnmnphb2czdbjmcone\n", | |
| "eightq67\n", | |
| "eighthnzslhbblr85eight3\n", | |
| "3457kdzhnppqz5four8two\n", | |
| "crcskvmhthree41\n", | |
| "8pccnsbv8ln3\n", | |
| "4eightonevd\n", | |
| "pdz9threenine\n", | |
| "3sg5gkrncz\n", | |
| "6dxnslkl3xqlnm965twonexxn\n", | |
| "9nlhmmkzsdbpdctd7ninec\n", | |
| "62eightnine7nine3lrd\n", | |
| "qbprlzczreight7threegqnrshrhc\n", | |
| "3qlmr\n", | |
| "three1twojgptkzgxmf\n", | |
| "twosvdsfourone8\n", | |
| "5sixfourzvjtkpk\n", | |
| "six418\n", | |
| "five523fivecbs\n", | |
| "nineninesevenztfggvfkgkzfcm2\n", | |
| "qnsix5dnv7three\n", | |
| "three5twofour\n", | |
| "hlmtnzsmlnjxdtwo6\n", | |
| "9sixnglrctg\n", | |
| "onecrgfq5hdldpc\n", | |
| "nhzctlx94eight\n", | |
| "19djvld\n", | |
| "tzp8zzv8six1\n", | |
| "1nsnine5sixhqxfk\n", | |
| "33sixtwojrdvksrfsnltglggxdhbsxf\n", | |
| "bbvtpxptrnvjqzl3rldseventhree6\n", | |
| "2lcntfphb2lgpjbdeight\n", | |
| "fivetwo1jjgkt9kltwo1nc\n", | |
| "7xnmrscpfkthreejqbhlrtf4sixrbfrone\n", | |
| "3threetqfkv1twofive\n", | |
| "95ninejlftlxrs1nxxfsqz\n", | |
| "hrsrszgrcl9seven8eightksdnhqsq7eight\n", | |
| "5436ninefour\n", | |
| "one5five\n", | |
| "prcmxone8lhkblvr714three\n", | |
| "92btgsllktgf7fivejhgsg2eight5\n", | |
| "fourmm61nine558nine\n", | |
| "bxjx2\n", | |
| "one6onetwotjxthreefour8\n", | |
| "threedkpnpfvgt1one3nine1\n", | |
| "bxfour3two2sb4twondmfdpsz\n", | |
| "11sevennrpxftwooneeightmx6\n", | |
| "9mqxcrjxnp7hdjgqktxm\n", | |
| "2rnjlg7mbxstzbdh\n", | |
| "qmsixhckzone1\n", | |
| "qzsnq6sixtwosixtwohhgbsrqgnine3\n", | |
| "foureight7scksqtkmnfiveseven765\n", | |
| "15oneckvshqd\n", | |
| "41tzlxsfivebsckffdps\n", | |
| "threefivefournine7\n", | |
| "5fiveonefour8lhqmltwoeighttwo\n", | |
| "four5six\n", | |
| "mhnrspfourmflmvkc52cjkvxheightsevendtddjdcnb\n", | |
| "vxrrlfnlqf1twoeightninesixonetwo\n", | |
| "8xonetwo2\n", | |
| "rveightwo79three\n", | |
| "onebjlr9sixldqrbtwo4\n", | |
| "f1lhrbsix\n", | |
| "mbbkv7ffpk\n", | |
| "8twofourmxqvkqfcjfoureightplgpmrtxm3\n", | |
| "2rtrxjzqeighteightqtmsfnpdscpgqvxd7\n", | |
| "nineqggljvzvxltwozsvsfournine9\n", | |
| "ninexpmnnvqsfhnprqrqlcgfive9mtnflvttwoqlgphhb\n", | |
| "11kbpmv1\n", | |
| "htspdnh1xhbbh3lzcjjx1\n", | |
| "five6fivefive5six\n", | |
| "sxtbktj7\n", | |
| "ncvkgvgbeightfour89ttbrjthree\n", | |
| "xcgxzxbfnkxdqn73eight\n", | |
| "5nine4fivesixtwotwo1\n", | |
| "ffgzdfhn6\n", | |
| "fourzvtfcczlxhnnx5three\n", | |
| "threednfntx4eightwovql\n", | |
| "sixtwoveightnine7twonineseven\n", | |
| "seveneightcclmgknrgninemnjsrsqsevenfftmlqkch7\n", | |
| "pvqnltjs2hghkrphnine3scngkjfcsn\n", | |
| "62vdnbzrcrjsndqqr2\n", | |
| "5cxhscqpgdzbrnnq1m9b\n", | |
| "gnkclhmbjfourfivemmxpqx2qlxvsix\n", | |
| "sevenxcp4fourdlqgpxcl\n", | |
| "8eighttwoone\n", | |
| "bjslbfrspcnffnine9rvnjjrvcsix2\n", | |
| "six7tfive6hkllf56six\n", | |
| "km3\n", | |
| "sixtjt2threefour2vqqcxj84\n", | |
| "9vflltwo4five\n", | |
| "nineprprrcjt3eightmxfour\n", | |
| "4twoninehvsbszqr\n", | |
| "dtdmkcsd41eightfourxppqzkjb\n", | |
| "xmdmghzdp9sevennine94\n", | |
| "2bbjsdlxoneeight\n", | |
| "ninefivetwonine8\n", | |
| "68four\n", | |
| "ninepdjpfmzxthree3dkxgttvncbr\n", | |
| "52threesevenninefour6lfrlrsgzk\n", | |
| "ghkczjt86bdk3czvhcone\n", | |
| "cdjsd6jhnnnhzbzllqdjgpgnninevmcvbcxxltsix\n", | |
| "1mxfsrninegfmgvnine14hbfnshgbprone\n", | |
| "39four8\n", | |
| "bxnnjqkninetwotwo58txgvrbxvq\n", | |
| "k4bftq68seven4nineseven\n", | |
| "seven97fivekxjnseven4fourfour\n", | |
| "drgttpqpsevenvrkxdlmvtctsc72seven\n", | |
| "eight298\n", | |
| "2zsqmjskp\n", | |
| "six5bgdkhzqt\n", | |
| "fournlknxg35vqdqmnln6f\n", | |
| "565rqtzdpqhlldxgnine7oneeight\n", | |
| "3jfthree7vlkpfour1\n", | |
| "fourgngnqtgd675vgrrjf\n", | |
| "25nrfive\n", | |
| "kmlbnrm5dtvqndldh\n", | |
| "vgbzkpnltxrp5tpvb\n", | |
| "5mbzzk3nine7cqkngz1mm\n", | |
| "sevenfive952\n", | |
| "4pxk8four\n", | |
| "seven87fourlzlnineone\n", | |
| "zxllsctgqmsevensix72\n", | |
| "9ggkqvsrhftwobndlt\n", | |
| "8sixsfzlfpztjtwofourqvnptkgllxcf\n", | |
| "5dvsjvtm\n", | |
| "29dsvjrl3pvgjqncbgcxc\n", | |
| "9mhvrb8fbtppbhm2s\n", | |
| "eightninel5\n", | |
| "jltnzpcdr8one5szgf3nine88\n", | |
| "8xzgs4chdkfour\n", | |
| "three7vgnbtqvhthree8sixq\n", | |
| "2onesix354jj58\n", | |
| "175rpdmxfeightwos\n", | |
| "gmngst7hpfvgmtfrqbb\n", | |
| "9hd2lsxprdvtqxcv55\n", | |
| "four13cjqkvgxvbseven8\n", | |
| "1kqfrqsevenqgjttjrspd\n", | |
| "7seveneight6zfmdbzdj2\n", | |
| "9sixpfjbnthreedgbhblmr\n", | |
| "7hdqqqkone6htzthree\n", | |
| "hmnxstkbzlhqjpdn3three2\n", | |
| "dpbjgmnn1\n", | |
| "ninefivecznsbttpcvkthreeoneeight1zqtxb\n", | |
| "6hlxdlpgrl7six\n", | |
| "fourdhczrzd9mmmdthcngsmdqkq9fivetwofkb\n", | |
| "7fbcrzcxjvxtqbfive168\n", | |
| "sevenhlrkxgrggkqgd12\n", | |
| "vzmpvhqvkpdfmthreetwo9\n", | |
| "21cqxtjtwoljsixxbf3\n", | |
| "bzzxkxtl3rhsrpnnzseven\n", | |
| "threevhdqqvtwothreenine48frqsfhgsgptbbn\n", | |
| "foureighteight3pgbcftjdbbsmcqjcrmt21\n", | |
| "twovpfbsd42five\n", | |
| "6foureightwofh\n", | |
| "5185cbhgvkvpfzk1\n", | |
| "1one3two5\n", | |
| "seven3mdjks6kctnnchjgpnineeight\n", | |
| "sixfivecjfkx5\n", | |
| "sccbfqfive28bhconexmztpcftrbz\n", | |
| "qfzhgl1nine5four59nbxhclpk\n", | |
| "mjrvgdz3nine6gkvznv83\n", | |
| "mfxqslvpzeight2\n", | |
| "ztwoneeightknnjh4nine\n", | |
| "onefivesevenfsmmhkbcplj6seven\n", | |
| "2lfgzblvdflgxnsqfxtksbb\n", | |
| "blmvzczjs61fourmtds\n", | |
| "5two2\n", | |
| "jqppjfxfour2\n", | |
| "3five2bcrn653\n", | |
| "86five6bseven\n", | |
| "rzztlcbvteight135\n", | |
| "1sjngcngjrsht3ninehninefive\n", | |
| "81sixkrhvrhxqhn65\n", | |
| "dkrgmnlcbjdjxblbfnp5\n", | |
| "three85xrckdqtjqphjsjqflmt\n", | |
| "5fmptvmz19fourmbzrttnxnk\n", | |
| "dptwonefbqhrxtljddtkhh6four23\n", | |
| "xfvgkfive69\n", | |
| "cbtfrbpxphj2sevenmmzrpccnine\n", | |
| "5twotwoseven\n", | |
| "fivetwoeightonefive954\n", | |
| "zxccrkvgdqtklbnhtdtdsghcseventwo6\n", | |
| "three6vqmtchfdjxveightone\n", | |
| "onenine39twodksvrdsxflthree\n", | |
| "threesbpseven5zqtwobtmpgqjg1\n", | |
| "326dgjmzzfivehkhsjrseven\n", | |
| "dgthreeeightthreefbhbltbdjnineseven3klvx\n", | |
| "4xkcqeighttwo2\n", | |
| "eightonerhlnchp17\n", | |
| "2jcmzbczstsrmbpzxpftkmznzckhv7three\n", | |
| "7foursixbrcc6twosixgnf\n", | |
| "4lqxfourtvxhqtlhlx7xcfxhmqzbone\n", | |
| "2sevenz6sixtwo\n", | |
| "nine1pv\n", | |
| "95jzlkxn\n", | |
| "onerzfnqhmtjpqff93lrctjgqhseveneight\n", | |
| "5eightrdjnine3\n", | |
| "threetwo6fourrcrq9dfmbsznshkfqmpvcb\n", | |
| "five3hpjznhbtjonecvfgfsk9n9\n", | |
| "2gkbqpqn31\n", | |
| "sevenfivefgcvtpsxjprfh8nine\n", | |
| "lvfxml6992\n", | |
| "5threexmjjgkv8985zzjqdbtwo\n", | |
| "eight3bkqdnbmrtb5\n", | |
| "7sevenoneznpx\n", | |
| "9hjg4eightrcsvdkbmldjclfqfm\n", | |
| "9four2one4\n", | |
| "koneightonecdfcrjkqtcsevennlvr8hbrc\n", | |
| "seven3lthbv8\n", | |
| "ninexzznsix5nine\n", | |
| "ninentdd6qvkclninefivenine\n", | |
| "four11pgmxz7pnjfiveeight\n", | |
| "threeninefourpmtmlgllftnvxzn5twonine\n", | |
| "four46eight9sevenfive3three\n", | |
| "blztvfkqggcbshlzxppxgrxsr4three3\n", | |
| "one9pvlnv\n", | |
| "8l37\n", | |
| "brjvlvjrhbfourxshh1vlclvrz2\n", | |
| "5flqnkntnxkzhcftmzb9rlfzxlg\n", | |
| "sixfourseven77onekone\n", | |
| "6xfmdgjfeight4qzrncxdpmb4four\n", | |
| "four28\n", | |
| "seven74zrtpftdldc7fqlseven5\n", | |
| "6gxjzskpkfvmmd\n", | |
| "zkoneight99jrrmgsfpsixfiveone\n", | |
| "9jbbdtdxjsm8szxblgjppx4tpnvqvtlrj\n", | |
| "rsrlrcb32ngsixfourfivenine\n", | |
| "6seven9one7threegrfqpncjthree\n", | |
| "onebjvpzzqhvlhg1pxkvmgqvxsrglb8fourptbjs\n", | |
| "1fch\n", | |
| "njhs4p86n22\n", | |
| "two1one6four1six\n", | |
| "fourphxjkjtwo8eight\n", | |
| "3svqrzd1fourcmlcknhvninetddpbcmbtgqpcjms\n", | |
| "vkndzm684sixjlgkcvz4\n", | |
| "25five\n", | |
| "pkzt2fivetwo2zffkjqrhgfive4jpsj\n", | |
| "sevenmpfcthreembjgbfpkdzqlr4\n", | |
| "49four1mpldzb3\n", | |
| "hdzddkxf1cxftflb73\n", | |
| "zrmhdlhk2v7\n", | |
| "25zcd\n", | |
| "11eighteight5qcqzpvvk\n", | |
| "38nine43\n", | |
| "8lstwo\n", | |
| "12sixnfbrgbhdpn1three3\n", | |
| "8eightcd82rzkzlvthqnvhjvgfour\n", | |
| "24jcbjplcnqbcrxs25\n", | |
| "3fivebfkgpkglfchbmbfps\n", | |
| "pgmvbnhskgzdmz2sixeightcjq5\n", | |
| "cdpmrlj1one\n", | |
| "6hxqoneightjjv\n", | |
| "34gxbjzrtg5\n", | |
| "pvddskbslqnrfngmcjgsdthree3\n", | |
| "6nkjjlknp9\n", | |
| "hflkjhgjmeightc5n1\n", | |
| "dmkeight1223\n", | |
| "five9three8\n", | |
| "eight7mqfsjplfprrfpkzctgtdvrmxphm\n", | |
| "phbs2fck4sixfourqvqbr\n", | |
| "2bnvktn\n", | |
| "sfvkgzone83\n", | |
| "2threetqnthdnq32ninetwo9\n", | |
| "sixhdkvdcmp5three23j\n", | |
| "8615four\n", | |
| "twosix54vrrbvzszk9\n", | |
| "53671\n", | |
| "threevklcphgkjsnine4eight4fmtffknglthree\n", | |
| "sixninethreeh4dj\n", | |
| "oneone1pmdthreesrfsssbkt8\n", | |
| "7foureighteight3\n", | |
| "srpvkzrqfive378\n", | |
| "6twodnnrvfjrjv\n", | |
| "4kpxlslqfbktwo\n", | |
| "bvzpgrc9twotqsvdztwoseven8\n", | |
| "xkjdltjgzbjhxkjvtwo6\n", | |
| "five27sixsevensixtwo9nine\n", | |
| "jk468qgkr\n", | |
| "fourtwo89\n", | |
| "fourthreethreedtnzbmlfhmgjr5nineseven7\n", | |
| "44seven\n", | |
| "two3psfive122jps\n", | |
| "sevensevenghzmpdvrffive9nine3eight\n", | |
| "497ftdf9five\n", | |
| "gklfive6rnvpnvvkqheight\n", | |
| "2hvdfiveprrdqspsix6\n", | |
| "5m8nine\n", | |
| "bnctbninexsixonesix8five8\n", | |
| "xkqqlmfmrveightsix4nine93nine\n", | |
| "6k\n", | |
| "3foursevensix6cksix5six\n", | |
| "7twoone\n", | |
| "three73lfddzhd1fkxmjdzsix7twonex\n", | |
| "sthjlrjrhd741prcsqh3rmllvjmtvgfour\n", | |
| "4dvffpjkn\n", | |
| "tpbttcslvz7twoneq\n", | |
| "fourtwoninej5snfxnqzthree\n", | |
| "n7cmsfsqd\n", | |
| "eightssrzkxj5\n", | |
| "239\n", | |
| "three8five7xxthreebqrbx\n", | |
| "zrlchvsevenfournine4ktvskhjgh3h\n", | |
| "7fourfdjsnhdbgqjvnltzj6three\n", | |
| "mrjsndmzkz7rszqnbhxt3fvsix1\n", | |
| "neight85eightggtnxtgljsevenfivekz\n", | |
| "6vknslh4onetwonrlzm\n", | |
| "37zlrksix1skbsdkpjf6twonejtx\n", | |
| "three2843five6\n", | |
| "txgdvvdg959\n", | |
| "zfjrs2zvtbqctcdqgrpfmqsjbdone5\n", | |
| "six9eightninetwo72sxxnzvblthree\n", | |
| "2jdpslvbnpqjpglczkmzggkfkdkx8hgpxtcz\n", | |
| "threefive5eight5mnbllfpcsp29vlnbrntt\n", | |
| "gfxndggbs16twozpcsckzqcj3sthsgq6\n", | |
| "gcjjvqkvzdbcsnmqqhnzzqvj4\n", | |
| "flcpl3btfmbbpnkjvnlmcthreetwo1eightwops\n", | |
| "bdmeight67tvkfh2\n", | |
| "three645qcv1zbbheight\n", | |
| "3ninethvbxxppxgqcqrclptxczgrcneighttwofivebrqxl\n", | |
| "25eight41\n", | |
| "six22\n", | |
| "pcp5\n", | |
| "dtmgxkdqsixdhmsbj821\n", | |
| "eightprbxpj5oneightcxj\n", | |
| "qvrn3jbhlxjsdq\n", | |
| "oneclvhjhr5\n", | |
| "9nkmqpjjxxhvtpndls9\n", | |
| "215ltwo75\n", | |
| "threeeight16nine2mzhxnine\n", | |
| "ktfxkmdvzprhkpdhvxhzsc68\n", | |
| "fivesix8five\n", | |
| "4z1eighttwofive\n", | |
| "73twotwo4\n", | |
| "gmjlpchdzfthreesix1vljxdqsrlxmmqs2\n", | |
| "twofxh3\n", | |
| "threeqzcglsdcfm4four\n", | |
| "three1eight8\n", | |
| "seven7dtqhr7\n", | |
| "4xbjlxlptj8hzfjnz\n", | |
| "37jzgxbjcggone\n", | |
| "81fouronenine489four\n", | |
| "eight3fiveoneseven135\n", | |
| "stzts59zqdvrdcqrc\n", | |
| "sixnklrjbeightn2six\n", | |
| "bqdtntwonine1eightttzlzvzfn54xmj\n", | |
| "sjk6\n", | |
| "qmrbnhczj624394sevenseven\n", | |
| "kkjdcjhfh93eight\n", | |
| "3ptmslnconethree\n", | |
| "cfjgdffcgvldsnvkbjqrxhxcl7fjlxdrlrrthreeseventwo\n", | |
| "187oneseven6\n", | |
| "fiveprnppdg2tjfbfmlvhpmkggjc\n", | |
| "9onetwo4\n", | |
| "fivesvjxkzzm59vtsevenhzxtkggdhr8hvjtjvv\n", | |
| "kpxkbbxseveneight89sevenrbhqqpk\n", | |
| "drhkpssxqvvnssq59four4\n", | |
| "oneeight17\n", | |
| "gteightwoone268four\n", | |
| "eight7fourbjnlzfiveczlzppnxck\n", | |
| "jdqpxsevenone2eight\n", | |
| "pvh5six4hddrhfzpxfmtwo\n", | |
| "5six56nineone2\n", | |
| "v96k9115three\n", | |
| "phqhhthree5ksqhfjlbfg\n", | |
| "gpsskbfhhllnxfvjspkjndtlfour5\n", | |
| "three5zqbnsrdthree8\n", | |
| "b4mkfpkltlfdfive4mdqxjnb8tdpnpf3\n", | |
| "qfivejjggrpktxponetrjzceightseven9xhdf\n", | |
| "34cpfxc\n", | |
| "jl9\n", | |
| "84four\n", | |
| "fourthree9three48\n", | |
| "7threevgvtj2five4pbq\n", | |
| "7kjkjc\n", | |
| "seventfsvjbsh5smmdd3frthree\n", | |
| "smgmzqzn5\n", | |
| "gmtd5kvglxsixeight8twothvkprlbc5\n", | |
| "twofour62\n", | |
| "nine5k\n", | |
| "hbxnpb4four4h\n", | |
| "6sixgnmnjv4fourone1\n", | |
| "9eightseventhree\n", | |
| "9jpvccsvhqpnhsl8\n", | |
| "nvcnninefour9\n", | |
| "v237ppqbhb\n", | |
| "78six\n", | |
| "four165oneightxcm\n", | |
| "9pjcsfbrghnineqzth4smx\n", | |
| "46fpfptrq1mbqmbnktqeight\n", | |
| "stbxvlcqz5krd1threethreeonefour\n", | |
| "48six5seven\n", | |
| "6bmltlrvrgpcfhjhmfiveqzfxptjtwo4zvsqqxgbrdlzsfmtzdd\n", | |
| "jeightwo47three86twoseven\n", | |
| "njxzmthree8fivevvchvjqdvn3foursix\n", | |
| "83t34\n", | |
| "oneznzqptpxbrtqxstkmz3kmtstds\n", | |
| "1sixsfrnqd\n", | |
| "brs7fgkbhntv5s5\n", | |
| "twohs7m\n", | |
| "gfljsixseventmgdvhqthree3threefive\n", | |
| "f1twonekdh\n", | |
| "oneone735eightnine\n", | |
| "pfjvfspsseven9qgfrnmckxzsix94\n", | |
| "7nineninelrcqqcgcnmmqf3\n", | |
| "1vjdhjtrfourfive2nine278\n", | |
| "oneone7\n", | |
| "threelcxlqrzhdghp4zkjfivepjj\n", | |
| "hcshggsmzpdmkvtdvdgqtfxlt8\n", | |
| "1vdjtvpfhkhfive1\n", | |
| "2eightstnj6three\n", | |
| "93threeeightntjblpljbv\n", | |
| "onermlmtncmj6pxkmhmqchzvzf\n", | |
| "4eightfnjzfzhvg\n", | |
| "hmjvmtwovnl8nine84\n", | |
| "threets6\n", | |
| "six9twofivexgz63\n", | |
| "692five\n", | |
| "fkgblptntvhvmlv8threethreenine\n", | |
| "seven86\n", | |
| "nine1n7\n", | |
| "97two\n", | |
| "4threebqqnmvmqleightthreefiveszppmbhxrxvpxz\n", | |
| "6bxbmbdkxqmzeightlrqdqvrkr5threethree\n", | |
| "llqcbpeight1vpjninekpdvzg\n", | |
| "6qgtdqvtvkcbcskfqtq\n", | |
| "6threegrrmxxxqkflltr3\n", | |
| "312\n", | |
| "hqmhsxpmkxtwosix3\n", | |
| "rpzqtmzgdfdxcgsix1six63lxjpbxfq8\n", | |
| "zzkbtkghmmqfourrtsixxxfjnvvccmpsd5six\n", | |
| "13two4bxdcqzrkqtxm1mplvqxcfhcjsc\n", | |
| "threesixqj8two\n", | |
| "9seventhree\n", | |
| "dtnine5twoseven6zxd\n", | |
| "lsqbvgjnznineone7lxtvmkmflrfcqdjmjtwo\n", | |
| "zpkjlfp6onevxtdtdzmcqjprfive\n", | |
| "gxplqqsz412sevenninejs1\n", | |
| "psvjsvvnrv796\n", | |
| "69tfxkbkchvlhkjbrmone\n", | |
| "fivehnrvtb6\n", | |
| "eightzdlqrbzxteightptlgmcmvtwothreergcddqxf2twonepxh\n", | |
| "343sevenxsffneightdvft\n", | |
| "fivednmrpmvv8fiveninesevenzbggk\n", | |
| "seventwot3hpfrzbhxlhfivetwo7zvmpmq\n", | |
| "xnsxz8fivezhzdcbzsvp\n", | |
| "sfzch8twoned\n", | |
| "5rstpx\n", | |
| "12six\n", | |
| "gqznine5gpg\n", | |
| "6zrmsp825seven\n", | |
| "2493twothree\n", | |
| "9fivemksdnmgbvx\n", | |
| "6dvdpdpkmqpxvfive28six\n", | |
| "dzvnrdksixonetwoonetr4\n", | |
| "7fncndxbqj6onetwosixsixthree\n", | |
| "7cnprcdgk2three2dvtccqnskvzfsevenxdrnqf\n", | |
| "cxfcdvbsjqjbnxddlggjfourtnfzvtgx4twoddkkpdd\n", | |
| "pxjgqrmdg5mpcgcdmfeight825jxxqcnfive\n", | |
| "1tkhgtzzfrbdvnbft\n", | |
| "hgxfive14ddcfhshfd4\n", | |
| "onenzlhvtdgkjmjgldmddhngdv9onebkt\n", | |
| "foureight8rzxkktk9eighteight1\n", | |
| "478nshqhnhjrmlqbmp\n", | |
| "ddjzzxgj75zktccgqrltfivethree\n", | |
| "eightmcnmt5jnmnqhqdfive\n", | |
| "rcdxshk1seven5\n", | |
| "rdcmbznk79\n", | |
| "2gtbskjxpmmvdclgmfjrc48one\n", | |
| "8mqgnfive7chknsixrfourseven\n", | |
| "4hgdxjgbn1sixseven7twosixseven\n", | |
| "mkjslkltjd59\n", | |
| "fourfoursixfkjrcfsfivenrtzv4eight\n", | |
| "five8threeseven4\n", | |
| "81821tcmfourddhmzvzfive\n", | |
| "onesix943fivejld\n", | |
| "5eighteight3cmvvpqmdq72vrvb\n", | |
| "two86\n", | |
| "nqjrpqvgqr7rjjjxglqzrmt\n", | |
| "5kqjjvzxt\n", | |
| "6fourvstjrlnvone3ndphzphkrnsqmkmsthreep\n", | |
| "six8four7\n", | |
| "two1dntwo\n", | |
| "eightgmcgrnptrcvztbdp4three\n", | |
| "xxbpnnztr5eightpnqeight\n", | |
| "three9pfpnjx6rkphpjeight3five\n", | |
| "sevendzstsjl3krspscb1\n", | |
| "fsevenfqtxxhjzvnineninesixeight8\n", | |
| "kznjhnxbnk7qbxjrztltv\n", | |
| "rkeightwo6zfpvrfgqr7qxbkkg43lrjqtzjrprqttxmbrzg\n", | |
| "mcfive77vgzxonehglbj\n", | |
| "9319\n", | |
| "4mzds\n", | |
| "sevensixthree5sixdvzxkndhvjfive\n", | |
| "9mjhfkeight88v\n", | |
| "seven5zhdthbmrkdpdxfcp8njtqvpnjj14\n", | |
| "8ninetwo\n", | |
| "95tnjldjqcrzdxlm3\n", | |
| "fourgffour8\n", | |
| "nine821qbv6five\n", | |
| "jbtfg83two\n", | |
| "twozcpjrcnplnz5bdtgpdctb87lzlvqhtrjj\n", | |
| "tr4\n", | |
| "5foureightfourfcs\n", | |
| "1cqjts1jgzkfm\n", | |
| "66threetwo\n", | |
| "jsdpkfnineeightzpjdmrvxkbhdntj9\n", | |
| "pgcqrsix6mqrr8threeqxgkftbmzninevndn\n", | |
| "kmvqsqhbrcnbqqgninet6\n", | |
| "bxtstqzpqfzqnhjfb8htszvgqhpnggvqt\n", | |
| "ninecpqpffivehg8\n", | |
| "kxmstxkffourqmx41\n", | |
| "scfourlkfbrjvbtwo5\n", | |
| "qr88fivenine1lfvksgrtqseven\n", | |
| "four6foursix\n", | |
| "twoqmnxrjql5fourpdlstnnsfkdjgt9\n", | |
| "4zsvbsjqv97bpxvncr\n", | |
| "xhqlhsbqjhvdqqonesevenfive3qvrtbkhhlfbzsj9\n", | |
| "sixeight4six5szgzcjhpj1\n", | |
| "7vpjq9hjtrjgone\n", | |
| "f92eight\n", | |
| "eighteightnc8134\n", | |
| "22onespjpxlttsqsix8eighthxdfvsdx\n", | |
| "5ninefourgrrmxsxjfxk\n", | |
| "threeninepmvsv763xlxjp\n", | |
| "oneone7lzzhjqqrg\n", | |
| "9fourtqqmhrpmkxhrvlnjvvhsevenseven\n", | |
| "threethreetvjpnoneseven8\n", | |
| "two46onetwoqbvntlxbrftpjf9\n", | |
| "8one5nine1three8\n", | |
| "three69sgdkstpqbqdz\n", | |
| "q8rzcl\n", | |
| "onepjmchxtlqnmrcrvm6\n", | |
| "61fivegjjsevenqgdkq\n", | |
| "49fxhdzfntmk6tb8dpdkknzsb\n", | |
| "bbseven1xvqmlrhx\n", | |
| "2j\n", | |
| "seventwozjqszlhzxlpgphnkz2foursixfour\n", | |
| "1sixhgvhrbonetwom\n", | |
| "fournine8gvmrpgdxvcbdspzdcqt87bdzvxbf5\n", | |
| "3sevennine2fzpt\n", | |
| "threedcdlq9kcjhtmtz\n", | |
| "86five\n", | |
| "tpfqhqs3977\n", | |
| "8four1cgmm12shfl58\n", | |
| "xlkrrkpkqjtslblqfnxp7two16jzpmpkrfvdzh\n", | |
| "243\n", | |
| "three9hkgnmrh6lqrsx5\n", | |
| "fivexsczpmltrmcgrvfc58\n", | |
| "mxngrsh2sevensixthreelgrmg\n", | |
| "ljqmflvone76\n", | |
| "ksponeightthree2ninenine\n", | |
| "tdsdmjznr5nine7fourtwojgjsdfsevenone\n", | |
| "eightfive1fourseven3gsqhtv\n", | |
| "1xfdmqtmgkmjkthree\n", | |
| "rztwonelztpgkxzzcbn1eightttssdpone71\n", | |
| "zthhsgvmhqsgvdponetwo9p\n", | |
| "293rmjjjpmjchjnbdcssfrneightvdzrkbhdln\n", | |
| "7nfkdntfourthreefzrfxmxgqone5\n", | |
| "tkgrnhbflp7zltmbdoneeightwoh\n", | |
| "7bspgfklffgsix4\n", | |
| "eighthcmlrpbhjjmvbjrleightgd94\n", | |
| "sixbgfjzgzbxsb4qsixthreehbbn\n", | |
| "ninerhzjpjdfnsevenonenine8\n", | |
| "38kqzjxqmmm\n", | |
| "jngngvc412\n", | |
| "4twosponesixdpj15five\n", | |
| "41four2oneonekr2\n", | |
| "cpsixjnlhkthree353seven\n", | |
| "bknflgv1sixfivefive5\n", | |
| "3qkhnsjqkcjmlg7gl4jthreethree\n", | |
| "dhlngstrvbxjjll2979kjsttsfgjkc\n", | |
| "4kkq7rqlxcldqqtwo\n", | |
| "jfh74\n", | |
| "lkfpcdghgq8gpgldrsnzkzzzzskrvcvsjthree\n", | |
| "57fivefive3cxqj2\n", | |
| "ztwone7vcd37122\n", | |
| "4qrrhhlxgpr4\n", | |
| "twokzfjg2sevenlnvlpzxknznpsc1\n", | |
| "4jjbcdbfm8six6four\n", | |
| "5eightninesixvzvf98two\n", | |
| "8flntwomkktkpvsone78sixone\n", | |
| "sevenzltjhkptjfjbrppm85eight\n", | |
| "fivemfrmnqptthreepninepd5\n", | |
| "6one9\n", | |
| "vkqxgzmbm2b4pjqjddsbjnjcqqvm9\n", | |
| "5443nfkv\n", | |
| "leightwo5\n", | |
| "8fiveeightonetwovgvhzgzfjh16eightwohlk\n", | |
| "fivexnbhkzjfg1\n", | |
| "chkxvgrgb1sqxsnhngnrtqsnqgjkd\n", | |
| "96twoone5553dv\n", | |
| "36pfltskrbcmlmnspn\n", | |
| "4jbbrh95249\n", | |
| "xfzspqssdfourhnmtzfive2pfzczh\n", | |
| "onexzbzhddkqgfr2\n", | |
| "sevenninerrlveight5nine3\n", | |
| "eight7qvgkbk238fiveeight\n", | |
| "sevenseveneightgtxtxkjsgdgklzzxxc3two8\n", | |
| "tvfjhvtclm75skqdxsskqhrjkbg\n", | |
| "45\n", | |
| "sevenfive82\n", | |
| "425zkhjhmk\n", | |
| "onexdchhtxmhsevenbczrslrppneightonenbnhfmbsvdcnzjx1\n", | |
| "zfkscdbmtwoeightrksdmgx4\n", | |
| "lnseightnine9eight\n", | |
| "fourhmbhlcpht53ngkbzjmfivesixg\n", | |
| "threestrhbj9sixggczcg\n", | |
| "9twoskgrps8\n", | |
| "3four6xdqczgtzlzf\n", | |
| "ldfn2\n", | |
| "qlzjsnbzfourfdq476\n", | |
| "tpkczdh5hdbxvvmmt3sixsix\n", | |
| "tdpxzld5\n", | |
| "lnveightwohdkgcvvrjs38\n", | |
| "zz8eightstvmhvrh7hftdhkrjcneight1\n", | |
| "9kdbcpqtx15\n", | |
| "rbqgdbvrstgninefive4bqq2six\n", | |
| "nine3psmkzkgnjbndrcninesevenzvcr6\n", | |
| "eight4jfrqcbqfninedxmdtjgqgtrg6four5\n", | |
| "3mmnineninenjjpmfivetwo\n", | |
| "cv4znxcjthreeqqtdqmzxfknnp\n", | |
| "8pjkm\n", | |
| "ptwonethreegrgvseven7\n", | |
| "onethree1bgjsix5sevengpts\n", | |
| "96xlmmthreeeightcbdnrstvpncmr\n", | |
| "rtc94tcninefive\n", | |
| "onespqnnptpdbrgqsqrldstl1\n", | |
| "qkeightwotwocjcngknkztwo7\n", | |
| "gzjhzlf4fdglcrzckbrlkmg\n", | |
| "3eighttwopninefour\n", | |
| "2seven1c\n", | |
| "17nine447qkmfour2\n", | |
| "six6xfgqddnfpsc\n", | |
| "mkbgbkvzdpzxfmrhdcjklxfoureightzzpn3eight\n", | |
| "95ninevhctbgznbzz871sixoneightr\n", | |
| "31onekmseveneight2four\n", | |
| "mlxqgmvj2six6\n", | |
| "2sixgvsbmrhtwofour\n", | |
| "eight221three99two3\n", | |
| "88xrrbjdlzrfour8plv\n", | |
| "xdglmrpxbz5xpjxzpmvrgsixthreeseven7threebtqfkqp\n", | |
| "lbd2onethree\n", | |
| "seventwoseven7threesixbpld\n", | |
| "1pstwofour8eight3dsdfrseven\n", | |
| "gnvzm19htsbvcsfmlrmbgtstzmm3twoqzffkrrq\n", | |
| "94nvrbbj\n", | |
| "one71rsfbpnnbkrklmxqfive\n", | |
| "4six1\n", | |
| "eight48chsrmsix\n", | |
| "vqxrnmsix98hlzdgvd3sevenninekng\n", | |
| "12threehscqzvzcbgfive6three2zhtthr\n", | |
| "6sixkzrnv\n", | |
| "5gmnhhzkfmp\n", | |
| "four35seven7onenvdsevenftnpbcj\n", | |
| "6zxrhcxxkppkn2\n", | |
| "dgshxchmhgtgjk281seven\n", | |
| "lbdsmfvdsfzlp6dfpgd3\n", | |
| "three2dpsdhfld95eightwoht\n", | |
| "jbktdklsqkgnhnfmseven1lhdsbjksixtwo\n", | |
| "3fdqfour\n", | |
| "5jpljkkpmdsix\n", | |
| "qfeightwo9threethree\n", | |
| "hpqdx4911tzfcxlrtccqf9one\n", | |
| "q79zspgmjpdzs63\n", | |
| "344zk5xbthreezgbffcb\n", | |
| "nlzmjfqxmneightxqjdnjvr21\n", | |
| "8cxtrkpvzj21xfgbdgcvgrztwo\n", | |
| "three18444\n", | |
| "sntrptktwo2one1five\n", | |
| "qxjrgfcnpcjtnfjljqnq1onehzfcqlnine\n", | |
| "kflgzv58dbzbjjdvclgtseven\n", | |
| "twofive4eightwozz\n", | |
| "eightfive365\n", | |
| "7nqnksvphhnine88\n", | |
| "t8eight\n", | |
| "bjd6five\n", | |
| "khbrbtsx5jqxmbsqtf5nine3sevenskhfg6\n", | |
| "seventlkmfhqkgxkbhqr6ncjztnfive\n", | |
| "152one\n", | |
| "three5cbpqkzb4eightseventgmqzflsfksix\n", | |
| "seven32threegfddgtf\n", | |
| "two5twofivexzkkvcqs3\n", | |
| "tvvdgrnqlmkfour1zrcznqkhseveneight1q\n", | |
| "92threesix89\n", | |
| "3zbdlttpbh7fivepgxmrvbzlnfgmbkzknndfqk5\n", | |
| "threefnhxtdbl1jtxeightwol\n", | |
| "5vgthldgfmgdjphvcgh53dshmdkc\n", | |
| "3nineeightwokh\n", | |
| "57eighttddbcdsjdss\n", | |
| "tkcgn86xfgbmzt7rksvnchnrh\n", | |
| "five3dn5\n", | |
| "three2eighteight15nine\n", | |
| "49bn1zvbm57\n", | |
| "351six6xfzfjvpz\n", | |
| "5one5zchddj4dkksn\n", | |
| "xfhtwonesevenfivethreepqzmrzrrfourthree5\n", | |
| "ninetzmcgp47four\n", | |
| "sevenbcfbpnrvkkscrjtpctdtb69bvvnvlgsmjltlvs\n", | |
| "6threev\n", | |
| "ninerlsbznvfn9\n", | |
| "fourbm2\n", | |
| "sdxd22\n", | |
| "n7\n", | |
| "7sixcjdsxfourfmvzrbvlnine5\n", | |
| "threeqtbhgznine7one\n", | |
| "ftmkmxkd9fvvlg353rp51\n", | |
| "9zjhmpnjv5jvndz\n", | |
| "58three59nineonesix\n", | |
| "rmjvhrjjmkqsn6gqthreeonefivemxqhrzvffone\n", | |
| "xsslv7gpgkbzdmr434four\n", | |
| "pnzxp4nbtsjqctkvqncxzxzj\n", | |
| "eightseven52five4ninekntfjrdt\n", | |
| "4sixldsmv\n", | |
| "pknxkqgdpnc7fivedbvhkn\n", | |
| "qkpjhjlxone4sixpfkvhlmxmd3\n", | |
| "four3ninerkrcvgcmbb2qm\n", | |
| "fivenine6six1eight\n", | |
| "69sixnine\n", | |
| "bvjx5lg5vgrqq\n", | |
| "21ninegnhdkcxhzkcfdksvsmdthree\n", | |
| "zjrnmhclxhrkjpffhxkthnvj83jnshbqvx\n", | |
| "bzfphcg9fourthreegkchdvrgsx\n", | |
| "2ninebvgdcfxtktqjxjqvxfgjdqfhv5threegqtsfhtfxg\n", | |
| "6rqskvckjzq2qzrnbxjmlthreeeight6hrs\n", | |
| "sixthree6lxcrsevenseven69twonegs\n", | |
| "2dcvcqcbpshsixone3\n", | |
| "drkdbmv4zbjbznsqtj\n", | |
| "eightbqfhnmvqsoneninezbrzcqkz4ftv\n", | |
| "1eightcrcjcbdthreebscfpvznqfrj6\"\"\"" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "print(input[:100])" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "zj1uuD5IYsOb", | |
| "outputId": "590d32c7-761b-4ed4-99c6-65368b981d54" | |
| }, | |
| "execution_count": 2, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "eightqrssm9httwogqshfxninepnfrppfzhsc\n", | |
| "one111jxlmc7tvklrmhdpsix\n", | |
| "bptwone4sixzzppg\n", | |
| "ninezfzseveneight5kj\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Input Formatting" | |
| ], | |
| "metadata": { | |
| "id": "66omP9mqY42O" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "import re" | |
| ], | |
| "metadata": { | |
| "id": "znc-2HB50EVq" | |
| }, | |
| "execution_count": 3, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "def cleaner(txt) :\n", | |
| " # Remove all but exclude number and newlines\n", | |
| " cln_txt = re.sub(r\"[^\\n0-9]\", \"\", txt)\n", | |
| "\n", | |
| " return cln_txt" | |
| ], | |
| "metadata": { | |
| "id": "n1Zu6UON1N9M" | |
| }, | |
| "execution_count": 4, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "cleaned_in = cleaner(input)\n", | |
| "\n", | |
| "print(cleaned_in[:100])" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "hqzAEQpPa01K", | |
| "outputId": "0b8413e3-b9e3-4238-8d84-4f175aceee20" | |
| }, | |
| "execution_count": 5, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "9\n", | |
| "1117\n", | |
| "4\n", | |
| "55\n", | |
| "58\n", | |
| "532\n", | |
| "1\n", | |
| "7778\n", | |
| "132\n", | |
| "1\n", | |
| "5944\n", | |
| "5\n", | |
| "77\n", | |
| "7697\n", | |
| "22\n", | |
| "7\n", | |
| "116\n", | |
| "4462\n", | |
| "653\n", | |
| "237\n", | |
| "2293\n", | |
| "39\n", | |
| "74\n", | |
| "83\n", | |
| "418\n", | |
| "5384\n", | |
| "11412\n", | |
| "11\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Split into separate lines\n", | |
| "document_lines = cleaned_in.split(\"\\n\")\n", | |
| "\n", | |
| "print(document_lines[0])" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "tVGGGwmma6LG", | |
| "outputId": "bedb0651-acee-4791-e6a9-4551dc332889" | |
| }, | |
| "execution_count": 6, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "9\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Digit Joiner" | |
| ], | |
| "metadata": { | |
| "id": "E7qFAM51cMw5" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "def digit_joiner(line):\n", | |
| " return f\"{line[0]}{line[-1]}\"" | |
| ], | |
| "metadata": { | |
| "id": "c0x96MUdcIAU" | |
| }, | |
| "execution_count": 7, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "### Test" | |
| ], | |
| "metadata": { | |
| "id": "oM7ARIeGclv3" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "test = \"1111111119\"\n", | |
| "digit_joiner(test)" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 35 | |
| }, | |
| "id": "ELLDAYK7cjoa", | |
| "outputId": "14038332-4a26-464e-f0c8-6e88621aa138" | |
| }, | |
| "execution_count": 8, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| "'19'" | |
| ], | |
| "application/vnd.google.colaboratory.intrinsic+json": { | |
| "type": "string" | |
| } | |
| }, | |
| "metadata": {}, | |
| "execution_count": 8 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "test = \"7\"\n", | |
| "digit_joiner(test)" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/", | |
| "height": 35 | |
| }, | |
| "id": "5pekiHnxct7t", | |
| "outputId": "c9f04133-23cb-49c6-b869-31045bcd70ec" | |
| }, | |
| "execution_count": 9, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| "'77'" | |
| ], | |
| "application/vnd.google.colaboratory.intrinsic+json": { | |
| "type": "string" | |
| } | |
| }, | |
| "metadata": {}, | |
| "execution_count": 9 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Document Composer" | |
| ], | |
| "metadata": { | |
| "id": "0CRzApcEc1dh" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "def document_composer(lines):\n", | |
| " doc = []\n", | |
| " for line in lines:\n", | |
| " str_number = digit_joiner(line)\n", | |
| " number = int(str_number)\n", | |
| " doc.append(number)\n", | |
| "\n", | |
| " return doc" | |
| ], | |
| "metadata": { | |
| "id": "y3jESDWzc0r3" | |
| }, | |
| "execution_count": 10, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "### Test" | |
| ], | |
| "metadata": { | |
| "id": "3MIo2JnVdB-S" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "test = [\n", | |
| " \"1112\",\n", | |
| " \"4\",\n", | |
| " \"9001\"\n", | |
| "]\n", | |
| "\n", | |
| "document_composer(test)" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "aL7h_9ZqdC2b", | |
| "outputId": "69922813-d91d-4ada-9b88-57554e80e552" | |
| }, | |
| "execution_count": 11, | |
| "outputs": [ | |
| { | |
| "output_type": "execute_result", | |
| "data": { | |
| "text/plain": [ | |
| "[12, 44, 91]" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "execution_count": 11 | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Document" | |
| ], | |
| "metadata": { | |
| "id": "uXQmQgiBd1Ik" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "document = document_composer(document_lines)\n", | |
| "\n", | |
| "print(document[:10])" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "6aHIUuPvdNZO", | |
| "outputId": "b282a0c0-6dc3-4a2b-dafd-b4f33f0a0979" | |
| }, | |
| "execution_count": 12, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "[99, 17, 44, 55, 58, 52, 11, 78, 12, 11]\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Sum" | |
| ], | |
| "metadata": { | |
| "id": "asAGaNlVeF41" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "answer = sum(document)\n", | |
| "\n", | |
| "print(f\"The sum of all calibration values in the document is {answer}\")" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "nklUbKD6d_5v", | |
| "outputId": "da88f845-8778-458e-c6a1-0807c65e6d51" | |
| }, | |
| "execution_count": 13, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "The sum of all calibration values in the document is 54159\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "# Puzzle - Part 2" | |
| ], | |
| "metadata": { | |
| "id": "vjlx8SICek-k" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "**--- Part Two ---**\n", | |
| "\n", | |
| "Your calculation isn't quite right. It looks like some of the digits are actually spelled out with letters: `one`, `two`, `three`, `four`, `five`, `six`, `seven`, `eight`, and `nine` also count as valid \"digits\".\n", | |
| "\n", | |
| "Equipped with this new information, you now need to find the real first and last digit on each line. For example:\n", | |
| "\n", | |
| "```\n", | |
| "two1nine\n", | |
| "eightwothree\n", | |
| "abcone2threexyz\n", | |
| "xtwone3four\n", | |
| "4nineeightseven2\n", | |
| "zoneight234\n", | |
| "7pqrstsixteen\n", | |
| "```\n", | |
| "\n", | |
| "In this example, the calibration values are `29`, `83`, `13`, `24`, `42`, `14`, and `76`. Adding these together produces `281`.\n", | |
| "\n", | |
| "What is the sum of all of the calibration values?" | |
| ], | |
| "metadata": { | |
| "id": "xpPuwXOWepn8" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Considerations\n", | |
| "\n", | |
| "Replacing string such as `one` and `two` with their corresponding digits does not pose much of a problem, however there is a single extra case that needs to be considered. The **string-digits** may overlap as shown in the example `xtwone3four`, notice that both `two` and `one` share the letter `o`. Becasuse of these casses a naive replacement of string patters will not work.\n", | |
| "\n", | |
| "The combinations cannot be hardcoded because there could be any number of them e.g. more than just two digits `zeroneight`.\n", | |
| "\n", | |
| "\n", | |
| "**Idea**\n", | |
| "\n", | |
| "We can iterate over the whole text letter by letter, then if we match the first letter of any digits we cut out a portion of the text and check for each digit. Then we simply have to iterate over all digits and match it to the **beggining** of the substring. If they are both the same length we can easily check if they are the same." | |
| ], | |
| "metadata": { | |
| "id": "V2udQpQKhxk-" | |
| } | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Modified Formatting" | |
| ], | |
| "metadata": { | |
| "id": "oghjozS4e7iG" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "def modified_cleaner(txt):\n", | |
| " # strings are not mutable and hence we can modify them\n", | |
| " # we'll iterate over a string since it's easier to check if a substring\n", | |
| " # includes a digit but the code will edit this list instead\n", | |
| " # note that they will have the same indexing\n", | |
| " txt_letters = list(txt)\n", | |
| "\n", | |
| " string_digits = {\n", | |
| " \"0\": \"zero\",\n", | |
| " \"1\": \"one\",\n", | |
| " \"2\": \"two\",\n", | |
| " \"3\": \"three\",\n", | |
| " \"4\": \"four\",\n", | |
| " \"5\": \"five\",\n", | |
| " \"6\": \"six\",\n", | |
| " \"7\": \"seven\",\n", | |
| " \"8\": \"eight\",\n", | |
| " \"9\": \"nine\"\n", | |
| " }\n", | |
| "\n", | |
| " first_letters = \"zotfsen\"\n", | |
| " max_lenght = 5 # none of the digits is longer than 5 characters\n", | |
| "\n", | |
| " for idx, letter in enumerate(txt):\n", | |
| "\n", | |
| " if letter in first_letters:\n", | |
| " sub_txt = txt[idx : (idx + max_lenght)]\n", | |
| "\n", | |
| " for digit, string_digit in string_digits.items():\n", | |
| "\n", | |
| " # match sub_txt length to string_digit so we can check for ==\n", | |
| " sub_sub_txt = sub_txt[:len(string_digit)]\n", | |
| " if sub_sub_txt == string_digit:\n", | |
| "\n", | |
| " # we can just replace the first letter with the digit\n", | |
| " txt_letters[idx] = digit\n", | |
| " break\n", | |
| "\n", | |
| "\n", | |
| "\n", | |
| " out_txt = \"\".join(txt_letters)\n", | |
| " out_txt = re.sub(r\"[^\\n0-9]\", \"\", out_txt)\n", | |
| "\n", | |
| " return out_txt" | |
| ], | |
| "metadata": { | |
| "id": "t6sn73v4fF0P" | |
| }, | |
| "execution_count": 14, | |
| "outputs": [] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "cleaned_in = modified_cleaner(input)\n", | |
| "\n", | |
| "print(cleaned_in[:100])" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "outputId": "636d2c66-6f87-4c38-a70e-f946b81be228", | |
| "id": "RzRMUsUvfF0P" | |
| }, | |
| "execution_count": 15, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "8929\n", | |
| "111176\n", | |
| "2146\n", | |
| "9785591\n", | |
| "58\n", | |
| "532\n", | |
| "12\n", | |
| "67276278\n", | |
| "613632\n", | |
| "61\n", | |
| "451944\n", | |
| "25558\n", | |
| "737\n", | |
| "769972\n", | |
| "522\n", | |
| "7782\n", | |
| "116\n", | |
| "44162\n", | |
| "653\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "# Split into separate lines\n", | |
| "document_lines = cleaned_in.split(\"\\n\")\n", | |
| "\n", | |
| "print(document_lines[0])" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "5m0BLt2UftaR", | |
| "outputId": "0c659731-5930-436e-fd8a-67a326b5a976" | |
| }, | |
| "execution_count": 16, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "8929\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Document" | |
| ], | |
| "metadata": { | |
| "id": "cmzcuOs1gC8t" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "document = document_composer(document_lines)\n", | |
| "\n", | |
| "print(document[:10])" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "id": "5V5eVPM_gD78", | |
| "outputId": "5b42a51a-f1f0-40c5-8e08-20c3f69dd443" | |
| }, | |
| "execution_count": 17, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "[89, 16, 26, 91, 58, 52, 12, 68, 62, 61]\n" | |
| ] | |
| } | |
| ] | |
| }, | |
| { | |
| "cell_type": "markdown", | |
| "source": [ | |
| "## Sum" | |
| ], | |
| "metadata": { | |
| "id": "p7VfcoNZgQ4g" | |
| } | |
| }, | |
| { | |
| "cell_type": "code", | |
| "source": [ | |
| "answer = sum(document)\n", | |
| "\n", | |
| "print(f\"The sum of all calibration values in the document is {answer}\")" | |
| ], | |
| "metadata": { | |
| "colab": { | |
| "base_uri": "https://localhost:8080/" | |
| }, | |
| "outputId": "a2c663e1-407c-4f1a-e3ad-e7e35d0885ad", | |
| "id": "_wSDjnpQgQ4h" | |
| }, | |
| "execution_count": 18, | |
| "outputs": [ | |
| { | |
| "output_type": "stream", | |
| "name": "stdout", | |
| "text": [ | |
| "The sum of all calibration values in the document is 53866\n" | |
| ] | |
| } | |
| ] | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment