From 6f9b51146cf24489ea9b0773c7cfa506b413b25f Mon Sep 17 00:00:00 2001 From: Sven Weidauer Date: Wed, 23 Nov 2022 16:46:31 +0100 Subject: [PATCH] Add 2017 solutions --- 2017/Advent1.playground/Contents.o | Bin 0 -> 5512 bytes .../Day 1 - 1.xcplaygroundpage/Contents.swift | 19 + .../Day 1 - 2.xcplaygroundpage/Contents.swift | 16 + .../Day 2 - 1.xcplaygroundpage/Contents.swift | 34 + .../Day 2 - 2.xcplaygroundpage/Contents.swift | 61 + .../Contents.swift | 23 + .../Day 4 - 1.xcplaygroundpage/Contents.swift | 529 +++++++++ .../Day 4 - 2.xcplaygroundpage/Contents.swift | 550 +++++++++ .../Day 5.xcplaygroundpage/Contents.swift | 1033 +++++++++++++++++ 2017/Advent1.playground/contents.xcplayground | 13 + .../contents.xcworkspacedata | 7 + 11 files changed, 2285 insertions(+) create mode 100644 2017/Advent1.playground/Contents.o create mode 100644 2017/Advent1.playground/Pages/Day 1 - 1.xcplaygroundpage/Contents.swift create mode 100644 2017/Advent1.playground/Pages/Day 1 - 2.xcplaygroundpage/Contents.swift create mode 100644 2017/Advent1.playground/Pages/Day 2 - 1.xcplaygroundpage/Contents.swift create mode 100644 2017/Advent1.playground/Pages/Day 2 - 2.xcplaygroundpage/Contents.swift create mode 100644 2017/Advent1.playground/Pages/Day 3 - 1 Spiral.xcplaygroundpage/Contents.swift create mode 100644 2017/Advent1.playground/Pages/Day 4 - 1.xcplaygroundpage/Contents.swift create mode 100644 2017/Advent1.playground/Pages/Day 4 - 2.xcplaygroundpage/Contents.swift create mode 100644 2017/Advent1.playground/Pages/Day 5.xcplaygroundpage/Contents.swift create mode 100644 2017/Advent1.playground/contents.xcplayground create mode 100644 2017/Advent1.playground/playground.xcworkspace/contents.xcworkspacedata diff --git a/2017/Advent1.playground/Contents.o b/2017/Advent1.playground/Contents.o new file mode 100644 index 0000000000000000000000000000000000000000..ff259ad464ddfdb90660ff65a7b81fcbb9897aae GIT binary patch literal 5512 zcmb_gUu+yl8K3pp@i}P|S1FB4!Cny;F0@W!ZW^BMXy&lb z;k?maV5d`dn1v(tVYCK@Byygy^Lg6}*qo1#&W{FEEiSdjYOp5~SSN!$*K-UjD|uo6 zRO!sL?3jap^*&MT^@VeH*;w?3xNdpQ3gxpgUQ>1sY}`KL=kNOcKEhUz3SpMwwcOf- zgyStpLka1`FJO;cF2P<@^6Fu?y+;3TNqa$D+prhTS))A>FVEWxInB)>-emIPlQoT> zNqa$1AHd#zg>yUobcP#wEvp;Wq8*O+*V0}P+hMG`Pzi<-Y_VPnTE^o=YuT_C;NN(? z{+rU?Wy$P`pu-D)-#^5q>qs;R28+( z?zrY4W8hICc?^}}>|1oSyuNHZ&#;EEA*$-t*`e{9>V@p>(%s81!!2lDCP%|n{oZ9K zpEfMrm-j<2Bp)plOd}(bmeQRiBcr>*T-9F4|1UaPA!lUVYJ4Gko$F`e0V~X%Gs<8F)vA{Ok$LrcBYVD0k_qIPiTi;mg z-u@MQFQGD)eu4Z}I<0OttaU4$m%CY))=j)pr02s@gnvlw1Y_s0P9FRm>Wkp{xk&6V zRqLK$Y@TE)D(RCwDa8iFGkpW z`H=*ztygFsX${4&w%$XIYJI+hK8J5?(VU~tXbbuvccPD6cXzR#w&44FSbMQ+QXgxL z^c988Z(^;%r(J6+SYyZ~%H|loN5DG*@EEs?X;W91G_$Cy8O^e6Pfep`TT8m*=?ki7 ztJ4oTtM_U6>gs)YEn~Z< z#nxq5I2$f%8J$gPo@T1LC#9a1F% z1ig+Rk3tZXBGE`V_9Ib#5Tc)xbf=VGB^vd4NoOUkN;)O!f}}q$>06S1Owye|DjLy{ z1^34%r97}VLNq2UxaVMQL912zQIcbV3qUG8L__J8q#q_4$qDWai-`SbRISp-Nsi4n zxCh)%H11??%KkLZJ@79f-;bZ5-2)rJI{%)OPf7VVBt0zY?@0ZZz^C#mD%lI-{UmJl zw3n*>PGK&34wcxma{PBl4*GdXe^bg=CH+%LUzhYlk`D6ms_b8q@;^%X6-iU>$^M3< zzY6_hiV83N@*~jrRm%wU>*;?%qOe3&J`|!yME{!nTOs<5kUrkM27A8|o z_RvWd@{MY>aQEvt!I}R3nHOwq5x7)}-GWcf%#BU(79JB|G^3i+wNj&HnL9!02U%QGQvr^1_skcHmkedMLIW1m8MI-7VSQZfo_+k zmoJQn=dgI57teFzIfO;b@u!Z3zakbmDCnMT;DG|~Oal)Tc!Lc*P~Z(T@IZ~tP7iP( KWc`xD=KddFA$$-3 literal 0 HcmV?d00001 diff --git a/2017/Advent1.playground/Pages/Day 1 - 1.xcplaygroundpage/Contents.swift b/2017/Advent1.playground/Pages/Day 1 - 1.xcplaygroundpage/Contents.swift new file mode 100644 index 0000000..ce798d3 --- /dev/null +++ b/2017/Advent1.playground/Pages/Day 1 - 1.xcplaygroundpage/Contents.swift @@ -0,0 +1,19 @@ + + +let input = "181445682966897848665963472661939865313976877194312684993521259486517527961396717561854825453963181134379574918373213732184697746668399631642622373684425326112585283946462323363991753895647177797691214784149215198715986947573668987188746878678399624533792551651335979847131975965677957755571358934665327487287312467771187981424785514785421781781976477326712674311994735947987383516699897916595433228294198759715959469578766739518475118771755787196238772345762941477359483456641194685333528329581113788599843621326313592354167846466415943566183192946217689936174884493199368681514958669615226362538622898367728662941275658917124167353496334664239539753835439929664552886538885727235662548783529353611441231681613535447417941911479391558481443933134283852879511395429489152435996669232681215627723723565872291296878528334773391626672491878762288953597499218397146685679387438634857358552943964839321464529237533868734473777756775687759355878519113426969197211824325893376812556798483325994128743242544899625215765851923959798197562831313891371735973761384464685316273343541852758525318144681364492173465174512856618292785483181956548813344752352933634979165667651165776587656468598791994573513652324764687515345959621493346623821965554755615219855842969932269414839446887613738174567989512857785566352285988991946436148652839391593178736624957214917527759574235133666461988355855613377789115472297915429318142824465141688559333787512328799783539285826471818279818457674417354335454395644435889386297695625378256613558911695145397779576526397241795181294322797687168326696497256684943829666672341162656479563522892141714998477865114944671225898297338685958644728534192317628618817551492975251364233974374724968483637518876583946828819994321129556511537619253381981544394112184655586964655164192552352534626295996968762388827294873362719636616182786976922445125551927969267591395292198155775434997827738862786341543524544822321112131815475829945625787561369956264826651461575948462782869972654343749617939132353399334744265286151177931594514857563664329299713436914721119746932159456287267887878779218815883191236858656959258484139254446341" + +let array = input.flatMap { Int(String($0)) } + +var sum = 0 + +if var previous = array.last { + for current in array { + if current == previous { + sum += current + } + previous = current + } +} + +sum + diff --git a/2017/Advent1.playground/Pages/Day 1 - 2.xcplaygroundpage/Contents.swift b/2017/Advent1.playground/Pages/Day 1 - 2.xcplaygroundpage/Contents.swift new file mode 100644 index 0000000..871aed1 --- /dev/null +++ b/2017/Advent1.playground/Pages/Day 1 - 2.xcplaygroundpage/Contents.swift @@ -0,0 +1,16 @@ +//: [Previous](@previous) + +let input = "181445682966897848665963472661939865313976877194312684993521259486517527961396717561854825453963181134379574918373213732184697746668399631642622373684425326112585283946462323363991753895647177797691214784149215198715986947573668987188746878678399624533792551651335979847131975965677957755571358934665327487287312467771187981424785514785421781781976477326712674311994735947987383516699897916595433228294198759715959469578766739518475118771755787196238772345762941477359483456641194685333528329581113788599843621326313592354167846466415943566183192946217689936174884493199368681514958669615226362538622898367728662941275658917124167353496334664239539753835439929664552886538885727235662548783529353611441231681613535447417941911479391558481443933134283852879511395429489152435996669232681215627723723565872291296878528334773391626672491878762288953597499218397146685679387438634857358552943964839321464529237533868734473777756775687759355878519113426969197211824325893376812556798483325994128743242544899625215765851923959798197562831313891371735973761384464685316273343541852758525318144681364492173465174512856618292785483181956548813344752352933634979165667651165776587656468598791994573513652324764687515345959621493346623821965554755615219855842969932269414839446887613738174567989512857785566352285988991946436148652839391593178736624957214917527759574235133666461988355855613377789115472297915429318142824465141688559333787512328799783539285826471818279818457674417354335454395644435889386297695625378256613558911695145397779576526397241795181294322797687168326696497256684943829666672341162656479563522892141714998477865114944671225898297338685958644728534192317628618817551492975251364233974374724968483637518876583946828819994321129556511537619253381981544394112184655586964655164192552352534626295996968762388827294873362719636616182786976922445125551927969267591395292198155775434997827738862786341543524544822321112131815475829945625787561369956264826651461575948462782869972654343749617939132353399334744265286151177931594514857563664329299713436914721119746932159456287267887878779218815883191236858656959258484139254446341" + +let array = input.flatMap { Int(String($0)) } + +var sum = 0 +let count = array.count +let distance = count / 2 + +for (index, item) in array.enumerated() where item == array[(index + distance) % count] { + sum += item +} +sum + +//: [Next](@next) diff --git a/2017/Advent1.playground/Pages/Day 2 - 1.xcplaygroundpage/Contents.swift b/2017/Advent1.playground/Pages/Day 2 - 1.xcplaygroundpage/Contents.swift new file mode 100644 index 0000000..8d04705 --- /dev/null +++ b/2017/Advent1.playground/Pages/Day 2 - 1.xcplaygroundpage/Contents.swift @@ -0,0 +1,34 @@ +//: [Previous](@previous) + +let data = """ +104 240 147 246 123 175 372 71 116 230 260 118 202 270 277 292 +740 755 135 205 429 822 844 90 828 115 440 805 526 91 519 373 +1630 991 1471 1294 52 1566 50 1508 1367 1489 55 547 342 512 323 51 +1356 178 1705 119 1609 1409 245 292 1434 694 405 1692 247 193 1482 1407 +2235 3321 3647 212 1402 3711 3641 1287 2725 692 1235 3100 123 144 104 101 +1306 1224 1238 186 751 734 1204 1275 366 149 1114 166 1118 239 153 943 +132 1547 1564 512 2643 2376 2324 2159 1658 107 1604 145 2407 131 2073 1878 +1845 91 1662 108 92 1706 1815 1797 1728 1150 1576 83 97 547 1267 261 +78 558 419 435 565 107 638 173 93 580 338 52 633 256 377 73 +1143 3516 4205 3523 148 401 3996 3588 300 1117 2915 1649 135 134 182 267 +156 2760 1816 2442 2985 990 2598 1273 167 821 138 141 2761 2399 1330 1276 +3746 3979 2989 161 4554 156 3359 173 3319 192 3707 264 762 2672 4423 2924 +3098 4309 4971 5439 131 171 5544 595 154 571 4399 4294 160 6201 4329 5244 +728 249 1728 305 2407 239 691 2241 2545 1543 55 2303 1020 753 193 1638 +260 352 190 877 118 77 1065 1105 1085 1032 71 87 851 56 1161 667 +1763 464 182 1932 1209 640 545 931 1979 197 1774 174 2074 1800 939 161 +""" + .split(separator: "\n") + .map { + $0.split(whereSeparator: \.isWhitespace) + .map { Int($0)! } + } + +let checksum = data.reduce(into: 0) { result, row in + guard let max = row.max(), let min = row.min() else { preconditionFailure() } + result += max - min +} + +checksum + +//: [Next](@next) diff --git a/2017/Advent1.playground/Pages/Day 2 - 2.xcplaygroundpage/Contents.swift b/2017/Advent1.playground/Pages/Day 2 - 2.xcplaygroundpage/Contents.swift new file mode 100644 index 0000000..5a87b61 --- /dev/null +++ b/2017/Advent1.playground/Pages/Day 2 - 2.xcplaygroundpage/Contents.swift @@ -0,0 +1,61 @@ +//: [Previous](@previous) + +//: [Previous](@previous) + +let data = """ +104 240 147 246 123 175 372 71 116 230 260 118 202 270 277 292 +740 755 135 205 429 822 844 90 828 115 440 805 526 91 519 373 +1630 991 1471 1294 52 1566 50 1508 1367 1489 55 547 342 512 323 51 +1356 178 1705 119 1609 1409 245 292 1434 694 405 1692 247 193 1482 1407 +2235 3321 3647 212 1402 3711 3641 1287 2725 692 1235 3100 123 144 104 101 +1306 1224 1238 186 751 734 1204 1275 366 149 1114 166 1118 239 153 943 +132 1547 1564 512 2643 2376 2324 2159 1658 107 1604 145 2407 131 2073 1878 +1845 91 1662 108 92 1706 1815 1797 1728 1150 1576 83 97 547 1267 261 +78 558 419 435 565 107 638 173 93 580 338 52 633 256 377 73 +1143 3516 4205 3523 148 401 3996 3588 300 1117 2915 1649 135 134 182 267 +156 2760 1816 2442 2985 990 2598 1273 167 821 138 141 2761 2399 1330 1276 +3746 3979 2989 161 4554 156 3359 173 3319 192 3707 264 762 2672 4423 2924 +3098 4309 4971 5439 131 171 5544 595 154 571 4399 4294 160 6201 4329 5244 +728 249 1728 305 2407 239 691 2241 2545 1543 55 2303 1020 753 193 1638 +260 352 190 877 118 77 1065 1105 1085 1032 71 87 851 56 1161 667 +1763 464 182 1932 1209 640 545 931 1979 197 1774 174 2074 1800 939 161 +""" + .split(separator: "\n") + .map { + $0.split(whereSeparator: \.isWhitespace) + .map { Int($0)! } + } + +extension Collection { + func pairs() -> [(Element, Element)] { + var result: [(Element, Element)] = [] + for index in indices { + let first = self[index] + for second in self[.. Int { + return Int(ceil((sqrt(Double(value)) - 1) / 2)) +} + +func biggestValue(_ shell: Int) -> Int { + return (2 * shell + 1) * (2 * shell + 1) +} + +let value = 16 + +let s = shell(value) + +let shellStart = biggestValue(s - 1) + 1 + +let shellPosition = value - shellStart + +(Float(shellPosition) / 2 + 1) / 2 + +//: [Next](@next) diff --git a/2017/Advent1.playground/Pages/Day 4 - 1.xcplaygroundpage/Contents.swift b/2017/Advent1.playground/Pages/Day 4 - 1.xcplaygroundpage/Contents.swift new file mode 100644 index 0000000..350265d --- /dev/null +++ b/2017/Advent1.playground/Pages/Day 4 - 1.xcplaygroundpage/Contents.swift @@ -0,0 +1,529 @@ +//: [Previous](@previous) + +let input = """ +bdwdjjo avricm cjbmj ran lmfsom ivsof +mxonybc fndyzzi gmdp gdfyoi inrvhr kpuueel wdpga vkq +bneh ylltsc vhryov lsd hmruxy ebnh pdln vdprrky +fumay zbccai qymavw zwoove hqpd rcxyvy +bcuo khhkkro mpt dxrebym qwum zqp lhmbma esmr qiyomu +qjs giedut mzsubkn rcbugk voxk yrlp rqxfvz kspz vxg zskp +srceh xdwao reshc shecr +dcao isz wwse bbdgn ewsw qkze pwu +lbnvl lviftmr zqiv iadanl fdhrldn dlaani lxy dhfndrl fkoukx +raovmz pdysjsw hqps orsyqw rrwnzcz vrzoam jjljt +wgt gzi icpwp qeefgbe msadakj jbbrma sbj dufuujx zex +cfzx bvyu eswr hafcfy klw bgnhynv qrf aop +rzlq atrzcpb hpl pajjw cdxep ean aptzcrb rzcbapt +xogpf ucc nsukoz umtfbw xfvth ozusnk fopxg ubp iflb +xot nqcdyu kpwix szo cyxv hpmp hwtrc zso nyuqdc aha +mkzf cat tkjprc izxdggf obspan lmlbg bsyspf twox +lfmfrd ooclx tcl clt +dxvnyd nxwojj arutn eyqocj swzao tmh juvpezm +teu eman rlmdmk xkbodv fvrcm zorgy wmwe +hmo fdayx duciqf cgt duciqf +imjnv vfmsha cyrusow xjswoq nclrmjy sjxowq ynjrcml +rwbsay alsi bmzpvw ozq aduui nihwx glwdiz ixmkgfx +vtjzc ntkh zekj qrbkjhn zekj lyfnbg +afaig jqhli oie lhwyduh kqfnraz nfrzaqk mayfg iljqh +inb zum zmu dnl zjxg vrdziq ypdnsvt +uhbzmre mpdxm alkbmsq aopjmkl mqxenry ayvkrf zxvs qkfqva +fimjr ccv cnug crdsv +bqyve lhxdj ydu qbyve vihwjr vyodhc +vmng dyttyf noagpji tdtyfy ewiest ogg +kgscfj klmsv vmksl vmlks +qlvh veo wruft wtm fbrlvjr evo wvwmny dhp bvrlrfj lvt vgzuyyw +mxuro orxmu tivu tjdq ojjvju cdd +kjexme gxbysxp yxrum hinrklv fxehytd qkt tqk umryx nim +kywnux wab tzrft dsaz jgwuw dubarmi fle wjguvr umjp uzncwj mzz +qokwh zrda xywufk tbxhhj eejqaoa hwoqk zer hwt hbjxth xyf hmh +eregs qdx tdequa agrlrg mwwpba qjie yrjvhr txujk +iyot fxwdcb zvwfv vfzwv wvkw ncwbr wdejrr ltcdza +waix eza znmonya ldfghws ialwfvc dey ubsz uhbnh svgekg nonzyam +bryz tfbqn xznfmw xiplgww wwxigpl jxzcgxl rzyb +cqvl rrcoqxs staeuqr hzzow cwv tsvol dio coc ddavii uuojy +txbn qvkkyh gbqnjtq ndpkqr srt bkpqfmm ytycev ypcv bpqmmfk +uqkjmul dour zgq ztango yrrjhrg ufxnmuw +ekxbcv vkxbec xbcevk jiq bar +wczff qdu cwffz hhk wlvyg +zjlconc osgsro dajzo hqih ehml +hnio shccluw cpu ivaby tormn vkef abv vkef ivaby +xgbdeso xiizs omqwy sbtnnt khago evviclw xyu dtvg wsyxfuc humewp +cnzu bia vdyqrf wwb qveum hmh ouupgc owli +pjpmfxa dvd lxgh ndy gwph oebfkqv vtlxdg efl ekj dyn +mvan nmdkc ucyshia mavn ecst poo +oybm pjwm bmyo wovgu xykziaq obmy eiirhqd +xkvomx yxvv oxxpth elh vxvy lhe ycn +okxglw gmaangx gnxaamg yduzrr nzwxtnd rcxcu xjjvno yat cin gaxnamg yss +oicgs rrol zvnbna rrol +abb edpnxuo peoudxn bab ceay +ncpkfz gvwunb fckpzn caafx pkcfzn tsfl +fnrt ymenkpq wodubcm niv nvi ziluu cuowbdm zocg pdakwt mlzxkex nuxqclo +uouxcgl stgua otadr ideannq wizxunv iqsdpj mxddt ldst ucxogul +rbrwyhk wqoz zqwo ikwgexl atpu iza +smo yolp pcahlu muljxkq cbkljmz zlbcmkj zvbmgz eaiv ncv zplifm yplo +ocutdhz zmnaap llgv llzpl loavju guzkfq saay rxyhng cwxzx lcv anrnzs +etyzx tcm upxrtvd imyoiu rdpj fed dmm +gonqa szteh szteh razdqh phyff upf knfqfaf knfqfaf fpsgl kakag +mcju mixskop isrwat lcr nfyi lcr aaevr nfyi pqrbk gnful +xfmr fkmnq fbnhd mxrf litniid xbae frxm zcenf +yuh lzojtj rqsh hyu +vbjgql yeshsuv lokt efqota wpwjfu ykyq rxc fxxh ycqfkk gndts vdf +wnylmr kkuruxm azr xukrkum dohkwx dmdb +bjiyrwf dvf fdv vdf gnokekr +jsaq hcww iayqtu llv gdpxdrd hwlo nosjit wpm lcab fcgwr +fxjp bys nnf xzllckh bys hvojw zcwtgwz wye ccyvjv +grafa hbb ghk wkdpsf ufa uoqmysd +yvacf kssbff iovrm mvrio cfbpb avh zzje +gqd qmsen wkvrfz vhtsa zrwfkv gul zkvwrf +hrbi svaogb aogsvb bgrk hibr jbtkr +ljl ryc mrewrge yky +fcqyymt emk qcmyytf mcfvusb luy qany cbsvumf +oknt mcozuc ccmuoz uoccmz +uziil xobutwf acnof iqgwl diso +sekq fxbtsuv ddnnqg rnemlt dngnqd hhgjfus stxvubf +lajcp qgiw fyz blrlcd pviwv buh wnkk +wolqfk nvpapfc rwcqxfz xobno yzjfz irpj wolqfk wbnwjt +vmabj noiljne hhqf holxkbk swwzx ylgj lnmxy lqodhk abjvm bmsrf +bpnp yrz pjepxxs jlmhuy vihlx zacm inuazhc xsxjepp +tryl kryh eonvaad ucevssk umkxg lqej nswopjj svkeucs bmh stosxxz +cfdwd dmfdrvm ibuhsz nwtgmb pjt dmfdrvm cqdcm fzjjz afa ibuhsz +erwp abn jwx ynmkkj rhgg abn epd atqhs rst rhgg +jtnp cegdsoy gfuvfbg gdmn ahlsc +jgrp diu jrgp onjnml nojmnl vxockc +lakqyuw khq dcpiwt ykwlqua hkq plklx ujbckec hjcvur jnp pvyf +usuvoo jkih ylafyy yhio jureyj +uazisdf cnwlfnf ewodatr woaddkd wbla qmn atdrowe +bnyepaa ntqh xppe ydtsw ppex +yewjwsp jxylmtk ijese ewry ijese kbja nfml zeuwcsh juimz +qbvmf nca zsfreo uurgaiz twe fbqmv ncwi etdcsk atowfp +jeotslx kgdpzp wxlcww pdd dcn ddp +macllv ldl kyluine lbt hbxbr wxcaspp ezwvc qxkeu +ivg gxv zsf ucr uff yrz +tdlwbny bqlrlz tbynwdl lwtbdny +tnekq pdaievs ttwpfh xfm fcaa +zqqhl zbf fbz uqrv bfz ffwavhk foccg +vcw ebqdd cwv eddbq nrmq +hpiusz sizphu xzq sgyehk wgagkv hsygek +vagkxa iou frqdnnr ipcg uxvh vvh eskf katgpiq aqktigp gzvseyi +xkwgd kzfxk pgdy fmtvq ngf rshx zti pamviob ely knz +hwo rteohu qzwoe rotuhe wzb +bsqgg tid dti gtats dit +sjtux djwxv dljwjq xwvjd xnqfvx veqdrtl uxtsj nnkjn wnhilaf unirrp +fruuqjk gtote gooklg bzwhim zfnccmm ezipnf cxwdxa wfu fdca +zcyxb byzxc cxbyz pgcqco ivlxz +wrjh zfdinsf ihw xwosiah hdg xpiabno bilyy azdeczg javuwa +rinlv dcpt qhencba mmb njxw gadc +qwcpua qzyzt cxjsgh kumh byiimas qhsgf qytzz rqqruwp ismyiba xydcxz rwkscqa +xbzefi hltca ibzxfe fkx xizbfe wvaynts +oyuce vzk ouxvj gfh efgbv ubc nyb bxnbhd mtwboe whksy ovmrt +ljrebp tacn bpjler utphw wmfw rcnha +drdnic eyodes rcnidd yseeod +umxmsf kfroz ukhjin awpnnnu ooyyohh tuv rafano jze +bakz lfzpjyg gfkqcgn kzh zwpvk gqfngck +jpaony ojpnya hmro xaaz tovary aaxz iel pbg +swvbgc bbhjp yvrcddd rhj clfu eao afrkegn qvvb yvcx nxjmdo rcvtx +conbjy jeqtri wvujt jeqtri rkhllgw tsdt zowreo qxr qbpragn kuzmplw wvujt +jrpxyp hchljy rkowqb eeaf ltllebb gtksrwx iazx vnsfmc zzrxw hlcjyh +piehb cjdzt eqn kuje rls oaewoz lrqwt lcrrq +hdjowxv uknhlv hluknv pokxg +txiqxfr fyyp pyyf xfxtrqi tvm rtvby cfx trx nwrf kqrxtat alwot +wdaadr stexpow ardawd uejqxc +wwgwjel wwgwjel mtjt wwgwjel +mczx uua lgceb dqru vkcea tcet ruz +jkt yroojr qdrtdu wze ovwz fdmqnr xxsyfd kchytwl hctlkwy gyd +eif irnrce iamhxgh bmis uxye azrwdi sznv yuowb vdlqqxu +dxdjyj hngqwzs yhwku qhsctfe rhbc rchb tqhcfse +fxyxnzs qtxevin rvtxtc iqnxtve +zgbpk mwzxx bgpkz wkpkn +rjiym iub lcyw agbtlb bzhx osv rbtf +emmyu uoflio tinih skpqaj rbor gezbhhv ine mij qlqte uuj ycns +owmwc uhxv pyho ftjh jzsg blqn bszyo bob trbycy mkru +mwgz bbqsmpp fgzs bihhg bbn pjxxexs qrqmt htsxfwo qltqp vqqaxi +lpr wcvy sxjqq ltd rftdgv pdnog ymu +qhcos shuy icdhucu lrikh rwslv yxbgibl rcomhn wakirz +civdmee owlzocl vedecim rogmjnn pix pohcmk dsjm yworm +vzdpxp lvt inufv yofqt omm qfoty qrlseqy amkt kjcvg vgkjc +huhq quhh levzsws sjuun ofgqr cjhp nfxbbft rnt wtbd tbzab +tjftkx xpfcv hvftvhw lpypbjg batrn fhwhtvv uthl arbtn brb sthv +ogr uyuxdco bpjgir edztxv sxtgu jzfmx ihnauz zwegqkr kvkw +mhxthf pervvn gshy jig ezjteq ckkcpy gww +tiljyki rpe prcojy tjkylii moxu +pjsdqc lgqydfd lohck emrtejw axwmo wuuv rfi qzyncmw gjijdfb bljfd xrs +ywjab gynzi relf kziy xmsby izyk ocwoho kqnyh bwayj +bhjlz uonz jhmzuq eiajoos zjnbj tomj bmyv hjlbz fgw jjbnz +kszz xzw xzw prtznyb +ghzk vxhwt thxwv slwpayp qxegmi dawdwo kgzh +ibpcvuf wnuwxu sbf jsj bfjynl cdp jbylnf +epaxr vfhf hvff azepadz pwf sbo pgfzya hslyo rqqj rmklw hwtta +yyolko pwbvxvg xdwl yfje hftep kzzsr kho jeyf yvslxpw kfyv +xmk juyjxy eqno mdwklum reg dgn cirh wmxfyj bnxlgo dlobk +oyv gshqyot jgcqe dsf gyohqst gqgeojo egoogjq dmqpyp +sypianq yss lmhu ulmh itilh ndkda lhiit +qbxxl bxxql ikald nfap qixwbqq +jtqhqty ljysnl nwoj toa bmmyj pal +ahktew sxody nkvsf pbxyt baws wgwfwej bevgzm jus hcvajfy kzrb jwgwewf +jzsb szbj ujngwf nfuuf lfiuxdu uufnf orsy +vgo hto isstyul gau wsmxoqw +uxw itwf epaw hec wape hemol rpwyosc xzxmrll eetz zui kagca +mjncux muv rygdeis rygdeis +qgkqjvf iprzibd fkvqqgj llcrl vbh vlf lllrc zwrunt +dslsa wvoex eqbwj tjem gbx ayn xcan fnacl xggxon gnwjlh +yzosv hcxjiz yvon gcgd +bixpny ecln sda eymt bjiwk +rlcad lrdca adoqfzs rgty mds pwb kmwj +wkai pmryffq rrdmodc wgyx taz yxwg nkap +auynzwc vzg uapdv qkrh +ldmuysp oyu kpn ejbl mfifa bzs hwyn brlw qpzqx uyilao ysdumpl +czoxoj pwnultl wezolbw lyk aonesgb +nqy nhb nle yycp lgtbo ojf dytwyh ufa +rwr eph obg peh pejret prjtee ovgz +vdqf vdqf ycjrg ovzl lelbe vdqf +gvagdqm gvdgqam dmb zaxe nepzwn +emwh bkkbgec qwdgk mhvfsrf wmdfpp ekzuua +mbqw lgkyazt ckyhvnq uladwo owt +qwiwd pbo tkjoqda zapo dygqopv zzdlwfn +qty dhb iinncba ytq kvh idgoevt chx waq +ulffsvk vplsz ulffsvk uxsh cpwgxd ikgcacx nrirke uowcjvn +gknmxr grkxnm fco dilyyj grmxkn +saqxkh uhue nvu fef xsuxq ekyyoc bcaavd +qltwqa vrmpv vhra nof yprauc vkreojm eaq igiy mec +wvheiyg uthy gpvcs nhnjrne mqaejr tfnsly zfbhn entcc nystfl cpq +zxv jzk dwsjgrd gqqxhp xqxu naunwc yeh qzpkz awcnnu aoosa icadax +vpmqmg qmvpgm tqs mvpqmg +inehzu zwxeoy jxia fcyzxc hwikd +bzwnp kamsen ajpn kdls bzh xqcb bzwnp cmjnfa wmgx +hbuhc qgvhxy smzkxh zzebox hbcuh net wyrdppc yvgxqh +oeum oemu iyags xaipdi euom +tqljgoq ghtdhw xhnni lux qltojqg lki zxztda pcqjif acpzvwy +ydijaq kbyjxpu onyd hsfgz geqvbg +rwoih xog dtbzyr ryzbdt tdbyzr +vcdxf zosw pardxfz bmb mscmain lwfc jvq hbszcqh fxomsmm ahnugx +zutsemg pqzil ddv nsstz gmeuzst bedvy xkzzjpw xlqbd +xxf ltnnu yeb hbml agj meovtjr qrul kexerkw xxf +tqrpd hhcx bmdv nlmr pnu pajdtc rpatqi yekedx oeiuew epsshog +ttbfpv plairk toh jagfsg njnqpa tmwh vwqp irtxv +vdky uwc tkkkztp vdky vdky qlcw lza +rzie yundymy pwgx wtwtbg kpiw mewnb liveysj uvsbn +jgfvyny hacg pzra arpz uowswu puzsfu hoe heo vrq naup +hqv vrl uko qgpikho lligvxa wdld qgpikho +whvby yomxwj dieffc jkprinh dsaqy yfrnba woyq yexeb mjn cbszn xeswvvo +wowtgu rciyg rlas bra quyfec ihe thuu asxhscu bsbdpbi ogxosu +vydsaet tvnkjq piedkzj foeiqz zqivt iatsju tjnqvk drauaf vqitz invoz +cppn jqzw zmxr qksuas iifmjg xtkgf cppn cppn jpsd +nkifpsq cxdx bokxhm ebww kghagrp bofhrl grc cheuzyj +ibgrlvm hrcx jjuoh ipmt +hcoqkh fzt rgravb cimauj jxjq blct qhc vjxw pqpg qzp +jycxz xcv czxjy vxc +liljaur cgmg neldxb xfummcq yfhiukd dnqhl iolxn cmewhb +hpvoihj fkwokod txy uuktw vmqqb dpldzh yxmcay cyaxmy xycaym wekr +ccnaf wuxc ecadb vbgpt ccntf sezo skjdkbf fnctc +hqdtwho kdhyman bjtcjvr bwllva ncyffyr +xprn jrrvmj pdw yvexm ewbflbe eapml rvrmjj xmevy rxyzhf +wjcbpy qdgtcp cfjh muww fhg sgfdleo nelpte yucqa aavev +rci vqypsqt xmg rzii +gramh wwprtc ampdhw dajr +ovrm mdyhpbl mdylbph aykz +cbmo fxs nuugu guunu upt ljjuhjw nituh utp kxqc +rhabal rhabal rhabal vah lfrs +nrq qway ftzp rtjcks mbygdtd hsiqbh wypqb rtjcks cllp hsiqbh +ywa anhcf nvd puqkwg molrwck wsctx xvd molrwck +wox jzq jfen wcvus cswvu oxw irg lmu tpj viahm jesic +qenad neqad smlgi ydwzq ppdemvs ucyuf qtunm eoqx jlgv +sucpl nrdwbl ltvetok npbw ozzw hafyay sjmui sjmui jkqlq pyn pbuopx +nxgaiu ybyl meo kgh saqjaz xhbqr otelcyp vkwc +iqrl ldjlwvl ajhrl dnhutr gkknyqs mcvluet fgyu ogiz cxo aiunl orb +psd cyq xpoyqny yqc kozqh vonfd uhozwz pds hcpw +tvaxder tulwmw qiw avddbmh irog vynjzcc refx efxr emnvk +myjx npqk whm egw kpy igrrohg ukglx ldnuqw caqg ynx fckhnsh +dafv bkdoqg zcqvbco xgikoac cvbqczo +rtzhpwk ukuyp bayhzp upkuy ahbpyz +oarcuv pnlkxvw fqdkj hwzsz nauwl lpufibz vzfbgc unkluxy rwh xuknuyl +vxhsaj ppdxw qrswqtu ulwv uqtqwsr ppxwd +cww cww cww scu +wiiikwa bfpewt zbgxfkl iqpk tpbwfe aazdcxj ipqk icggn fwn fjr +net ovxuwpz yvzmzd yvzmzd +xgar czuhp vuhisaq fgrqxy evvrtf mnmar lsk +hld mxuedug itswju vmmejqx snzslqj toe bbmugph mgubhpb mowj nrjnzu +qbz ouhye hsldmp lcf hyhlrb ewvle zko +cke mupaq quapm eck +owu zdt lales tzd apjjo fhpx bmuktbw dvehpz +libvl zxypk azazc vtsom ohdzycb +kiowxnc scxygrf ckxnwio ycxsrgf +vcjj fqz lfawfx mps zhv qykch vhz psu zud spu fnpvkx +scfvum fuktgk tua ieosetl wwmjtt exnsw wwmttj plvd pfb kku pdbom +wkfw snukd wkfw gyaojdf bjw htagy cdsp +beh gatqxcu ibrooxr ssww orrioxb eenkqz +jlv affah mtbemf tylh aafhf +zqfajd uwzrw csouuip qzadjf +gsnlrw tcel hha tfbzrp ild aenqa +iirfxef kdux yvj vbzgj +ibx pfll rgkp nancij llpf xib gbkfy +uvw kkbavj pznsnk okigtxl ogitxkl eobbs xhaz wroabn ltogxki +bivdf lotvmoh vrb kpaeeue tdab qhukcb qmy kuqf kesu +egs hbsfeu esg twxko uib +ocraimu qilp ijmx eco nhevqp juxf ksejr bcqqau uhpt +pyx jmpglf juokd dxszjw cml vcjge pfg +gxwrt btmimse dkpbha idmz mtignka ngakmti +dpjhm jyalra hukf imocr lkgt rqywn quhe fukh +nbau xyc bdh yni xaawxm cyx xwaaxm akx gyodqe htbifc +bywdxe bfrp rvb rndl onal jghiwb nuta aint qlciwcx +fpic yrqce land soxhci qzc zoebsq hcdohcc fzhcl iyxb dqinum hchdcoc +zok ghgp zok lmk +ozfz zofz dkdekzb sqc +gfti zuqvg cexmtyl qwuqnj stepb erduqhy cuoizcs qudyreh kqvfdd guzqv +jrugz jzugr lmqu jgihgo hjfbz duxkn unxkd +ckiys dbqmi ckiys ckiys +iylp uvvdp pluifaa djo +esxec rwvel djxppqf jymwt ilm aiz upn aiz wrfefwi rwvel +nitgjr pokxuy puhdwg qtxpb veylp zqvzkbd lrvpcgu zuy rnigjt ibci +jboyzq ogcldr hlon ywav jqqtz qjzqt vyaw cok +aqdw jxn hqknh azbylg +jya qpxtmsj hqrtsgg qjtpxsm +pofcs sxw dlvru dlvur swx +yphvvb qqyyfsp sjkbff dqyerxe jxzes oof +pwbya txk bbwsj ywgimd kmdpc bawpy lbnt +bkbazff ldmaq tyfl acqurpy ndnrp +asw ctiv mnxzyc weeuwb gsn bzk irbyhxl cgqomj izy zbk +yrxcrbt bcrryxt pofe wwzl +vuaqez kbtuyai vuaqez dxqud uvo gmhtg dxqud +tpzs gqdxpxo zzpgta uurjx xpqxodg +cil lsv vznqw vro zqzvjhm jhgauzw uxnwk lci zpgpu frjvyzo tsv +zfvcuim gwn gnw dxfppok +btb goof iwadca aac tbb jha uvzi +qah ned ipmure kyta ffhrwe njz paq kaag xmlui +rkmw vrblwyy gpax hxsf zpbza gypuwf jbib ypcjwd vrlybyw +yfjljn uxpvg huik jsnah nkhsg yfjljn lqzsz +hagjlqx agnax jqalxgh rvjgtc mjrmph azznzcq gxajlqh +ipki bhoabp rmiyl dmjyxl zzsmap aju +tyjrr rigrf ciq qic avmwu jtr wpq +vuf cosgytm toycgms ufv qzpcbrs +epzgxr lydrsj ezxrpg expzgr +ecm prj kmak makk jpr +ccwyq txy okj matxa socoa +zrjphq gigayv ywkfmru yrwukmf fxjjrha gqkxx zhjy tisutx kufrywm izjfj igg +lfhgsro gsroflh wrpo lofhgsr +kgkgj wkhnab ubrjaoa ubrjaoa ubrjaoa ggdgh +hztutpn epnqmz ffcroq mnqpez niibpn kdloak xjui ozttj lyzsc pzgq inpnib +kruz sjqp mmd hhdxjgc mauouma asevvo upjwqi hxcgjhd etqzagp +zylf qime cho oraid svytv gqrjufv mker cho vnkyiin tjms +dotjul qyv hnh cibtg gdpauyx wzp +fabtira ejxoeor cqyethv ndjrq hnxn joq otng lrr csytrub +txhgepd fwdaanm nawdamf pxine qqrn pronw exnip qwkimt rvy +kuxzhi jln urzxtw rzu ebsuylm tscru qwlhfgq nnu nuchvz vuht +cqgu camlr umkltcf stx izp rtdwxff wkfvs +jhje cxix lefcrsu nebv idfzhic xqri xkft +utzxb znb ietupd uqgbhje aobip oawjwm hetyan uqtqv hpwzyri kwxyu +jvzvbt xuyvp aegdkb srbw bzabpf lyfriez cruyfu +nhi nih aeb ihn +hcf zypt djcm pkjx pvhh +rhvxcfk exydvk ids hybme hnk yfchvs mjbo meocn +rpboxr rxoprb hdzje zhedj +ziildbo apzvatr vsv isndq ebxyy ntm tdttg wkvdh qnids vkdhw xxolip +ywu uyw ipcjz pjzci xjn kvgk vsocprw +euzo njlpv ndrlhi drlnhi ivmjkb fjrtxta skvgmrd +gbyvj dkck gevpfvb lhadhx rgjcdn yraxh bdk oen vqryd bkr +vgkp hncttxb wgxh gdyjo bbdfzvc xhgw rznzgda yxrrlo gxhw +ifjlb fpecyic svhjp ilmj oxgr svhaf +vbqky lhccj xtmm xzjyykn oqmdq qywir bswly +euxxziv totzer vsxfx leo djho uoeaz edaig fbu lumbi +ooqtwq pvo kid vpo jxin bod btqc fbyuz +jhabi mronu htqqyz umjcbv sgnbp wyn cetmt pcjf +tnrkcyl dduuhxh rylkctn pwj rtynkcl mzzfomr +rxx ldqffi ulappk nltawbn tplhb kyb cqyi +vzkw gviooah vxh xeae ohvcad oaiwcj dkx +sdofdjt hcifv dqws sia mlwm vfich kavh myzue roops mzuye +uxs nlbmjp nlbmjp tlaxa tlaxa +ynnisp twx xtw jgkc yinpns +kumorsm wav xhx bpvz clqc ffmadzl ndny ymslo lobv +ljzabj tqhves mezh pwn wue dwfqq lynvtt boeknvi xqbd pkud tzlanis +lgq qiikzl oihnsr pivtjmu qhic yvmeebg rxu qgl yuxnqse dvu faxqez +ldk mlwja vmdqr yzlxiua amlubt ejmzfx nonm zhkxbn gaqbnqq +ttc ctt kneknx smtnaft abljip tct +uybhbiw zwojzlm cfxoopp abulenj znz zzn opllzmm yufk witwxzp +qvkybwi rdbxb qiuizmo fqgne jgot jxz dqhapn +vzinf ehaley amnk laheye invfz +pedakl ivld agzyhr wmzba tzzzg bazwm wjwgux thrnxkn +cmyhae nwfs nfsw kmh pxkaffq +vdf szupev tyunp qiiu deevxmy wozvtt nelnr kgdexy gparqj hajavz biizn +pwspk skpwp ontbjee pkspw cfbj +ihsmh djxtak wkzllao oyr djxtak prc +uhvihqq jrgf hdfek pdrfpt tghz gthz awae wcygi wujti svq fhedk +gnfhsj odqlt netmsul rviio nkzw nkzw +xyvc clxw cyxv lxcw +duegck pkviu npwsp zdx wpvn dmxgnv ixv fybs xteru +vih kgk hads boaddu daiwo hozoufv nef vtcplc isiw +tzqoo dqlgvno jzlay sywx ecej addt ecej addt mnfcu +ymgmby zegudpx ipsjai ger wcwjw brzebb +eqekxlx itra xekelxq exqkexl +rciu ojaa ircu nxjga puvmwou remgu +sltth pprimb slnxopq avtir hvpv ppww fhfap wisn kzs jcuuuuf +xbppc ydpbq zhjh oym iljzvk vsb +ueye shtps uccehi ccheiu dqm yeeu +gwywf lcpv qza qza gzuovj jfzffyh oybfxqv +aawi ynsvdco azdoz cqr tnyquq xlyvbx eca kcalpes +zumgzhy rou kguqa vubw bwgd qprxcg etnbev nqmi +fyd tuoz uwclqn cgl lrpkf irz dizv nxze clg jghx jbpt +kwuanos eorjr tcahp kwuanos cyrpfji zxayggd kwuanos jkqt qqvbork lizk +vtu ovje vhg ovje vtu zcy hrhtr puawfgv +bliz exp wot svxv epx +jiqgxwj yips hjsatc jgsrno msfp vxvbt bba bqmw xjgpgog +vpvypp ggwp wggp gndp hedpse afji hcqgof +hxueubt hiynoa qqzaj ohb qway +akq nfnes sdrlza nfnes weq +udxpdpx gctuv llhxuow rqtetm hdbnpte oebapv civy oeobu ftgivd pykj +pbgbvn jgmr xrz dfn gosjobw ndf +gnf dtbsnc fwcmml tscdnb fgn qgadusl eifpk +vmnv yuxrup qcphi tanc tnca kjrv cphqi +hclggs sghglc fgplp odn pfglp emkrulf whwtmbs qnuyg +wcxtr ani ain sha hsa zxbkf bzxokat qezo ljqxi xqcwfmd dxo +waiq smpbu dbyka uibxjrg nze wiqa rfpts ddjsjv jqqjez bpusm +lpcxf vsbj owjwc tuqj vkrgrh jsjdepv oil lxrjox frsxsi clr +vzunp prwk nnd rfs vpuzn +pqpqv lvsk sqxf nhobsm hakbn ywj +xxu uxx szqnmi lnwtmx +akq nmlw fupwsth jduvhva +nac wwlxqck hpbce vxxqa fyp xvxqa kxwclqw yvlmv bfwi +pzxjbj nvwv mdooiez vvftp enjrsck iypu uhru fpx omtd +llxgp qwf pwaj cuhb scloot hbcu jgp vjw ooclst +sisd akawvzd wvdzkaa gyoij ikt eeeosb jiwiup +tche vxj sbctqv jvx gosur usgor ibo yqxo qqgd zspl +cidd welisl fxblxqk qxbklfx fbdoqcz glhq iylodvz zvds ghlq +cnsa hrxst mrnkqtj bptq jmi cpbcofs kveyeur uzmga modphm rtx kntqjrm +dvyup usfaq rtghoec bvcos fqsua zohwwg +onf vncybi dlaxni oqyqqkn +okfwa qyyx ebnv llql nphq etdt ytgivlo jwgwz kiob +ann vqnqvpx wth lpwid bjvzw xpwqxcj azg ioeyzzp onwf +smy epzomx xep yid zctvrfj astdj cfg fgc eriuxt +rljqgin wzobzrh cuwtx vcsbx tmg tuysq vxipgho +ewp rsrnsj wgeyin lrji ddgt utol xxwut fjiwopa +upu ftvqbk tfkvbq fdwga rmu puu hbiasjw +cfl lmqkb lfc wbtlfi uqsjs ejgmphi tbliwf nzcela gzb +zop unwmiu acull mkwh hvruknw rfk mmhaz iqmenq fifino +iczua bjut tlgf zicau jtbu +mtka ipd mdifj kps +irqkysw xfsjl tedx yckkbx iktxb sqxn pbfvubv uudzppz +mdrn cihat wcext kufs awwtjok pfjg +wdevt tyo zzbp pqlqq wdevt +yhatqkv ntuhw tdfd buxazh xbcsv bas gkv rbzi tddf jbj bsa +malip hiiy qezz yhii wlfojre +zqnfll bssveq lprwbep bhqml tztbt +npnxotu yupdytb jptqo klfydfe fpucmfq svxcqr unopxnt +gdpz gwj iytiohu efk ctjzf asade abhotq brmhu tbtdur zzksbh +kxft klzslf tjdzciy lzslkf +ejei ezmemvg xlt zte tbwhz dgnfpao zotck wus uaz gbwbb +dgednf vypmbs eiytot empfmny +uopmui uehue wdvzt adpfcif mutl ifaztka vydi xumtz orstno +dleero olxiq gxnlfm nfmxlg wloeavr olhrwg hrjd yicj ymyeex qav gxyjgfq +hevj rqcne zycgb qgqtn rqcne ptfvu yyyu zlm hevj +zrkhuh sttnkt hkuzhr vqtu +ppsfm kcao qjq dgadglx cxaawjn pbucfu fed qgioarc dfe ricoaqg +vmawf oktunea zraoir gkt zraoir jcvkqoq +mqgml ecawug ugwace szwul iwbmooj owmiojb +auggaw cypcuw npci vuyxijd pofswjx vdkrgx xylk rom ksj +qmwx jgsrdj ikva xzxw avik +zzhcqu rbg pywjdn wyndpj zchuqz +wzd wqycftu yldezp zovuy oydia hovewe +kfid qkkk thak qhbf rvzlzvu uuxh pbj hkat gow oeqcw knqqzha +sua itv hfpg bdqye bznlrk hfpg bdqye kvir kaai ggtz jqn +ulggl guitamm tkpckso fupacz otxtqpd jxnqc +ueesb ndyik vjftz jgqqv nrcf +krh dqpmsw fybzynl zhjbvkw exefc rhs neq ldprb bhhvxm pjwirun +ymavl qwxr yavml wagwc ekokrpq zewppw iumcgin cxdvwx +wwdukav kuawvwd kowv dkwvuwa +eazot bil tzu vdwwbm fvauwrq +esq tixokph yspf ztoxfut lgzush pwv swh pwv auqhuu tixokph +pdbeyxi poio mugfkb brwbbx aao uszw fokjeb uswz +sbs ryjr ptispi tvnhu htunv vthnu +czjmg hbdjhvi jrkoy fpgwc syafy aar kvnq eaecsb wqzpx +twtp dvl uvyje qtlzj dsvyr qpjnj eyoigx bhgpccy gwn dtuf +mxit xunctu vbyks wmqc jriuupl ybvks uncutx nsoxwrb ykt prc +yye mgf uhc irowpc dsdv iwaxod ftavlj dxzp tcch tcch mefz +rxe xwrrgl xwrrgl duu rxe xbbgoe +ucsz akswcd ojrmqq cox hgfh lxwu ltnnf cenikcp +opjhdp svwezr svwezr opjhdp +qojlkl ircxqnt utfmdg fcvr vehkcvt ufmzcpv xwlh ddavv xel bwlz fii +rzkayeh iursm zhily hdnq fqydfvt uwoy hptpiqu tdqy bgr xdr +ymruz umzry hbltwya jhwhzk flh tahylbw bdbaimb qscbp ntkuf +uxpato owsqyao vaog oenomkc usrmnc epua vzkppls +qxqczbk qyguz alawj xgjawtw wxtjgwa snfcdmz +fjfgos rmpd mgs vbk dlls jkljao eoovdfb ucdvaoq qmjmqku ney porr +nmcrqz zcoxpk dlnzksd ymh zyg spxss ruyk bychq gsgv eusiuid mnrqcz +jbzadnx lzl sdamer okoico frqisrm lxet agriw +xceoqr qai vahc jjzifsn exg +igjpn wfy ukn aag quro wklsq cjq bgtjrdz gmub wyhh +fzlwnm mygfn vkzwvw zvhsex gfki +ijvzgai ebmeq wssfmbq uguh sfuutm nwkgmex dxael liakdxs rnf sky yowpxc +bjzkyjh fced nji esowk qxsubsk qgtts +nkdgo bbjfq fgnxnhd gfjchl jetdb xubsgj eiju ldlm oxsx znft bbqfj +xovcnob pxfe pmstes yzkdm iqlvha nmcziix fexp ivqalh rxecqps +xpyew xudfud wwqe qhfjlcu epv fnrbgyv ihli qngtx yjlfg ozqbzn esp +timl gcohx vqzic gzm shwlkkv icqzv urchuc +xpqq gaqzwo cci dowahsr gaqzwo +jjsagdl umbpxre kyre zvaryft tmw pxpnjy +aqovcz nunq nnuq xjrvvh autjmit jiatumt +elg lps lge zjjot hwz tmqrup xaxxmo zlbzp uftd fukdad kvpymsm +iokwzal ywti zbdmzbu lprywe wbgbwza ypogbga kzliwao wstqi eqm keaeaj gbabwwz +lwfpk mhufe eddzgd ljxyqy vhzkct uemhf +lwqil fzugdo faq feppo usl llwqi +nje hthr ropq qvcepu bexszfj avmzjvv zajmvvv fhcd xnc cnx qnuaux +kvksn dphbyz nsx wrcc ccrw +nzpa pzzunfv ygzjy gxrrtcj hrt trh pwxpg yifgjmo fnupzzv wbzx +aepti rbojui ypvhe ubojri tcema aan dntkw qjx bfvmyos tcm hvoqytn +qpwq exu jvsiwj gsw avr vbemldy +xsbzpf xbzyvx xax sxh vpxt gccy xxa zhgbwoa hwwxoky fhvdxfc pvtx +pnsa ovtjolz tyutl eyjjzt jvtoolz owbypvr tytlu ewtzgec +cyg dwwk eihsp aeuk bbnay aluwyz hdmv uaek mwt ihpse wjhnkeg +fhzx vjetz vjub tejvz +ewwyb jidhu pyvyenn igtnyd tiwr akwkkbi myz xxjwb jjrdeg +jbkuw kwir rkiw ubwkj +bltffuw lftwufb hhsh wfbtulf nrxaa rlszi toijxnz czlci +bqrm pga zgblgcw pgwhhn lcgzwbg bcgzlgw yqb +mhjj vjoa gnjlc kclcr ito ofksy giavy fpqeioj +bkiqmif izidbui sttxxi bswhkxp sduuw +mjgnvw mjgwnv ojzyuv gvj +qxn kkhc whd fgwk auzugg augzgu kqfov wfgk +spdxbnu xpfofsb bpfsoxf ahjywql spbxoff +bwqxhlm wbqlxmh kqgpl fyzgf guhkvgx ovk qhmp gnrmu wvd wedj +vvwf hcnc vvwsngj qedzoxm hcnc qedzoxm kjthdi cbwqep qtvu +gio iqklmro noqablo bab jiqc rwebyg rqkloim wzmgs uunl amqs iwj +snxj szobqt zcgvwv wiyqknu +uto jteikwd cew gqsks hmvjtcy sach +zpgl qnkoex amhufmr figns upv xezrl rjleak nwrna +pzkvrdz dtonazj gtr gfxucuf lstjl lsjtl rgkope kzpdzrv lyptn zfxjys ttk +ddxgm lumlgki jhv doft kok swy ckds swy ddxgm lbfbdv +qfs rcufzgz iaiqw qfs qfs +nvkbo sgv mquwb ritpye nbkov poex hraorm qrrr qdt qefl +irxannd fiud ehyb ggx plqg pvvn uuptop tcvbm abuf bcfnmw +qwya ukblz epmbfr vmlon yqwa +hlo mmv vmm mvm +svzpxun yugbbe sbbpxs dmy xspbbs zhpovyf fyovhzp cpbt pke +zgk gft zybs zrgcoo ypu bue htgo +xnesq srsx pkzaoh cfqzugh +lntd nvxetbv clykjpd svmibpx evxtvnb yldkpjc +jsqq tzwak hephg eqwczd ioisa yim tmdifn mceip +kuwqz wzkqu zwchmj lfec uexne iztp llityt +kvamkpc pvbryqh ion cwizjde gln kcpvmak pzzlw gnl +ydeqf bfaab sydqhbp smsxdjr pynrs cqymt +onb eiab bno nob +mqslq scnelxv hyllrf scnelxv mqslq wmnbk +pttu kubby lgop bbyuk gsk skg ikktlbb inbyvz +xznvl zwtdj vbxdyd clhw +hgy zudelp ickc drfjgn iyws xhc +zzv wik iorhat qkb kjb lykdz vrce yjsjwj +gyw xzgbi efus uuy +hwcy ujdun bjjuvd jbdvju onnk xeyy mmp onkn qyzl +jwfm ptjwrbl hhuv uolz adyweh qpj wxyogp igvnojq jmfw pqs fsnirby +""".split(separator: "\n") + +func valid(_ p: Substring) -> Bool { + var words: Set = [] + for word in p.split(separator: " ") { + let (inserted, _) = words.insert(word) + if !inserted { return false } + } + return true +} + +input.lazy.filter(valid).count + +//: [Next](@next) diff --git a/2017/Advent1.playground/Pages/Day 4 - 2.xcplaygroundpage/Contents.swift b/2017/Advent1.playground/Pages/Day 4 - 2.xcplaygroundpage/Contents.swift new file mode 100644 index 0000000..b5fc56f --- /dev/null +++ b/2017/Advent1.playground/Pages/Day 4 - 2.xcplaygroundpage/Contents.swift @@ -0,0 +1,550 @@ +//: [Previous](@previous) + +let input = """ +bdwdjjo avricm cjbmj ran lmfsom ivsof +mxonybc fndyzzi gmdp gdfyoi inrvhr kpuueel wdpga vkq +bneh ylltsc vhryov lsd hmruxy ebnh pdln vdprrky +fumay zbccai qymavw zwoove hqpd rcxyvy +bcuo khhkkro mpt dxrebym qwum zqp lhmbma esmr qiyomu +qjs giedut mzsubkn rcbugk voxk yrlp rqxfvz kspz vxg zskp +srceh xdwao reshc shecr +dcao isz wwse bbdgn ewsw qkze pwu +lbnvl lviftmr zqiv iadanl fdhrldn dlaani lxy dhfndrl fkoukx +raovmz pdysjsw hqps orsyqw rrwnzcz vrzoam jjljt +wgt gzi icpwp qeefgbe msadakj jbbrma sbj dufuujx zex +cfzx bvyu eswr hafcfy klw bgnhynv qrf aop +rzlq atrzcpb hpl pajjw cdxep ean aptzcrb rzcbapt +xogpf ucc nsukoz umtfbw xfvth ozusnk fopxg ubp iflb +xot nqcdyu kpwix szo cyxv hpmp hwtrc zso nyuqdc aha +mkzf cat tkjprc izxdggf obspan lmlbg bsyspf twox +lfmfrd ooclx tcl clt +dxvnyd nxwojj arutn eyqocj swzao tmh juvpezm +teu eman rlmdmk xkbodv fvrcm zorgy wmwe +hmo fdayx duciqf cgt duciqf +imjnv vfmsha cyrusow xjswoq nclrmjy sjxowq ynjrcml +rwbsay alsi bmzpvw ozq aduui nihwx glwdiz ixmkgfx +vtjzc ntkh zekj qrbkjhn zekj lyfnbg +afaig jqhli oie lhwyduh kqfnraz nfrzaqk mayfg iljqh +inb zum zmu dnl zjxg vrdziq ypdnsvt +uhbzmre mpdxm alkbmsq aopjmkl mqxenry ayvkrf zxvs qkfqva +fimjr ccv cnug crdsv +bqyve lhxdj ydu qbyve vihwjr vyodhc +vmng dyttyf noagpji tdtyfy ewiest ogg +kgscfj klmsv vmksl vmlks +qlvh veo wruft wtm fbrlvjr evo wvwmny dhp bvrlrfj lvt vgzuyyw +mxuro orxmu tivu tjdq ojjvju cdd +kjexme gxbysxp yxrum hinrklv fxehytd qkt tqk umryx nim +kywnux wab tzrft dsaz jgwuw dubarmi fle wjguvr umjp uzncwj mzz +qokwh zrda xywufk tbxhhj eejqaoa hwoqk zer hwt hbjxth xyf hmh +eregs qdx tdequa agrlrg mwwpba qjie yrjvhr txujk +iyot fxwdcb zvwfv vfzwv wvkw ncwbr wdejrr ltcdza +waix eza znmonya ldfghws ialwfvc dey ubsz uhbnh svgekg nonzyam +bryz tfbqn xznfmw xiplgww wwxigpl jxzcgxl rzyb +cqvl rrcoqxs staeuqr hzzow cwv tsvol dio coc ddavii uuojy +txbn qvkkyh gbqnjtq ndpkqr srt bkpqfmm ytycev ypcv bpqmmfk +uqkjmul dour zgq ztango yrrjhrg ufxnmuw +ekxbcv vkxbec xbcevk jiq bar +wczff qdu cwffz hhk wlvyg +zjlconc osgsro dajzo hqih ehml +hnio shccluw cpu ivaby tormn vkef abv vkef ivaby +xgbdeso xiizs omqwy sbtnnt khago evviclw xyu dtvg wsyxfuc humewp +cnzu bia vdyqrf wwb qveum hmh ouupgc owli +pjpmfxa dvd lxgh ndy gwph oebfkqv vtlxdg efl ekj dyn +mvan nmdkc ucyshia mavn ecst poo +oybm pjwm bmyo wovgu xykziaq obmy eiirhqd +xkvomx yxvv oxxpth elh vxvy lhe ycn +okxglw gmaangx gnxaamg yduzrr nzwxtnd rcxcu xjjvno yat cin gaxnamg yss +oicgs rrol zvnbna rrol +abb edpnxuo peoudxn bab ceay +ncpkfz gvwunb fckpzn caafx pkcfzn tsfl +fnrt ymenkpq wodubcm niv nvi ziluu cuowbdm zocg pdakwt mlzxkex nuxqclo +uouxcgl stgua otadr ideannq wizxunv iqsdpj mxddt ldst ucxogul +rbrwyhk wqoz zqwo ikwgexl atpu iza +smo yolp pcahlu muljxkq cbkljmz zlbcmkj zvbmgz eaiv ncv zplifm yplo +ocutdhz zmnaap llgv llzpl loavju guzkfq saay rxyhng cwxzx lcv anrnzs +etyzx tcm upxrtvd imyoiu rdpj fed dmm +gonqa szteh szteh razdqh phyff upf knfqfaf knfqfaf fpsgl kakag +mcju mixskop isrwat lcr nfyi lcr aaevr nfyi pqrbk gnful +xfmr fkmnq fbnhd mxrf litniid xbae frxm zcenf +yuh lzojtj rqsh hyu +vbjgql yeshsuv lokt efqota wpwjfu ykyq rxc fxxh ycqfkk gndts vdf +wnylmr kkuruxm azr xukrkum dohkwx dmdb +bjiyrwf dvf fdv vdf gnokekr +jsaq hcww iayqtu llv gdpxdrd hwlo nosjit wpm lcab fcgwr +fxjp bys nnf xzllckh bys hvojw zcwtgwz wye ccyvjv +grafa hbb ghk wkdpsf ufa uoqmysd +yvacf kssbff iovrm mvrio cfbpb avh zzje +gqd qmsen wkvrfz vhtsa zrwfkv gul zkvwrf +hrbi svaogb aogsvb bgrk hibr jbtkr +ljl ryc mrewrge yky +fcqyymt emk qcmyytf mcfvusb luy qany cbsvumf +oknt mcozuc ccmuoz uoccmz +uziil xobutwf acnof iqgwl diso +sekq fxbtsuv ddnnqg rnemlt dngnqd hhgjfus stxvubf +lajcp qgiw fyz blrlcd pviwv buh wnkk +wolqfk nvpapfc rwcqxfz xobno yzjfz irpj wolqfk wbnwjt +vmabj noiljne hhqf holxkbk swwzx ylgj lnmxy lqodhk abjvm bmsrf +bpnp yrz pjepxxs jlmhuy vihlx zacm inuazhc xsxjepp +tryl kryh eonvaad ucevssk umkxg lqej nswopjj svkeucs bmh stosxxz +cfdwd dmfdrvm ibuhsz nwtgmb pjt dmfdrvm cqdcm fzjjz afa ibuhsz +erwp abn jwx ynmkkj rhgg abn epd atqhs rst rhgg +jtnp cegdsoy gfuvfbg gdmn ahlsc +jgrp diu jrgp onjnml nojmnl vxockc +lakqyuw khq dcpiwt ykwlqua hkq plklx ujbckec hjcvur jnp pvyf +usuvoo jkih ylafyy yhio jureyj +uazisdf cnwlfnf ewodatr woaddkd wbla qmn atdrowe +bnyepaa ntqh xppe ydtsw ppex +yewjwsp jxylmtk ijese ewry ijese kbja nfml zeuwcsh juimz +qbvmf nca zsfreo uurgaiz twe fbqmv ncwi etdcsk atowfp +jeotslx kgdpzp wxlcww pdd dcn ddp +macllv ldl kyluine lbt hbxbr wxcaspp ezwvc qxkeu +ivg gxv zsf ucr uff yrz +tdlwbny bqlrlz tbynwdl lwtbdny +tnekq pdaievs ttwpfh xfm fcaa +zqqhl zbf fbz uqrv bfz ffwavhk foccg +vcw ebqdd cwv eddbq nrmq +hpiusz sizphu xzq sgyehk wgagkv hsygek +vagkxa iou frqdnnr ipcg uxvh vvh eskf katgpiq aqktigp gzvseyi +xkwgd kzfxk pgdy fmtvq ngf rshx zti pamviob ely knz +hwo rteohu qzwoe rotuhe wzb +bsqgg tid dti gtats dit +sjtux djwxv dljwjq xwvjd xnqfvx veqdrtl uxtsj nnkjn wnhilaf unirrp +fruuqjk gtote gooklg bzwhim zfnccmm ezipnf cxwdxa wfu fdca +zcyxb byzxc cxbyz pgcqco ivlxz +wrjh zfdinsf ihw xwosiah hdg xpiabno bilyy azdeczg javuwa +rinlv dcpt qhencba mmb njxw gadc +qwcpua qzyzt cxjsgh kumh byiimas qhsgf qytzz rqqruwp ismyiba xydcxz rwkscqa +xbzefi hltca ibzxfe fkx xizbfe wvaynts +oyuce vzk ouxvj gfh efgbv ubc nyb bxnbhd mtwboe whksy ovmrt +ljrebp tacn bpjler utphw wmfw rcnha +drdnic eyodes rcnidd yseeod +umxmsf kfroz ukhjin awpnnnu ooyyohh tuv rafano jze +bakz lfzpjyg gfkqcgn kzh zwpvk gqfngck +jpaony ojpnya hmro xaaz tovary aaxz iel pbg +swvbgc bbhjp yvrcddd rhj clfu eao afrkegn qvvb yvcx nxjmdo rcvtx +conbjy jeqtri wvujt jeqtri rkhllgw tsdt zowreo qxr qbpragn kuzmplw wvujt +jrpxyp hchljy rkowqb eeaf ltllebb gtksrwx iazx vnsfmc zzrxw hlcjyh +piehb cjdzt eqn kuje rls oaewoz lrqwt lcrrq +hdjowxv uknhlv hluknv pokxg +txiqxfr fyyp pyyf xfxtrqi tvm rtvby cfx trx nwrf kqrxtat alwot +wdaadr stexpow ardawd uejqxc +wwgwjel wwgwjel mtjt wwgwjel +mczx uua lgceb dqru vkcea tcet ruz +jkt yroojr qdrtdu wze ovwz fdmqnr xxsyfd kchytwl hctlkwy gyd +eif irnrce iamhxgh bmis uxye azrwdi sznv yuowb vdlqqxu +dxdjyj hngqwzs yhwku qhsctfe rhbc rchb tqhcfse +fxyxnzs qtxevin rvtxtc iqnxtve +zgbpk mwzxx bgpkz wkpkn +rjiym iub lcyw agbtlb bzhx osv rbtf +emmyu uoflio tinih skpqaj rbor gezbhhv ine mij qlqte uuj ycns +owmwc uhxv pyho ftjh jzsg blqn bszyo bob trbycy mkru +mwgz bbqsmpp fgzs bihhg bbn pjxxexs qrqmt htsxfwo qltqp vqqaxi +lpr wcvy sxjqq ltd rftdgv pdnog ymu +qhcos shuy icdhucu lrikh rwslv yxbgibl rcomhn wakirz +civdmee owlzocl vedecim rogmjnn pix pohcmk dsjm yworm +vzdpxp lvt inufv yofqt omm qfoty qrlseqy amkt kjcvg vgkjc +huhq quhh levzsws sjuun ofgqr cjhp nfxbbft rnt wtbd tbzab +tjftkx xpfcv hvftvhw lpypbjg batrn fhwhtvv uthl arbtn brb sthv +ogr uyuxdco bpjgir edztxv sxtgu jzfmx ihnauz zwegqkr kvkw +mhxthf pervvn gshy jig ezjteq ckkcpy gww +tiljyki rpe prcojy tjkylii moxu +pjsdqc lgqydfd lohck emrtejw axwmo wuuv rfi qzyncmw gjijdfb bljfd xrs +ywjab gynzi relf kziy xmsby izyk ocwoho kqnyh bwayj +bhjlz uonz jhmzuq eiajoos zjnbj tomj bmyv hjlbz fgw jjbnz +kszz xzw xzw prtznyb +ghzk vxhwt thxwv slwpayp qxegmi dawdwo kgzh +ibpcvuf wnuwxu sbf jsj bfjynl cdp jbylnf +epaxr vfhf hvff azepadz pwf sbo pgfzya hslyo rqqj rmklw hwtta +yyolko pwbvxvg xdwl yfje hftep kzzsr kho jeyf yvslxpw kfyv +xmk juyjxy eqno mdwklum reg dgn cirh wmxfyj bnxlgo dlobk +oyv gshqyot jgcqe dsf gyohqst gqgeojo egoogjq dmqpyp +sypianq yss lmhu ulmh itilh ndkda lhiit +qbxxl bxxql ikald nfap qixwbqq +jtqhqty ljysnl nwoj toa bmmyj pal +ahktew sxody nkvsf pbxyt baws wgwfwej bevgzm jus hcvajfy kzrb jwgwewf +jzsb szbj ujngwf nfuuf lfiuxdu uufnf orsy +vgo hto isstyul gau wsmxoqw +uxw itwf epaw hec wape hemol rpwyosc xzxmrll eetz zui kagca +mjncux muv rygdeis rygdeis +qgkqjvf iprzibd fkvqqgj llcrl vbh vlf lllrc zwrunt +dslsa wvoex eqbwj tjem gbx ayn xcan fnacl xggxon gnwjlh +yzosv hcxjiz yvon gcgd +bixpny ecln sda eymt bjiwk +rlcad lrdca adoqfzs rgty mds pwb kmwj +wkai pmryffq rrdmodc wgyx taz yxwg nkap +auynzwc vzg uapdv qkrh +ldmuysp oyu kpn ejbl mfifa bzs hwyn brlw qpzqx uyilao ysdumpl +czoxoj pwnultl wezolbw lyk aonesgb +nqy nhb nle yycp lgtbo ojf dytwyh ufa +rwr eph obg peh pejret prjtee ovgz +vdqf vdqf ycjrg ovzl lelbe vdqf +gvagdqm gvdgqam dmb zaxe nepzwn +emwh bkkbgec qwdgk mhvfsrf wmdfpp ekzuua +mbqw lgkyazt ckyhvnq uladwo owt +qwiwd pbo tkjoqda zapo dygqopv zzdlwfn +qty dhb iinncba ytq kvh idgoevt chx waq +ulffsvk vplsz ulffsvk uxsh cpwgxd ikgcacx nrirke uowcjvn +gknmxr grkxnm fco dilyyj grmxkn +saqxkh uhue nvu fef xsuxq ekyyoc bcaavd +qltwqa vrmpv vhra nof yprauc vkreojm eaq igiy mec +wvheiyg uthy gpvcs nhnjrne mqaejr tfnsly zfbhn entcc nystfl cpq +zxv jzk dwsjgrd gqqxhp xqxu naunwc yeh qzpkz awcnnu aoosa icadax +vpmqmg qmvpgm tqs mvpqmg +inehzu zwxeoy jxia fcyzxc hwikd +bzwnp kamsen ajpn kdls bzh xqcb bzwnp cmjnfa wmgx +hbuhc qgvhxy smzkxh zzebox hbcuh net wyrdppc yvgxqh +oeum oemu iyags xaipdi euom +tqljgoq ghtdhw xhnni lux qltojqg lki zxztda pcqjif acpzvwy +ydijaq kbyjxpu onyd hsfgz geqvbg +rwoih xog dtbzyr ryzbdt tdbyzr +vcdxf zosw pardxfz bmb mscmain lwfc jvq hbszcqh fxomsmm ahnugx +zutsemg pqzil ddv nsstz gmeuzst bedvy xkzzjpw xlqbd +xxf ltnnu yeb hbml agj meovtjr qrul kexerkw xxf +tqrpd hhcx bmdv nlmr pnu pajdtc rpatqi yekedx oeiuew epsshog +ttbfpv plairk toh jagfsg njnqpa tmwh vwqp irtxv +vdky uwc tkkkztp vdky vdky qlcw lza +rzie yundymy pwgx wtwtbg kpiw mewnb liveysj uvsbn +jgfvyny hacg pzra arpz uowswu puzsfu hoe heo vrq naup +hqv vrl uko qgpikho lligvxa wdld qgpikho +whvby yomxwj dieffc jkprinh dsaqy yfrnba woyq yexeb mjn cbszn xeswvvo +wowtgu rciyg rlas bra quyfec ihe thuu asxhscu bsbdpbi ogxosu +vydsaet tvnkjq piedkzj foeiqz zqivt iatsju tjnqvk drauaf vqitz invoz +cppn jqzw zmxr qksuas iifmjg xtkgf cppn cppn jpsd +nkifpsq cxdx bokxhm ebww kghagrp bofhrl grc cheuzyj +ibgrlvm hrcx jjuoh ipmt +hcoqkh fzt rgravb cimauj jxjq blct qhc vjxw pqpg qzp +jycxz xcv czxjy vxc +liljaur cgmg neldxb xfummcq yfhiukd dnqhl iolxn cmewhb +hpvoihj fkwokod txy uuktw vmqqb dpldzh yxmcay cyaxmy xycaym wekr +ccnaf wuxc ecadb vbgpt ccntf sezo skjdkbf fnctc +hqdtwho kdhyman bjtcjvr bwllva ncyffyr +xprn jrrvmj pdw yvexm ewbflbe eapml rvrmjj xmevy rxyzhf +wjcbpy qdgtcp cfjh muww fhg sgfdleo nelpte yucqa aavev +rci vqypsqt xmg rzii +gramh wwprtc ampdhw dajr +ovrm mdyhpbl mdylbph aykz +cbmo fxs nuugu guunu upt ljjuhjw nituh utp kxqc +rhabal rhabal rhabal vah lfrs +nrq qway ftzp rtjcks mbygdtd hsiqbh wypqb rtjcks cllp hsiqbh +ywa anhcf nvd puqkwg molrwck wsctx xvd molrwck +wox jzq jfen wcvus cswvu oxw irg lmu tpj viahm jesic +qenad neqad smlgi ydwzq ppdemvs ucyuf qtunm eoqx jlgv +sucpl nrdwbl ltvetok npbw ozzw hafyay sjmui sjmui jkqlq pyn pbuopx +nxgaiu ybyl meo kgh saqjaz xhbqr otelcyp vkwc +iqrl ldjlwvl ajhrl dnhutr gkknyqs mcvluet fgyu ogiz cxo aiunl orb +psd cyq xpoyqny yqc kozqh vonfd uhozwz pds hcpw +tvaxder tulwmw qiw avddbmh irog vynjzcc refx efxr emnvk +myjx npqk whm egw kpy igrrohg ukglx ldnuqw caqg ynx fckhnsh +dafv bkdoqg zcqvbco xgikoac cvbqczo +rtzhpwk ukuyp bayhzp upkuy ahbpyz +oarcuv pnlkxvw fqdkj hwzsz nauwl lpufibz vzfbgc unkluxy rwh xuknuyl +vxhsaj ppdxw qrswqtu ulwv uqtqwsr ppxwd +cww cww cww scu +wiiikwa bfpewt zbgxfkl iqpk tpbwfe aazdcxj ipqk icggn fwn fjr +net ovxuwpz yvzmzd yvzmzd +xgar czuhp vuhisaq fgrqxy evvrtf mnmar lsk +hld mxuedug itswju vmmejqx snzslqj toe bbmugph mgubhpb mowj nrjnzu +qbz ouhye hsldmp lcf hyhlrb ewvle zko +cke mupaq quapm eck +owu zdt lales tzd apjjo fhpx bmuktbw dvehpz +libvl zxypk azazc vtsom ohdzycb +kiowxnc scxygrf ckxnwio ycxsrgf +vcjj fqz lfawfx mps zhv qykch vhz psu zud spu fnpvkx +scfvum fuktgk tua ieosetl wwmjtt exnsw wwmttj plvd pfb kku pdbom +wkfw snukd wkfw gyaojdf bjw htagy cdsp +beh gatqxcu ibrooxr ssww orrioxb eenkqz +jlv affah mtbemf tylh aafhf +zqfajd uwzrw csouuip qzadjf +gsnlrw tcel hha tfbzrp ild aenqa +iirfxef kdux yvj vbzgj +ibx pfll rgkp nancij llpf xib gbkfy +uvw kkbavj pznsnk okigtxl ogitxkl eobbs xhaz wroabn ltogxki +bivdf lotvmoh vrb kpaeeue tdab qhukcb qmy kuqf kesu +egs hbsfeu esg twxko uib +ocraimu qilp ijmx eco nhevqp juxf ksejr bcqqau uhpt +pyx jmpglf juokd dxszjw cml vcjge pfg +gxwrt btmimse dkpbha idmz mtignka ngakmti +dpjhm jyalra hukf imocr lkgt rqywn quhe fukh +nbau xyc bdh yni xaawxm cyx xwaaxm akx gyodqe htbifc +bywdxe bfrp rvb rndl onal jghiwb nuta aint qlciwcx +fpic yrqce land soxhci qzc zoebsq hcdohcc fzhcl iyxb dqinum hchdcoc +zok ghgp zok lmk +ozfz zofz dkdekzb sqc +gfti zuqvg cexmtyl qwuqnj stepb erduqhy cuoizcs qudyreh kqvfdd guzqv +jrugz jzugr lmqu jgihgo hjfbz duxkn unxkd +ckiys dbqmi ckiys ckiys +iylp uvvdp pluifaa djo +esxec rwvel djxppqf jymwt ilm aiz upn aiz wrfefwi rwvel +nitgjr pokxuy puhdwg qtxpb veylp zqvzkbd lrvpcgu zuy rnigjt ibci +jboyzq ogcldr hlon ywav jqqtz qjzqt vyaw cok +aqdw jxn hqknh azbylg +jya qpxtmsj hqrtsgg qjtpxsm +pofcs sxw dlvru dlvur swx +yphvvb qqyyfsp sjkbff dqyerxe jxzes oof +pwbya txk bbwsj ywgimd kmdpc bawpy lbnt +bkbazff ldmaq tyfl acqurpy ndnrp +asw ctiv mnxzyc weeuwb gsn bzk irbyhxl cgqomj izy zbk +yrxcrbt bcrryxt pofe wwzl +vuaqez kbtuyai vuaqez dxqud uvo gmhtg dxqud +tpzs gqdxpxo zzpgta uurjx xpqxodg +cil lsv vznqw vro zqzvjhm jhgauzw uxnwk lci zpgpu frjvyzo tsv +zfvcuim gwn gnw dxfppok +btb goof iwadca aac tbb jha uvzi +qah ned ipmure kyta ffhrwe njz paq kaag xmlui +rkmw vrblwyy gpax hxsf zpbza gypuwf jbib ypcjwd vrlybyw +yfjljn uxpvg huik jsnah nkhsg yfjljn lqzsz +hagjlqx agnax jqalxgh rvjgtc mjrmph azznzcq gxajlqh +ipki bhoabp rmiyl dmjyxl zzsmap aju +tyjrr rigrf ciq qic avmwu jtr wpq +vuf cosgytm toycgms ufv qzpcbrs +epzgxr lydrsj ezxrpg expzgr +ecm prj kmak makk jpr +ccwyq txy okj matxa socoa +zrjphq gigayv ywkfmru yrwukmf fxjjrha gqkxx zhjy tisutx kufrywm izjfj igg +lfhgsro gsroflh wrpo lofhgsr +kgkgj wkhnab ubrjaoa ubrjaoa ubrjaoa ggdgh +hztutpn epnqmz ffcroq mnqpez niibpn kdloak xjui ozttj lyzsc pzgq inpnib +kruz sjqp mmd hhdxjgc mauouma asevvo upjwqi hxcgjhd etqzagp +zylf qime cho oraid svytv gqrjufv mker cho vnkyiin tjms +dotjul qyv hnh cibtg gdpauyx wzp +fabtira ejxoeor cqyethv ndjrq hnxn joq otng lrr csytrub +txhgepd fwdaanm nawdamf pxine qqrn pronw exnip qwkimt rvy +kuxzhi jln urzxtw rzu ebsuylm tscru qwlhfgq nnu nuchvz vuht +cqgu camlr umkltcf stx izp rtdwxff wkfvs +jhje cxix lefcrsu nebv idfzhic xqri xkft +utzxb znb ietupd uqgbhje aobip oawjwm hetyan uqtqv hpwzyri kwxyu +jvzvbt xuyvp aegdkb srbw bzabpf lyfriez cruyfu +nhi nih aeb ihn +hcf zypt djcm pkjx pvhh +rhvxcfk exydvk ids hybme hnk yfchvs mjbo meocn +rpboxr rxoprb hdzje zhedj +ziildbo apzvatr vsv isndq ebxyy ntm tdttg wkvdh qnids vkdhw xxolip +ywu uyw ipcjz pjzci xjn kvgk vsocprw +euzo njlpv ndrlhi drlnhi ivmjkb fjrtxta skvgmrd +gbyvj dkck gevpfvb lhadhx rgjcdn yraxh bdk oen vqryd bkr +vgkp hncttxb wgxh gdyjo bbdfzvc xhgw rznzgda yxrrlo gxhw +ifjlb fpecyic svhjp ilmj oxgr svhaf +vbqky lhccj xtmm xzjyykn oqmdq qywir bswly +euxxziv totzer vsxfx leo djho uoeaz edaig fbu lumbi +ooqtwq pvo kid vpo jxin bod btqc fbyuz +jhabi mronu htqqyz umjcbv sgnbp wyn cetmt pcjf +tnrkcyl dduuhxh rylkctn pwj rtynkcl mzzfomr +rxx ldqffi ulappk nltawbn tplhb kyb cqyi +vzkw gviooah vxh xeae ohvcad oaiwcj dkx +sdofdjt hcifv dqws sia mlwm vfich kavh myzue roops mzuye +uxs nlbmjp nlbmjp tlaxa tlaxa +ynnisp twx xtw jgkc yinpns +kumorsm wav xhx bpvz clqc ffmadzl ndny ymslo lobv +ljzabj tqhves mezh pwn wue dwfqq lynvtt boeknvi xqbd pkud tzlanis +lgq qiikzl oihnsr pivtjmu qhic yvmeebg rxu qgl yuxnqse dvu faxqez +ldk mlwja vmdqr yzlxiua amlubt ejmzfx nonm zhkxbn gaqbnqq +ttc ctt kneknx smtnaft abljip tct +uybhbiw zwojzlm cfxoopp abulenj znz zzn opllzmm yufk witwxzp +qvkybwi rdbxb qiuizmo fqgne jgot jxz dqhapn +vzinf ehaley amnk laheye invfz +pedakl ivld agzyhr wmzba tzzzg bazwm wjwgux thrnxkn +cmyhae nwfs nfsw kmh pxkaffq +vdf szupev tyunp qiiu deevxmy wozvtt nelnr kgdexy gparqj hajavz biizn +pwspk skpwp ontbjee pkspw cfbj +ihsmh djxtak wkzllao oyr djxtak prc +uhvihqq jrgf hdfek pdrfpt tghz gthz awae wcygi wujti svq fhedk +gnfhsj odqlt netmsul rviio nkzw nkzw +xyvc clxw cyxv lxcw +duegck pkviu npwsp zdx wpvn dmxgnv ixv fybs xteru +vih kgk hads boaddu daiwo hozoufv nef vtcplc isiw +tzqoo dqlgvno jzlay sywx ecej addt ecej addt mnfcu +ymgmby zegudpx ipsjai ger wcwjw brzebb +eqekxlx itra xekelxq exqkexl +rciu ojaa ircu nxjga puvmwou remgu +sltth pprimb slnxopq avtir hvpv ppww fhfap wisn kzs jcuuuuf +xbppc ydpbq zhjh oym iljzvk vsb +ueye shtps uccehi ccheiu dqm yeeu +gwywf lcpv qza qza gzuovj jfzffyh oybfxqv +aawi ynsvdco azdoz cqr tnyquq xlyvbx eca kcalpes +zumgzhy rou kguqa vubw bwgd qprxcg etnbev nqmi +fyd tuoz uwclqn cgl lrpkf irz dizv nxze clg jghx jbpt +kwuanos eorjr tcahp kwuanos cyrpfji zxayggd kwuanos jkqt qqvbork lizk +vtu ovje vhg ovje vtu zcy hrhtr puawfgv +bliz exp wot svxv epx +jiqgxwj yips hjsatc jgsrno msfp vxvbt bba bqmw xjgpgog +vpvypp ggwp wggp gndp hedpse afji hcqgof +hxueubt hiynoa qqzaj ohb qway +akq nfnes sdrlza nfnes weq +udxpdpx gctuv llhxuow rqtetm hdbnpte oebapv civy oeobu ftgivd pykj +pbgbvn jgmr xrz dfn gosjobw ndf +gnf dtbsnc fwcmml tscdnb fgn qgadusl eifpk +vmnv yuxrup qcphi tanc tnca kjrv cphqi +hclggs sghglc fgplp odn pfglp emkrulf whwtmbs qnuyg +wcxtr ani ain sha hsa zxbkf bzxokat qezo ljqxi xqcwfmd dxo +waiq smpbu dbyka uibxjrg nze wiqa rfpts ddjsjv jqqjez bpusm +lpcxf vsbj owjwc tuqj vkrgrh jsjdepv oil lxrjox frsxsi clr +vzunp prwk nnd rfs vpuzn +pqpqv lvsk sqxf nhobsm hakbn ywj +xxu uxx szqnmi lnwtmx +akq nmlw fupwsth jduvhva +nac wwlxqck hpbce vxxqa fyp xvxqa kxwclqw yvlmv bfwi +pzxjbj nvwv mdooiez vvftp enjrsck iypu uhru fpx omtd +llxgp qwf pwaj cuhb scloot hbcu jgp vjw ooclst +sisd akawvzd wvdzkaa gyoij ikt eeeosb jiwiup +tche vxj sbctqv jvx gosur usgor ibo yqxo qqgd zspl +cidd welisl fxblxqk qxbklfx fbdoqcz glhq iylodvz zvds ghlq +cnsa hrxst mrnkqtj bptq jmi cpbcofs kveyeur uzmga modphm rtx kntqjrm +dvyup usfaq rtghoec bvcos fqsua zohwwg +onf vncybi dlaxni oqyqqkn +okfwa qyyx ebnv llql nphq etdt ytgivlo jwgwz kiob +ann vqnqvpx wth lpwid bjvzw xpwqxcj azg ioeyzzp onwf +smy epzomx xep yid zctvrfj astdj cfg fgc eriuxt +rljqgin wzobzrh cuwtx vcsbx tmg tuysq vxipgho +ewp rsrnsj wgeyin lrji ddgt utol xxwut fjiwopa +upu ftvqbk tfkvbq fdwga rmu puu hbiasjw +cfl lmqkb lfc wbtlfi uqsjs ejgmphi tbliwf nzcela gzb +zop unwmiu acull mkwh hvruknw rfk mmhaz iqmenq fifino +iczua bjut tlgf zicau jtbu +mtka ipd mdifj kps +irqkysw xfsjl tedx yckkbx iktxb sqxn pbfvubv uudzppz +mdrn cihat wcext kufs awwtjok pfjg +wdevt tyo zzbp pqlqq wdevt +yhatqkv ntuhw tdfd buxazh xbcsv bas gkv rbzi tddf jbj bsa +malip hiiy qezz yhii wlfojre +zqnfll bssveq lprwbep bhqml tztbt +npnxotu yupdytb jptqo klfydfe fpucmfq svxcqr unopxnt +gdpz gwj iytiohu efk ctjzf asade abhotq brmhu tbtdur zzksbh +kxft klzslf tjdzciy lzslkf +ejei ezmemvg xlt zte tbwhz dgnfpao zotck wus uaz gbwbb +dgednf vypmbs eiytot empfmny +uopmui uehue wdvzt adpfcif mutl ifaztka vydi xumtz orstno +dleero olxiq gxnlfm nfmxlg wloeavr olhrwg hrjd yicj ymyeex qav gxyjgfq +hevj rqcne zycgb qgqtn rqcne ptfvu yyyu zlm hevj +zrkhuh sttnkt hkuzhr vqtu +ppsfm kcao qjq dgadglx cxaawjn pbucfu fed qgioarc dfe ricoaqg +vmawf oktunea zraoir gkt zraoir jcvkqoq +mqgml ecawug ugwace szwul iwbmooj owmiojb +auggaw cypcuw npci vuyxijd pofswjx vdkrgx xylk rom ksj +qmwx jgsrdj ikva xzxw avik +zzhcqu rbg pywjdn wyndpj zchuqz +wzd wqycftu yldezp zovuy oydia hovewe +kfid qkkk thak qhbf rvzlzvu uuxh pbj hkat gow oeqcw knqqzha +sua itv hfpg bdqye bznlrk hfpg bdqye kvir kaai ggtz jqn +ulggl guitamm tkpckso fupacz otxtqpd jxnqc +ueesb ndyik vjftz jgqqv nrcf +krh dqpmsw fybzynl zhjbvkw exefc rhs neq ldprb bhhvxm pjwirun +ymavl qwxr yavml wagwc ekokrpq zewppw iumcgin cxdvwx +wwdukav kuawvwd kowv dkwvuwa +eazot bil tzu vdwwbm fvauwrq +esq tixokph yspf ztoxfut lgzush pwv swh pwv auqhuu tixokph +pdbeyxi poio mugfkb brwbbx aao uszw fokjeb uswz +sbs ryjr ptispi tvnhu htunv vthnu +czjmg hbdjhvi jrkoy fpgwc syafy aar kvnq eaecsb wqzpx +twtp dvl uvyje qtlzj dsvyr qpjnj eyoigx bhgpccy gwn dtuf +mxit xunctu vbyks wmqc jriuupl ybvks uncutx nsoxwrb ykt prc +yye mgf uhc irowpc dsdv iwaxod ftavlj dxzp tcch tcch mefz +rxe xwrrgl xwrrgl duu rxe xbbgoe +ucsz akswcd ojrmqq cox hgfh lxwu ltnnf cenikcp +opjhdp svwezr svwezr opjhdp +qojlkl ircxqnt utfmdg fcvr vehkcvt ufmzcpv xwlh ddavv xel bwlz fii +rzkayeh iursm zhily hdnq fqydfvt uwoy hptpiqu tdqy bgr xdr +ymruz umzry hbltwya jhwhzk flh tahylbw bdbaimb qscbp ntkuf +uxpato owsqyao vaog oenomkc usrmnc epua vzkppls +qxqczbk qyguz alawj xgjawtw wxtjgwa snfcdmz +fjfgos rmpd mgs vbk dlls jkljao eoovdfb ucdvaoq qmjmqku ney porr +nmcrqz zcoxpk dlnzksd ymh zyg spxss ruyk bychq gsgv eusiuid mnrqcz +jbzadnx lzl sdamer okoico frqisrm lxet agriw +xceoqr qai vahc jjzifsn exg +igjpn wfy ukn aag quro wklsq cjq bgtjrdz gmub wyhh +fzlwnm mygfn vkzwvw zvhsex gfki +ijvzgai ebmeq wssfmbq uguh sfuutm nwkgmex dxael liakdxs rnf sky yowpxc +bjzkyjh fced nji esowk qxsubsk qgtts +nkdgo bbjfq fgnxnhd gfjchl jetdb xubsgj eiju ldlm oxsx znft bbqfj +xovcnob pxfe pmstes yzkdm iqlvha nmcziix fexp ivqalh rxecqps +xpyew xudfud wwqe qhfjlcu epv fnrbgyv ihli qngtx yjlfg ozqbzn esp +timl gcohx vqzic gzm shwlkkv icqzv urchuc +xpqq gaqzwo cci dowahsr gaqzwo +jjsagdl umbpxre kyre zvaryft tmw pxpnjy +aqovcz nunq nnuq xjrvvh autjmit jiatumt +elg lps lge zjjot hwz tmqrup xaxxmo zlbzp uftd fukdad kvpymsm +iokwzal ywti zbdmzbu lprywe wbgbwza ypogbga kzliwao wstqi eqm keaeaj gbabwwz +lwfpk mhufe eddzgd ljxyqy vhzkct uemhf +lwqil fzugdo faq feppo usl llwqi +nje hthr ropq qvcepu bexszfj avmzjvv zajmvvv fhcd xnc cnx qnuaux +kvksn dphbyz nsx wrcc ccrw +nzpa pzzunfv ygzjy gxrrtcj hrt trh pwxpg yifgjmo fnupzzv wbzx +aepti rbojui ypvhe ubojri tcema aan dntkw qjx bfvmyos tcm hvoqytn +qpwq exu jvsiwj gsw avr vbemldy +xsbzpf xbzyvx xax sxh vpxt gccy xxa zhgbwoa hwwxoky fhvdxfc pvtx +pnsa ovtjolz tyutl eyjjzt jvtoolz owbypvr tytlu ewtzgec +cyg dwwk eihsp aeuk bbnay aluwyz hdmv uaek mwt ihpse wjhnkeg +fhzx vjetz vjub tejvz +ewwyb jidhu pyvyenn igtnyd tiwr akwkkbi myz xxjwb jjrdeg +jbkuw kwir rkiw ubwkj +bltffuw lftwufb hhsh wfbtulf nrxaa rlszi toijxnz czlci +bqrm pga zgblgcw pgwhhn lcgzwbg bcgzlgw yqb +mhjj vjoa gnjlc kclcr ito ofksy giavy fpqeioj +bkiqmif izidbui sttxxi bswhkxp sduuw +mjgnvw mjgwnv ojzyuv gvj +qxn kkhc whd fgwk auzugg augzgu kqfov wfgk +spdxbnu xpfofsb bpfsoxf ahjywql spbxoff +bwqxhlm wbqlxmh kqgpl fyzgf guhkvgx ovk qhmp gnrmu wvd wedj +vvwf hcnc vvwsngj qedzoxm hcnc qedzoxm kjthdi cbwqep qtvu +gio iqklmro noqablo bab jiqc rwebyg rqkloim wzmgs uunl amqs iwj +snxj szobqt zcgvwv wiyqknu +uto jteikwd cew gqsks hmvjtcy sach +zpgl qnkoex amhufmr figns upv xezrl rjleak nwrna +pzkvrdz dtonazj gtr gfxucuf lstjl lsjtl rgkope kzpdzrv lyptn zfxjys ttk +ddxgm lumlgki jhv doft kok swy ckds swy ddxgm lbfbdv +qfs rcufzgz iaiqw qfs qfs +nvkbo sgv mquwb ritpye nbkov poex hraorm qrrr qdt qefl +irxannd fiud ehyb ggx plqg pvvn uuptop tcvbm abuf bcfnmw +qwya ukblz epmbfr vmlon yqwa +hlo mmv vmm mvm +svzpxun yugbbe sbbpxs dmy xspbbs zhpovyf fyovhzp cpbt pke +zgk gft zybs zrgcoo ypu bue htgo +xnesq srsx pkzaoh cfqzugh +lntd nvxetbv clykjpd svmibpx evxtvnb yldkpjc +jsqq tzwak hephg eqwczd ioisa yim tmdifn mceip +kuwqz wzkqu zwchmj lfec uexne iztp llityt +kvamkpc pvbryqh ion cwizjde gln kcpvmak pzzlw gnl +ydeqf bfaab sydqhbp smsxdjr pynrs cqymt +onb eiab bno nob +mqslq scnelxv hyllrf scnelxv mqslq wmnbk +pttu kubby lgop bbyuk gsk skg ikktlbb inbyvz +xznvl zwtdj vbxdyd clhw +hgy zudelp ickc drfjgn iyws xhc +zzv wik iorhat qkb kjb lykdz vrce yjsjwj +gyw xzgbi efus uuy +hwcy ujdun bjjuvd jbdvju onnk xeyy mmp onkn qyzl +jwfm ptjwrbl hhuv uolz adyweh qpj wxyogp igvnojq jmfw pqs fsnirby +""".split(separator: "\n") + +extension Collection { + func pairs() -> [(Element, Element)] { + var result: [(Element, Element)] = [] + for index in indices { + let first = self[index] + for second in self[.. Bool { + var words: Set = [] + for word in p.split(separator: " ") { + let (inserted, _) = words.insert(word) + if !inserted { return false } + } + + for (a, b) in words.pairs() where a.count == b.count { + if a.sorted() == b.sorted() { return false } + } + + return true +} + +input.lazy.filter(valid).count + +//: [Next](@next) + diff --git a/2017/Advent1.playground/Pages/Day 5.xcplaygroundpage/Contents.swift b/2017/Advent1.playground/Pages/Day 5.xcplaygroundpage/Contents.swift new file mode 100644 index 0000000..796145a --- /dev/null +++ b/2017/Advent1.playground/Pages/Day 5.xcplaygroundpage/Contents.swift @@ -0,0 +1,1033 @@ +var program = """ +0 +0 +1 +2 +0 +1 +0 +2 +-2 +-6 +0 +-7 +2 +2 +1 +-2 +1 +1 +-11 +-14 +-16 +-14 +-12 +-5 +-2 +-21 +-15 +-9 +0 +-13 +-4 +-19 +-31 +1 +-15 +-1 +-23 +-18 +0 +-18 +-11 +-21 +-6 +2 +-38 +2 +-38 +-40 +-15 +-2 +-23 +-42 +-23 +-36 +-37 +-34 +-26 +-51 +-14 +-8 +-56 +-11 +-14 +-40 +-39 +-26 +-35 +-48 +-52 +-18 +-16 +-11 +-38 +-4 +-70 +-20 +-10 +-37 +-75 +-33 +-39 +-37 +-74 +-17 +-83 +-13 +-75 +-56 +-44 +-40 +-20 +-18 +-74 +-32 +-48 +-11 +-80 +-88 +-33 +-67 +-96 +-67 +-49 +-55 +-101 +-8 +-77 +-33 +-93 +-22 +-21 +-99 +-33 +-12 +-111 +-105 +-77 +-76 +-90 +-63 +-76 +-55 +-65 +-106 +-56 +-93 +-121 +-31 +-86 +-102 +-116 +-120 +-17 +-95 +-110 +-128 +-122 +-135 +-133 +-124 +-50 +-32 +-86 +-11 +-127 +-42 +-9 +-41 +-28 +-93 +-13 +-16 +-8 +-138 +-111 +-103 +-25 +-22 +-133 +-52 +-27 +-6 +-67 +-72 +-115 +-133 +-146 +-46 +-128 +-99 +-115 +-16 +-113 +-105 +1 +-76 +-2 +1 +-66 +-164 +-87 +-8 +-92 +-180 +-137 +-39 +-127 +-124 +-66 +-96 +-185 +-13 +-65 +-178 +-16 +-32 +-24 +-84 +-49 +-7 +-198 +-101 +-119 +-187 +-71 +-125 +-130 +-72 +-130 +-43 +-136 +-171 +-32 +-210 +-69 +-195 +-207 +-197 +-190 +-117 +-196 +-143 +-128 +-155 +-160 +-53 +-205 +-15 +-86 +-227 +-128 +-115 +-58 +-96 +-52 +-100 +-41 +-84 +-61 +-50 +-91 +-158 +-30 +-230 +-125 +-177 +-181 +-47 +-43 +-241 +-52 +-102 +-161 +-16 +-130 +-21 +-22 +-249 +-78 +-101 +-51 +-229 +-148 +-132 +-213 +-264 +-175 +-128 +-102 +-26 +-86 +-84 +-100 +-132 +-228 +-118 +-46 +-77 +-230 +-98 +-193 +-191 +-142 +-193 +-183 +-58 +-59 +-254 +-256 +-108 +-12 +-46 +-11 +-143 +-22 +-121 +-68 +-282 +-94 +-22 +-172 +-246 +-174 +-76 +-3 +-117 +-237 +-258 +-29 +-105 +-32 +-177 +-125 +-70 +-176 +-113 +-152 +-227 +-298 +-199 +-179 +-162 +-241 +-230 +-8 +-202 +-296 +-194 +-82 +-188 +-136 +-24 +-171 +-185 +-272 +-124 +-306 +-230 +-249 +-64 +-139 +-143 +-293 +-218 +-167 +-208 +-254 +-171 +-119 +-82 +-284 +-262 +-252 +-92 +-230 +-193 +-173 +-269 +-173 +-13 +0 +-148 +-151 +-241 +-120 +-20 +-22 +-218 +-6 +-314 +-347 +-58 +-180 +-242 +-333 +-247 +-67 +-137 +-102 +-32 +-102 +-88 +-42 +-284 +-109 +-281 +-43 +-63 +-205 +-268 +-273 +-235 +-119 +-185 +-62 +-56 +-260 +-47 +-353 +-123 +-312 +0 +-76 +-352 +-365 +-284 +-105 +-62 +-165 +-292 +-5 +-46 +-31 +-116 +-147 +-34 +-149 +-79 +-139 +-132 +-84 +-58 +-130 +-125 +-188 +-227 +-2 +-220 +-88 +-96 +-38 +-308 +-214 +-357 +-19 +-410 +-292 +-150 +-151 +1 +-252 +-172 +-414 +-15 +-207 +-184 +-286 +-161 +-55 +-158 +-330 +-53 +-310 +-295 +-248 +-126 +-425 +-10 +-289 +-148 +-146 +-436 +-279 +-48 +-321 +-196 +-162 +-55 +-125 +-62 +-381 +-337 +-85 +-428 +-470 +-180 +-392 +-450 +-376 +-73 +-206 +-115 +-289 +-318 +-22 +-200 +-176 +-410 +-380 +-470 +-418 +-163 +-424 +-288 +-374 +-358 +-386 +-340 +-403 +-81 +-7 +-378 +1 +-320 +-323 +-288 +-439 +-437 +-90 +-159 +-379 +-69 +-236 +-168 +-232 +-232 +-42 +-257 +-437 +-40 +-390 +-241 +-54 +-247 +-76 +-325 +-351 +-259 +-328 +-283 +-5 +-169 +-114 +-252 +-131 +-223 +-446 +-482 +-7 +-285 +-486 +-260 +-421 +-498 +-32 +-182 +-317 +-201 +-370 +-518 +-129 +-359 +-67 +-209 +-541 +-323 +-132 +-197 +-70 +-171 +-258 +-372 +-228 +-4 +-360 +-144 +-307 +-226 +-533 +-435 +-318 +-284 +-284 +-150 +-539 +-46 +-81 +-144 +-188 +-264 +-136 +-138 +-106 +-65 +-262 +-250 +-176 +-261 +-112 +-227 +-304 +-159 +-425 +-117 +-441 +-111 +-468 +-2 +-84 +-197 +1 +-575 +-305 +-401 +-114 +-143 +-180 +-16 +-450 +-24 +-357 +-104 +-434 +-435 +-345 +-247 +-484 +-282 +-263 +-389 +-463 +-178 +-144 +-256 +-94 +-522 +-302 +-524 +-309 +-275 +-350 +-596 +-462 +-317 +-543 +-8 +-374 +-404 +-302 +-610 +-111 +-358 +2 +-353 +-397 +-165 +-324 +-574 +-618 +-168 +-636 +-389 +-609 +-54 +-121 +-256 +-604 +-588 +-454 +-100 +-212 +-65 +-300 +-592 +-43 +-230 +-652 +-638 +-67 +-499 +-614 +-419 +-577 +-96 +-257 +-519 +-458 +-14 +-26 +-370 +-187 +-319 +-528 +-436 +-87 +-673 +-535 +-473 +-670 +-594 +-589 +-629 +-180 +-13 +-668 +-369 +-679 +-587 +-624 +-123 +-363 +-241 +-343 +-259 +-123 +-319 +-608 +-470 +-336 +-291 +-676 +-535 +-226 +-11 +-224 +-43 +-30 +-605 +-670 +-544 +-248 +-609 +-144 +-328 +-177 +-360 +-628 +-51 +-724 +-407 +-625 +-433 +-192 +-455 +-603 +-581 +-33 +-696 +-160 +-464 +-510 +-3 +-144 +-113 +-87 +-519 +-263 +-161 +-94 +-716 +-484 +-509 +-615 +-373 +-734 +-686 +-732 +-395 +-163 +-432 +-26 +-716 +-599 +-596 +-648 +-91 +-716 +-540 +-429 +-456 +-744 +-344 +-298 +-689 +-428 +-119 +-323 +-196 +-41 +-602 +-724 +-413 +-444 +-614 +-331 +-697 +-115 +-7 +-409 +-272 +-672 +-224 +-732 +-203 +-37 +-397 +-794 +-161 +-512 +-664 +-193 +-245 +-490 +-439 +-696 +-661 +-717 +-424 +-308 +-481 +-215 +-658 +-705 +-389 +-90 +-619 +-297 +-670 +-125 +-119 +-268 +-553 +-227 +-733 +-142 +-333 +-52 +-609 +-795 +-422 +-202 +-579 +-397 +-431 +-561 +-140 +-467 +-688 +-486 +-493 +-279 +-457 +-295 +-181 +-823 +-808 +-495 +-620 +-652 +-80 +-22 +-26 +-769 +0 +-439 +-31 +-458 +-5 +-221 +-675 +-443 +-809 +-845 +-234 +-429 +-425 +-754 +-820 +-442 +-561 +-513 +-462 +-840 +-596 +-113 +-736 +-12 +-123 +-747 +-735 +-732 +-209 +-478 +-504 +-784 +-522 +-257 +-695 +-676 +-331 +-767 +-801 +-128 +-571 +-683 +-757 +-475 +-749 +-53 +-366 +-795 +-562 +-632 +-284 +-488 +-692 +-368 +-883 +-542 +-745 +-10 +-693 +-752 +-136 +-736 +-347 +-855 +-521 +-151 +-324 +-126 +-678 +-28 +-875 +-832 +-474 +-657 +-569 +-518 +-642 +-351 +-850 +-45 +-383 +-362 +-655 +-590 +-184 +-543 +-563 +-631 +-165 +-607 +-732 +-450 +-219 +-774 +-461 +-823 +-651 +-48 +-750 +-246 +-341 +-805 +-620 +-425 +-696 +-874 +-502 +-186 +-143 +-77 +-452 +-710 +-103 +-836 +-824 +-775 +-108 +-823 +-937 +-969 +-392 +-17 +-725 +-226 +-441 +-489 +-669 +-665 +-182 +-625 +-905 +-523 +-925 +-573 +-821 +-786 +-734 +-21 +-819 +-181 +-342 +-625 +-12 +-705 +-275 +-756 +-79 +""".split(separator: "\n").map { Int($0)! } + + +func run(program: [Int], updateInstruction: (inout Int) -> Void) -> Int { + var currentIndex = 0 + var steps = 0 + var program = program + + while program.indices.contains(currentIndex) { + let current = program[currentIndex] + updateInstruction(&program[currentIndex]) + currentIndex += current + steps += 1 + } + + return steps +} + + +let part1 = run(program: program) { + $0 += 1 +} +print(part1) + +let part2 = run(program: program) { + if $0 >= 3 { + $0 -= 1 + } else { + $0 += 1 + } +} +print(part2) diff --git a/2017/Advent1.playground/contents.xcplayground b/2017/Advent1.playground/contents.xcplayground new file mode 100644 index 0000000..aca7863 --- /dev/null +++ b/2017/Advent1.playground/contents.xcplayground @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/2017/Advent1.playground/playground.xcworkspace/contents.xcworkspacedata b/2017/Advent1.playground/playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/2017/Advent1.playground/playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + +