From 514530d6be7cc5067a95a11ebedff9e0d4d46cfe Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 10 Jun 2024 06:56:06 +0100 Subject: - Added template for week 273. --- challenge-273/0rir/README | 2 + challenge-273/2colours/README | 1 + challenge-273/3ter/README | 1 + challenge-273/LoneWolfiNTj/README | 1 + challenge-273/aaron-rowe/README | 1 + challenge-273/aaron-sherman/README | 1 + challenge-273/aaronreidsmith/README | 1 + challenge-273/abigail/README.md | 1 + challenge-273/adam-russell/.gitignore | 3 + challenge-273/adam-russell/README | 1 + challenge-273/adherzog/README | 1 + challenge-273/adriaandens/README | 1 + challenge-273/aecepoglu/README | 3 + challenge-273/ailbhe-tweedie/README | 1 + challenge-273/alex-daniel/README | 1 + challenge-273/alexander-karelas/README | 1 + challenge-273/alexander-pankoff/README | 1 + challenge-273/alicia-bielsa/README | 1 + challenge-273/andinus/README | 69 +++++ challenge-273/andreas-voegele/README | 1 + challenge-273/andrezgz/README | 1 + challenge-273/anton-fedotov/README | 1 + challenge-273/antonio-gamiz/README | 1 + challenge-273/ap29600/README | 1 + challenge-273/archargelod/README | 1 + challenge-273/arne-sommer/README | 1 + challenge-273/arpad-toth/README | 1 + challenge-273/ash/README | 1 + challenge-273/asherbhs/README | 1 + challenge-273/asherbhs/hy/.gitignore | 1 + challenge-273/athanasius/README | 1 + challenge-273/atschneid/README.md | 281 +++++++++++++++++++++ challenge-273/aubrey-quarcoo/README | 1 + challenge-273/augiedb/README | 1 + challenge-273/aut0exec/README | 1 + challenge-273/avery-adams/README | 1 + challenge-273/aviral-goel/README | 1 + challenge-273/barroff/README | 1 + challenge-273/baryshevs/README | 1 + challenge-273/bejoy-mathews/README | 1 + challenge-273/belmark-caday/README | 1 + challenge-273/ben-davies/README.md | 1 + challenge-273/bhat_gurunandan/README | 1 + challenge-273/bill-palmer/README | 1 + challenge-273/bkb/README | 1 + challenge-273/bn-ssotka/README | 2 + challenge-273/bob-kleemann/README | 1 + challenge-273/bob-lied/README | 4 + challenge-273/brtastic/README | 1 + challenge-273/brtastic/c/.gitignore | 2 + challenge-273/brtastic/pascal/.gitignore | 3 + challenge-273/bruce-gray/README | 1 + challenge-273/bruno-ramos/README | 1 + challenge-273/brxfork/README | 1 + challenge-273/burkhard-nickels/README | 1 + challenge-273/bwva/README | 1 + challenge-273/carlos-oliveira/README | 1 + challenge-273/chazzka/README | 1 + challenge-273/cheok-yin-fung/README | 1 + challenge-273/chicagoist/README.md | 1 + challenge-273/christian-jaeger/README | 1 + challenge-273/clifton-wood/README | 1 + challenge-273/cliveholloway/README | 1 + challenge-273/colin-crain/README | 1 + challenge-273/conor-hoekstra/README | 1 + challenge-273/craig/README | 1 + challenge-273/creewick/README | 1 + challenge-273/cristian-heredia/README | 1 + challenge-273/cybersnyder/README | 1 + challenge-273/dan-friedman/README | 1 + challenge-273/daniel-aberger/README | 2 + challenge-273/daniel-mantovani/README | 1 + challenge-273/daniel-mita/README | 1 + challenge-273/daniel-pfeiffer/README | 1 + challenge-273/dario-mazzeo/README | 1 + challenge-273/darren-bottin/README | 1 + challenge-273/dave-cross/README | 1 + challenge-273/dave-jacoby/README | 1 + challenge-273/david-kayal/README | 1 + challenge-273/david-santiago/README | 1 + challenge-273/ddobbelaere/README | 1 + challenge-273/deadmarshal/README | 1 + challenge-273/demerphq/README | 1 + challenge-273/demerphq/js/.gitignore | 2 + challenge-273/denis-yurashku/README | 1 + challenge-273/dms061/readme | 8 + challenge-273/donald-hunter/README | 1 + challenge-273/doug-schrag/README | 1 + challenge-273/dracos/README | 1 + challenge-273/duane-powell/README | 1 + challenge-273/duncan-c-white/C/.cbuild | 5 + challenge-273/duncan-c-white/README | 76 ++++++ challenge-273/e-choroba/README | 1 + challenge-273/ealvar3z/README | 1 + challenge-273/eddy-hs/README | 1 + challenge-273/eric-cheung/README | 1 + challenge-273/fabrizio-poggi/README | 1 + challenge-273/feng-chang/README.md | 2 + challenge-273/finanalyst/README | 1 + challenge-273/finley/README | 1 + challenge-273/fjwhittle/README | 1 + challenge-273/frankivo/README | 1 + challenge-273/fred-zinn/README | 1 + challenge-273/freddie-b/README | 1 + challenge-273/garrett-goebel/README | 1 + challenge-273/giuseppe-terlizzi/README | 1 + challenge-273/gugod/README | 1 + challenge-273/gugod/rust/.gitignore | 2 + challenge-273/guillermo-ramos/README | 1 + challenge-273/gustavo-chaves/README | 1 + challenge-273/habere-et-dispetire/README | 1 + challenge-273/happy-barney/README | 1 + challenge-273/hatorikibble/README | 1 + challenge-273/hauke-d/README | 1 + challenge-273/henry-wong/README | 1 + challenge-273/hstejas/README | 1 + challenge-273/iangoodnight/README.md | 1 + challenge-273/ianrifkin/README.md | 225 +++++++++++++++++ challenge-273/izem/README | 1 + challenge-273/izifresh/README | 1 + challenge-273/jacques-guinnebault/README | 1 + challenge-273/jaguart/README.md | 6 + challenge-273/jaime/README | 59 +++++ challenge-273/jake/README | 1 + challenge-273/jaldhar-h-vyas/README | 1 + challenge-273/james-marquis/README | 1 + challenge-273/james-raspass/README | 1 + challenge-273/james-smith/README.md | 1 + challenge-273/jan-perl/README | 1 + challenge-273/jaredor/README | 1 + challenge-273/jason-messer/README | 1 + challenge-273/javier-luque/README | 1 + challenge-273/jbourlakos/README | 1 + challenge-273/jcrosswh/README | 1 + challenge-273/jdos22/README | 1 + challenge-273/jeanluc2020/README | 1 + challenge-273/jeff/README | 1 + challenge-273/jeongoon/.gitignore | 5 + challenge-273/jeongoon/README | 1 + challenge-273/jeremy-carman/README | 1 + challenge-273/jim-bacon/README | 1 + challenge-273/jitu-keshwani/README | 1 + challenge-273/jj-merelo/README | 1 + challenge-273/jluis/README | 1 + challenge-273/jo-37/README | 1 + challenge-273/jo-christian-oterhals/README | 1 + challenge-273/joaofel/README | 1 + challenge-273/joe-tym/README | 1 + challenge-273/joelle-maslak/README | 1 + challenge-273/john-barrett/README | 1 + challenge-273/john-horner/README | 1 + challenge-273/jokraft/README | 1 + challenge-273/juan-caballero/README | 1 + challenge-273/julien-fiegehenn/README | 1 + challenge-273/julien-fiegehenn/perl/.gitignore | 1 + .../julien-fiegehenn/typescript/.gitignore | 3 + challenge-273/julien-fiegehenn/typescript/.nvmrc | 1 + challenge-273/juliodcs/README | 1 + challenge-273/kai-burgdorf/README.md | 1 + challenge-273/kaushik-tunuguntla/README | 1 + challenge-273/kevin-colyer/README | 3 + challenge-273/khalid-anwar/README | 1 + challenge-273/khalid/README | 1 + challenge-273/kian-meng-ang/README | 1 + challenge-273/kiran-kumar/README | 1 + challenge-273/kivanc-yazan/.gitignore | 2 + challenge-273/kivanc-yazan/README | 1 + challenge-273/kjetillll/README | 1 + challenge-273/kordaff/README | 1 + challenge-273/kostas-giannakakis/README | 1 + challenge-273/kueppo-wesley/README | 1 + challenge-273/kurkale6ka/README | 1 + challenge-273/lacek96/README | 1 + challenge-273/lance-wicks/README | 1 + challenge-273/lars-balker/README | 1 + challenge-273/lars-thegler/README | 1 + challenge-273/laurent-rosenfeld/README | 1 + challenge-273/leoltron/README | 1 + challenge-273/librasteve/README | 1 + challenge-273/lubos-kolouch/README | 1 + challenge-273/luc65r/README | 1 + challenge-273/luca-ferrari/pljava/pom.xml | 72 ++++++ challenge-273/luiz-felipe/README | 1 + challenge-273/macy-ty/README | 1 + challenge-273/magnus-woldrich/README | 1 + challenge-273/manfredi/README | 1 + challenge-273/mano-chandar/README | 1 + challenge-273/mark-anderson/README | 1 + challenge-273/mark-senn/README | 1 + challenge-273/markjreed/README | 6 + challenge-273/markus-holzer/README | 1 + challenge-273/martin-barth/README | 1 + challenge-273/martin-mugeni/README | 1 + challenge-273/massa/README | 1 + challenge-273/mathmauney/README | 1 + challenge-273/matt-latusek/README | 1 + challenge-273/matthew-persico/README | 1 + challenge-273/matthias-muth/README.md | 157 ++++++++++++ challenge-273/mattneleigh/README | 1 + challenge-273/mauke/README | 1 + challenge-273/maxim-kolodyazhny/README | 1 + challenge-273/maxim-nechaev/README | 1 + challenge-273/memark/README | 1 + challenge-273/michael-hamlin/README | 5 + challenge-273/michael-schaap/README | 1 + challenge-273/mihail-iosilevitch/README | 1 + challenge-273/mike-accardo/README | 1 + challenge-273/mimosinnet/README | 1 + challenge-273/mohammad-anwar/README | 1 + challenge-273/morayj/README | 1 + challenge-273/ndelucca/README | 1 + challenge-273/neil-bowers/README | 1 + challenge-273/nelo-tovar/README.md | 1 + challenge-273/nick-logan/README | 1 + challenge-273/nicolas-mendoza/README | 2 + challenge-273/nikhil-prasanna/README | 1 + challenge-273/noud/README | 1 + challenge-273/nunovieira220/README | 1 + challenge-273/ohmycloud/README | 1 + challenge-273/oleksii-tsvietnov/README | 1 + challenge-273/oliver-oviedo/README | 1 + challenge-273/olivier-delouya/README | 1 + challenge-273/olli-antti/README | 1 + challenge-273/orestis-zekai/README | 1 + challenge-273/ozzy/README | 1 + challenge-273/p6steve/README | 1 + challenge-273/pablo-saavedra/README | 1 + challenge-273/packy-anderson/README.md | 25 ++ challenge-273/paul-fajman/README | 1 + challenge-273/paulo-custodio/README | 1 + challenge-273/pavel-jurca/README | 1 + challenge-273/pavel-starikov/README | 1 + challenge-273/pavel_kuptsov/README | 2 + challenge-273/perlboy1967/README | 1 + challenge-273/pete-houston/README | 1 + challenge-273/pete-sergeant/README | 1 + challenge-273/peter-campbell-smith/README | 1 + challenge-273/peter-meszaros/README | 1 + challenge-273/peter-scott/README | 1 + challenge-273/petr-roubicek/README | 1 + challenge-273/philippe-bruhat/README | 1 + challenge-273/phillip-harris/README | 1 + challenge-273/pip/README | 1 + challenge-273/pjdurai/README | 1 + challenge-273/pkmnx/README | 1 + challenge-273/plis-acm/.gitignore | 1 + challenge-273/plis-acm/README | 1 + challenge-273/pokgopun/README | 1 + challenge-273/polettix/README | 1 + challenge-273/polettix/perl/.gitignore | 1 + challenge-273/polettix/raku/.leaveme | 0 challenge-273/prajith-p/README | 1 + challenge-273/princy-perl/README | 1 + challenge-273/probablyfine/README.md | 1 + challenge-273/rage311/README | 1 + challenge-273/rakulius/README | 1 + challenge-273/randy-lauen/README | 1 + challenge-273/rawleyfowler/README.md | 5 + challenge-273/razetime/README | 1 + challenge-273/rcmlz/README | 1 + challenge-273/reinier-maliepaard/README | 1 + challenge-273/ribtips/README | 1 + challenge-273/richard-park/README | 1 + challenge-273/rick-bychowski/README | 1 + challenge-273/rnuttall/README | 1 + challenge-273/rob-van-dam/README | 1 + challenge-273/rob4t/README | 1 + challenge-273/robbie-hatley/README | 1 + challenge-273/robert-dicicco/README | 1 + challenge-273/robert-mcintosh/README | 1 + challenge-273/roger-bell-west/README | 1 + challenge-273/rozcovo/README | 1 + challenge-273/ruben-westerberg/README | 9 + challenge-273/ryan-thompson/README.md | 15 ++ challenge-273/saiftynet/README | 1 + challenge-273/samir-parikh/README | 1 + challenge-273/sangeet-kar/README | 1 + challenge-273/santiago-leyva/README | 1 + challenge-273/sean-meininger/README | 1 + challenge-273/sergiotarxz/README | 1 + challenge-273/sgreen/README.md | 3 + challenge-273/shahed-nooshmand/README | 1 + challenge-273/shardiwal/README | 1 + challenge-273/shaun-pearce/README | 1 + challenge-273/shawak/README.md | 1 + challenge-273/shawn-wagner/README | 1 + challenge-273/shimon-ben-avraham/README | 1 + challenge-273/simon-dueck/README | 1 + challenge-273/simon-miner/README | 1 + challenge-273/simon-proctor/README | 1 + challenge-273/simon-reinhardt/README | 1 + challenge-273/sol-demuth/README | 1 + challenge-273/solathian/README | 1 + challenge-273/southpawgeek/README | 1 + challenge-273/spadacciniweb/README | 1 + challenge-273/spazm/README | 1 + challenge-273/stephanie-stein/README | 1 + challenge-273/steve-bresson/README | 1 + challenge-273/steve-g-lynn/README | 1 + challenge-273/steve-rogerson/README | 1 + challenge-273/steven-lembark/README | 1 + challenge-273/steven-wilson/README | 1 + challenge-273/stuart-little/README | 1 + challenge-273/svetlana-nesterova/README | 1 + challenge-273/swaggboi/README | 1 + challenge-273/szabgab/README | 1 + challenge-273/ted-leahy/README | 1 + challenge-273/testerR59/README | 1 + challenge-273/tiago-stock/README | 1 + challenge-273/tim-potapov/README | 1 + challenge-273/tim-potapov/perl/.perl-version | 1 + challenge-273/tim-smith/README | 1 + challenge-273/tore-andersson/README | 1 + challenge-273/trenton-langer/README | 1 + challenge-273/tyler-bird/README | 1 + challenge-273/tyler-limkemann/README | 1 + challenge-273/tyler-wardhaugh/README | 1 + challenge-273/tyler-wardhaugh/clojure/.gitignore | 28 ++ challenge-273/tyler-wardhaugh/clojure/LICENSE | 214 ++++++++++++++++ challenge-273/tyler-wardhaugh/clojure/README.md | 41 +++ challenge-273/tyler-wardhaugh/clojure/bb.edn | 68 +++++ challenge-273/tyler-wardhaugh/clojure/deps.edn | 15 ++ .../tyler-wardhaugh/clojure/resources/.keep | 0 challenge-273/tyler-wardhaugh/fennel/.gitignore | 1 + challenge-273/tyler-wardhaugh/python/.gitignore | 24 ++ challenge-273/ulrich-rieke/README | 1 + challenge-273/user-person/README | 1 + challenge-273/uzluisf/README | 1 + challenge-273/vamsi-meenavilli/README | 1 + challenge-273/veesh-goldman/README | 1 + challenge-273/vinod-k/README | 1 + challenge-273/vinod-pal/README | 1 + challenge-273/vyacheslav-volgarev/README | 1 + challenge-273/walt-mankowski/README.md | 41 +++ challenge-273/walt-mankowski/c/.gitignore | 2 + challenge-273/walt-mankowski/cpp/.gitignore | 2 + challenge-273/walt-mankowski/perl/.perl-version | 1 + .../walt-mankowski/python/.python-version | 1 + challenge-273/wambash/README | 1 + challenge-273/wanderdoc/README | 1 + challenge-273/wg-romank/README | 1 + challenge-273/will-west/README | 1 + challenge-273/william-gilmore/README | 1 + challenge-273/witawayar/README | 1 + challenge-273/wlmb/README | 1 + challenge-273/x1mandi/README | 1 + challenge-273/xkr47/README | 11 + challenge-273/xliff/README | 1 + challenge-273/yary-h/README | 1 + challenge-273/yet-ebreo/README | 1 + challenge-273/yozen-hernandez/README | 1 + challenge-273/zapwai/README | 1 + challenge-273/ziameraj16/README.md | 18 ++ challenge-273/ziruzavar/README | 1 + 354 files changed, 1841 insertions(+) create mode 100644 challenge-273/0rir/README create mode 100644 challenge-273/2colours/README create mode 100644 challenge-273/3ter/README create mode 100755 challenge-273/LoneWolfiNTj/README create mode 100644 challenge-273/aaron-rowe/README create mode 100644 challenge-273/aaron-sherman/README create mode 100644 challenge-273/aaronreidsmith/README create mode 100644 challenge-273/abigail/README.md create mode 100644 challenge-273/adam-russell/.gitignore create mode 100644 challenge-273/adam-russell/README create mode 100644 challenge-273/adherzog/README create mode 100644 challenge-273/adriaandens/README create mode 100644 challenge-273/aecepoglu/README create mode 100644 challenge-273/ailbhe-tweedie/README create mode 100644 challenge-273/alex-daniel/README create mode 100644 challenge-273/alexander-karelas/README create mode 100644 challenge-273/alexander-pankoff/README create mode 100644 challenge-273/alicia-bielsa/README create mode 100644 challenge-273/andinus/README create mode 100644 challenge-273/andreas-voegele/README create mode 100644 challenge-273/andrezgz/README create mode 100644 challenge-273/anton-fedotov/README create mode 100644 challenge-273/antonio-gamiz/README create mode 100644 challenge-273/ap29600/README create mode 100644 challenge-273/archargelod/README create mode 100644 challenge-273/arne-sommer/README create mode 100644 challenge-273/arpad-toth/README create mode 100644 challenge-273/ash/README create mode 100644 challenge-273/asherbhs/README create mode 100644 challenge-273/asherbhs/hy/.gitignore create mode 100644 challenge-273/athanasius/README create mode 100644 challenge-273/atschneid/README.md create mode 100644 challenge-273/aubrey-quarcoo/README create mode 100644 challenge-273/augiedb/README create mode 100644 challenge-273/aut0exec/README create mode 100644 challenge-273/avery-adams/README create mode 100644 challenge-273/aviral-goel/README create mode 100644 challenge-273/barroff/README create mode 100644 challenge-273/baryshevs/README create mode 100644 challenge-273/bejoy-mathews/README create mode 100644 challenge-273/belmark-caday/README create mode 100644 challenge-273/ben-davies/README.md create mode 100644 challenge-273/bhat_gurunandan/README create mode 100644 challenge-273/bill-palmer/README create mode 100644 challenge-273/bkb/README create mode 100644 challenge-273/bn-ssotka/README create mode 100644 challenge-273/bob-kleemann/README create mode 100644 challenge-273/bob-lied/README create mode 100644 challenge-273/brtastic/README create mode 100644 challenge-273/brtastic/c/.gitignore create mode 100644 challenge-273/brtastic/pascal/.gitignore create mode 100644 challenge-273/bruce-gray/README create mode 100644 challenge-273/bruno-ramos/README create mode 100644 challenge-273/brxfork/README create mode 100644 challenge-273/burkhard-nickels/README create mode 100644 challenge-273/bwva/README create mode 100644 challenge-273/carlos-oliveira/README create mode 100644 challenge-273/chazzka/README create mode 100644 challenge-273/cheok-yin-fung/README create mode 100644 challenge-273/chicagoist/README.md create mode 100644 challenge-273/christian-jaeger/README create mode 100644 challenge-273/clifton-wood/README create mode 100644 challenge-273/cliveholloway/README create mode 100644 challenge-273/colin-crain/README create mode 100644 challenge-273/conor-hoekstra/README create mode 100644 challenge-273/craig/README create mode 100644 challenge-273/creewick/README create mode 100644 challenge-273/cristian-heredia/README create mode 100644 challenge-273/cybersnyder/README create mode 100644 challenge-273/dan-friedman/README create mode 100644 challenge-273/daniel-aberger/README create mode 100644 challenge-273/daniel-mantovani/README create mode 100644 challenge-273/daniel-mita/README create mode 100644 challenge-273/daniel-pfeiffer/README create mode 100644 challenge-273/dario-mazzeo/README create mode 100644 challenge-273/darren-bottin/README create mode 100644 challenge-273/dave-cross/README create mode 100644 challenge-273/dave-jacoby/README create mode 100644 challenge-273/david-kayal/README create mode 100644 challenge-273/david-santiago/README create mode 100644 challenge-273/ddobbelaere/README create mode 100644 challenge-273/deadmarshal/README create mode 100644 challenge-273/demerphq/README create mode 100644 challenge-273/demerphq/js/.gitignore create mode 100644 challenge-273/denis-yurashku/README create mode 100644 challenge-273/dms061/readme create mode 100644 challenge-273/donald-hunter/README create mode 100644 challenge-273/doug-schrag/README create mode 100644 challenge-273/dracos/README create mode 100644 challenge-273/duane-powell/README create mode 100644 challenge-273/duncan-c-white/C/.cbuild create mode 100644 challenge-273/duncan-c-white/README create mode 100644 challenge-273/e-choroba/README create mode 100644 challenge-273/ealvar3z/README create mode 100644 challenge-273/eddy-hs/README create mode 100644 challenge-273/eric-cheung/README create mode 100644 challenge-273/fabrizio-poggi/README create mode 100644 challenge-273/feng-chang/README.md create mode 100644 challenge-273/finanalyst/README create mode 100644 challenge-273/finley/README create mode 100644 challenge-273/fjwhittle/README create mode 100644 challenge-273/frankivo/README create mode 100644 challenge-273/fred-zinn/README create mode 100644 challenge-273/freddie-b/README create mode 100644 challenge-273/garrett-goebel/README create mode 100644 challenge-273/giuseppe-terlizzi/README create mode 100644 challenge-273/gugod/README create mode 100644 challenge-273/gugod/rust/.gitignore create mode 100644 challenge-273/guillermo-ramos/README create mode 100644 challenge-273/gustavo-chaves/README create mode 100644 challenge-273/habere-et-dispetire/README create mode 100644 challenge-273/happy-barney/README create mode 100644 challenge-273/hatorikibble/README create mode 100644 challenge-273/hauke-d/README create mode 100644 challenge-273/henry-wong/README create mode 100644 challenge-273/hstejas/README create mode 100644 challenge-273/iangoodnight/README.md create mode 100644 challenge-273/ianrifkin/README.md create mode 100644 challenge-273/izem/README create mode 100644 challenge-273/izifresh/README create mode 100644 challenge-273/jacques-guinnebault/README create mode 100644 challenge-273/jaguart/README.md create mode 100644 challenge-273/jaime/README create mode 100644 challenge-273/jake/README create mode 100644 challenge-273/jaldhar-h-vyas/README create mode 100644 challenge-273/james-marquis/README create mode 100644 challenge-273/james-raspass/README create mode 100644 challenge-273/james-smith/README.md create mode 100644 challenge-273/jan-perl/README create mode 100644 challenge-273/jaredor/README create mode 100644 challenge-273/jason-messer/README create mode 100644 challenge-273/javier-luque/README create mode 100644 challenge-273/jbourlakos/README create mode 100644 challenge-273/jcrosswh/README create mode 100644 challenge-273/jdos22/README create mode 100644 challenge-273/jeanluc2020/README create mode 100644 challenge-273/jeff/README create mode 100644 challenge-273/jeongoon/.gitignore create mode 100644 challenge-273/jeongoon/README create mode 100644 challenge-273/jeremy-carman/README create mode 100644 challenge-273/jim-bacon/README create mode 100644 challenge-273/jitu-keshwani/README create mode 100644 challenge-273/jj-merelo/README create mode 100644 challenge-273/jluis/README create mode 100644 challenge-273/jo-37/README create mode 100644 challenge-273/jo-christian-oterhals/README create mode 100644 challenge-273/joaofel/README create mode 100644 challenge-273/joe-tym/README create mode 100644 challenge-273/joelle-maslak/README create mode 100644 challenge-273/john-barrett/README create mode 100644 challenge-273/john-horner/README create mode 100644 challenge-273/jokraft/README create mode 100644 challenge-273/juan-caballero/README create mode 100644 challenge-273/julien-fiegehenn/README create mode 100644 challenge-273/julien-fiegehenn/perl/.gitignore create mode 100644 challenge-273/julien-fiegehenn/typescript/.gitignore create mode 100644 challenge-273/julien-fiegehenn/typescript/.nvmrc create mode 100644 challenge-273/juliodcs/README create mode 100644 challenge-273/kai-burgdorf/README.md create mode 100644 challenge-273/kaushik-tunuguntla/README create mode 100644 challenge-273/kevin-colyer/README create mode 100644 challenge-273/khalid-anwar/README create mode 100644 challenge-273/khalid/README create mode 100644 challenge-273/kian-meng-ang/README create mode 100644 challenge-273/kiran-kumar/README create mode 100644 challenge-273/kivanc-yazan/.gitignore create mode 100644 challenge-273/kivanc-yazan/README create mode 100644 challenge-273/kjetillll/README create mode 100644 challenge-273/kordaff/README create mode 100644 challenge-273/kostas-giannakakis/README create mode 100644 challenge-273/kueppo-wesley/README create mode 100644 challenge-273/kurkale6ka/README create mode 100644 challenge-273/lacek96/README create mode 100644 challenge-273/lance-wicks/README create mode 100644 challenge-273/lars-balker/README create mode 100644 challenge-273/lars-thegler/README create mode 100644 challenge-273/laurent-rosenfeld/README create mode 100644 challenge-273/leoltron/README create mode 100644 challenge-273/librasteve/README create mode 100644 challenge-273/lubos-kolouch/README create mode 100644 challenge-273/luc65r/README create mode 100644 challenge-273/luca-ferrari/pljava/pom.xml create mode 100644 challenge-273/luiz-felipe/README create mode 100644 challenge-273/macy-ty/README create mode 100644 challenge-273/magnus-woldrich/README create mode 100644 challenge-273/manfredi/README create mode 100644 challenge-273/mano-chandar/README create mode 100644 challenge-273/mark-anderson/README create mode 100644 challenge-273/mark-senn/README create mode 100644 challenge-273/markjreed/README create mode 100644 challenge-273/markus-holzer/README create mode 100644 challenge-273/martin-barth/README create mode 100644 challenge-273/martin-mugeni/README create mode 100644 challenge-273/massa/README create mode 100644 challenge-273/mathmauney/README create mode 100644 challenge-273/matt-latusek/README create mode 100644 challenge-273/matthew-persico/README create mode 100644 challenge-273/matthias-muth/README.md create mode 100644 challenge-273/mattneleigh/README create mode 100644 challenge-273/mauke/README create mode 100644 challenge-273/maxim-kolodyazhny/README create mode 100644 challenge-273/maxim-nechaev/README create mode 100644 challenge-273/memark/README create mode 100644 challenge-273/michael-hamlin/README create mode 100644 challenge-273/michael-schaap/README create mode 100644 challenge-273/mihail-iosilevitch/README create mode 100644 challenge-273/mike-accardo/README create mode 100644 challenge-273/mimosinnet/README create mode 100644 challenge-273/mohammad-anwar/README create mode 100644 challenge-273/morayj/README create mode 100644 challenge-273/ndelucca/README create mode 100644 challenge-273/neil-bowers/README create mode 100644 challenge-273/nelo-tovar/README.md create mode 100644 challenge-273/nick-logan/README create mode 100644 challenge-273/nicolas-mendoza/README create mode 100644 challenge-273/nikhil-prasanna/README create mode 100644 challenge-273/noud/README create mode 100644 challenge-273/nunovieira220/README create mode 100644 challenge-273/ohmycloud/README create mode 100644 challenge-273/oleksii-tsvietnov/README create mode 100644 challenge-273/oliver-oviedo/README create mode 100644 challenge-273/olivier-delouya/README create mode 100644 challenge-273/olli-antti/README create mode 100644 challenge-273/orestis-zekai/README create mode 100644 challenge-273/ozzy/README create mode 100644 challenge-273/p6steve/README create mode 100644 challenge-273/pablo-saavedra/README create mode 100644 challenge-273/packy-anderson/README.md create mode 100644 challenge-273/paul-fajman/README create mode 100644 challenge-273/paulo-custodio/README create mode 100644 challenge-273/pavel-jurca/README create mode 100644 challenge-273/pavel-starikov/README create mode 100644 challenge-273/pavel_kuptsov/README create mode 100644 challenge-273/perlboy1967/README create mode 100644 challenge-273/pete-houston/README create mode 100644 challenge-273/pete-sergeant/README create mode 100644 challenge-273/peter-campbell-smith/README create mode 100644 challenge-273/peter-meszaros/README create mode 100644 challenge-273/peter-scott/README create mode 100644 challenge-273/petr-roubicek/README create mode 100644 challenge-273/philippe-bruhat/README create mode 100644 challenge-273/phillip-harris/README create mode 100644 challenge-273/pip/README create mode 100644 challenge-273/pjdurai/README create mode 100644 challenge-273/pkmnx/README create mode 100644 challenge-273/plis-acm/.gitignore create mode 100644 challenge-273/plis-acm/README create mode 100644 challenge-273/pokgopun/README create mode 100644 challenge-273/polettix/README create mode 100644 challenge-273/polettix/perl/.gitignore create mode 100644 challenge-273/polettix/raku/.leaveme create mode 100644 challenge-273/prajith-p/README create mode 100644 challenge-273/princy-perl/README create mode 100644 challenge-273/probablyfine/README.md create mode 100644 challenge-273/rage311/README create mode 100644 challenge-273/rakulius/README create mode 100644 challenge-273/randy-lauen/README create mode 100644 challenge-273/rawleyfowler/README.md create mode 100644 challenge-273/razetime/README create mode 100644 challenge-273/rcmlz/README create mode 100644 challenge-273/reinier-maliepaard/README create mode 100644 challenge-273/ribtips/README create mode 100644 challenge-273/richard-park/README create mode 100644 challenge-273/rick-bychowski/README create mode 100644 challenge-273/rnuttall/README create mode 100644 challenge-273/rob-van-dam/README create mode 100644 challenge-273/rob4t/README create mode 100644 challenge-273/robbie-hatley/README create mode 100644 challenge-273/robert-dicicco/README create mode 100644 challenge-273/robert-mcintosh/README create mode 100644 challenge-273/roger-bell-west/README create mode 100644 challenge-273/rozcovo/README create mode 100644 challenge-273/ruben-westerberg/README create mode 100644 challenge-273/ryan-thompson/README.md create mode 100644 challenge-273/saiftynet/README create mode 100644 challenge-273/samir-parikh/README create mode 100644 challenge-273/sangeet-kar/README create mode 100644 challenge-273/santiago-leyva/README create mode 100644 challenge-273/sean-meininger/README create mode 100644 challenge-273/sergiotarxz/README create mode 100644 challenge-273/sgreen/README.md create mode 100644 challenge-273/shahed-nooshmand/README create mode 100644 challenge-273/shardiwal/README create mode 100644 challenge-273/shaun-pearce/README create mode 100644 challenge-273/shawak/README.md create mode 100644 challenge-273/shawn-wagner/README create mode 100644 challenge-273/shimon-ben-avraham/README create mode 100644 challenge-273/simon-dueck/README create mode 100644 challenge-273/simon-miner/README create mode 100644 challenge-273/simon-proctor/README create mode 100644 challenge-273/simon-reinhardt/README create mode 100644 challenge-273/sol-demuth/README create mode 100644 challenge-273/solathian/README create mode 100644 challenge-273/southpawgeek/README create mode 100644 challenge-273/spadacciniweb/README create mode 100644 challenge-273/spazm/README create mode 100644 challenge-273/stephanie-stein/README create mode 100644 challenge-273/steve-bresson/README create mode 100644 challenge-273/steve-g-lynn/README create mode 100644 challenge-273/steve-rogerson/README create mode 100644 challenge-273/steven-lembark/README create mode 100644 challenge-273/steven-wilson/README create mode 100644 challenge-273/stuart-little/README create mode 100644 challenge-273/svetlana-nesterova/README create mode 100644 challenge-273/swaggboi/README create mode 100644 challenge-273/szabgab/README create mode 100644 challenge-273/ted-leahy/README create mode 100644 challenge-273/testerR59/README create mode 100644 challenge-273/tiago-stock/README create mode 100644 challenge-273/tim-potapov/README create mode 100644 challenge-273/tim-potapov/perl/.perl-version create mode 100644 challenge-273/tim-smith/README create mode 100644 challenge-273/tore-andersson/README create mode 100644 challenge-273/trenton-langer/README create mode 100644 challenge-273/tyler-bird/README create mode 100644 challenge-273/tyler-limkemann/README create mode 100644 challenge-273/tyler-wardhaugh/README create mode 100644 challenge-273/tyler-wardhaugh/clojure/.gitignore create mode 100644 challenge-273/tyler-wardhaugh/clojure/LICENSE create mode 100644 challenge-273/tyler-wardhaugh/clojure/README.md create mode 100644 challenge-273/tyler-wardhaugh/clojure/bb.edn create mode 100644 challenge-273/tyler-wardhaugh/clojure/deps.edn create mode 100644 challenge-273/tyler-wardhaugh/clojure/resources/.keep create mode 100644 challenge-273/tyler-wardhaugh/fennel/.gitignore create mode 100644 challenge-273/tyler-wardhaugh/python/.gitignore create mode 100644 challenge-273/ulrich-rieke/README create mode 100644 challenge-273/user-person/README create mode 100644 challenge-273/uzluisf/README create mode 100644 challenge-273/vamsi-meenavilli/README create mode 100644 challenge-273/veesh-goldman/README create mode 100644 challenge-273/vinod-k/README create mode 100644 challenge-273/vinod-pal/README create mode 100644 challenge-273/vyacheslav-volgarev/README create mode 100644 challenge-273/walt-mankowski/README.md create mode 100644 challenge-273/walt-mankowski/c/.gitignore create mode 100644 challenge-273/walt-mankowski/cpp/.gitignore create mode 100644 challenge-273/walt-mankowski/perl/.perl-version create mode 100644 challenge-273/walt-mankowski/python/.python-version create mode 100644 challenge-273/wambash/README create mode 100644 challenge-273/wanderdoc/README create mode 100644 challenge-273/wg-romank/README create mode 100644 challenge-273/will-west/README create mode 100644 challenge-273/william-gilmore/README create mode 100644 challenge-273/witawayar/README create mode 100644 challenge-273/wlmb/README create mode 100644 challenge-273/x1mandi/README create mode 100644 challenge-273/xkr47/README create mode 100644 challenge-273/xliff/README create mode 100644 challenge-273/yary-h/README create mode 100644 challenge-273/yet-ebreo/README create mode 100644 challenge-273/yozen-hernandez/README create mode 100644 challenge-273/zapwai/README create mode 100755 challenge-273/ziameraj16/README.md create mode 100644 challenge-273/ziruzavar/README (limited to 'challenge-273') diff --git a/challenge-273/0rir/README b/challenge-273/0rir/README new file mode 100644 index 0000000000..48ee4684c2 --- /dev/null +++ b/challenge-273/0rir/README @@ -0,0 +1,2 @@ + +Solution by Robert Ransbottom. diff --git a/challenge-273/2colours/README b/challenge-273/2colours/README new file mode 100644 index 0000000000..6894fbec08 --- /dev/null +++ b/challenge-273/2colours/README @@ -0,0 +1 @@ +Solution By Márton Polgár. diff --git a/challenge-273/3ter/README b/challenge-273/3ter/README new file mode 100644 index 0000000000..8c594431f3 --- /dev/null +++ b/challenge-273/3ter/README @@ -0,0 +1 @@ +Solutions by 3ter. diff --git a/challenge-273/LoneWolfiNTj/README b/challenge-273/LoneWolfiNTj/README new file mode 100755 index 0000000000..bf42ad2482 --- /dev/null +++ b/challenge-273/LoneWolfiNTj/README @@ -0,0 +1 @@ +Solution by Robbie Hatley (github user "LoneWolfiNTj"). \ No newline at end of file diff --git a/challenge-273/aaron-rowe/README b/challenge-273/aaron-rowe/README new file mode 100644 index 0000000000..e14e0782fb --- /dev/null +++ b/challenge-273/aaron-rowe/README @@ -0,0 +1 @@ +Solutions by Aaron Rowe. diff --git a/challenge-273/aaron-sherman/README b/challenge-273/aaron-sherman/README new file mode 100644 index 0000000000..14ec31f570 --- /dev/null +++ b/challenge-273/aaron-sherman/README @@ -0,0 +1 @@ +Solutions by Aaron Sherman. diff --git a/challenge-273/aaronreidsmith/README b/challenge-273/aaronreidsmith/README new file mode 100644 index 0000000000..2fcfe1fdcc --- /dev/null +++ b/challenge-273/aaronreidsmith/README @@ -0,0 +1 @@ +Solution by Aaron Smith diff --git a/challenge-273/abigail/README.md b/challenge-273/abigail/README.md new file mode 100644 index 0000000000..d22640a6ce --- /dev/null +++ b/challenge-273/abigail/README.md @@ -0,0 +1 @@ +# Solutions by Abigail. diff --git a/challenge-273/adam-russell/.gitignore b/challenge-273/adam-russell/.gitignore new file mode 100644 index 0000000000..d4e9a94d5e --- /dev/null +++ b/challenge-273/adam-russell/.gitignore @@ -0,0 +1,3 @@ +*.bbprojectd +.RData +.Rhistory diff --git a/challenge-273/adam-russell/README b/challenge-273/adam-russell/README new file mode 100644 index 0000000000..1d2e2957c5 --- /dev/null +++ b/challenge-273/adam-russell/README @@ -0,0 +1 @@ +Solution by Adam Russell diff --git a/challenge-273/adherzog/README b/challenge-273/adherzog/README new file mode 100644 index 0000000000..b59913be6c --- /dev/null +++ b/challenge-273/adherzog/README @@ -0,0 +1 @@ +Solutions by Adam Herzog. diff --git a/challenge-273/adriaandens/README b/challenge-273/adriaandens/README new file mode 100644 index 0000000000..60d4ec3943 --- /dev/null +++ b/challenge-273/adriaandens/README @@ -0,0 +1 @@ +Solutions by Adriaan Dens. diff --git a/challenge-273/aecepoglu/README b/challenge-273/aecepoglu/README new file mode 100644 index 0000000000..9e57c3a464 --- /dev/null +++ b/challenge-273/aecepoglu/README @@ -0,0 +1,3 @@ +Solution by AhmetEmre + +Solved live on twitch.tv/slippygoat diff --git a/challenge-273/ailbhe-tweedie/README b/challenge-273/ailbhe-tweedie/README new file mode 100644 index 0000000000..36d4034b70 --- /dev/null +++ b/challenge-273/ailbhe-tweedie/README @@ -0,0 +1 @@ +Solution by Ailbhe Tweedie diff --git a/challenge-273/alex-daniel/README b/challenge-273/alex-daniel/README new file mode 100644 index 0000000000..65550789bd --- /dev/null +++ b/challenge-273/alex-daniel/README @@ -0,0 +1 @@ +Solution by Alex Daniel. diff --git a/challenge-273/alexander-karelas/README b/challenge-273/alexander-karelas/README new file mode 100644 index 0000000000..3de9fce8d9 --- /dev/null +++ b/challenge-273/alexander-karelas/README @@ -0,0 +1 @@ +Solution by Alexander Karelas diff --git a/challenge-273/alexander-pankoff/README b/challenge-273/alexander-pankoff/README new file mode 100644 index 0000000000..41f67807ac --- /dev/null +++ b/challenge-273/alexander-pankoff/README @@ -0,0 +1 @@ +Solution by Alexander Pankoff diff --git a/challenge-273/alicia-bielsa/README b/challenge-273/alicia-bielsa/README new file mode 100644 index 0000000000..c5187874c3 --- /dev/null +++ b/challenge-273/alicia-bielsa/README @@ -0,0 +1 @@ +Solution by Alicia Beilsa. diff --git a/challenge-273/andinus/README b/challenge-273/andinus/README new file mode 100644 index 0000000000..ad1a4a32fa --- /dev/null +++ b/challenge-273/andinus/README @@ -0,0 +1,69 @@ + ━━━━━━━━━━━━━━━ + CHALLENGE 188 + + Andinus + ━━━━━━━━━━━━━━━ + + + 2022-10-27 + + + + + +1 Task 1 - Divisible Pairs +══════════════════════════ + + You are given list of integers @list of size $n and divisor $k. + + Write a script to find out count of pairs in the given list that + satisfies the following rules. + + The pair (i, j) is eligible if and only if a) 0 <= i < j < len(list) + b) list[i] + list[j] is divisible by k + + + ┌──── + │ Example 1 + │ Input: @list = (4, 5, 1, 6), $k = 2 + │ Output: 2 + │ + │ Example 2 + │ Input: @list = (1, 2, 3, 4), $k = 2 + │ Output: 2 + │ + │ Example 3 + │ Input: @list = (1, 3, 4, 5), $k = 3 + │ Output: 2 + │ + │ Example 4 + │ Input: @list = (5, 1, 2, 3), $k = 4 + │ Output: 2 + │ + │ Example 5 + │ Input: @list = (7, 2, 4, 5), $k = 4 + │ Output: 1 + └──── + + +1.1 Raku +──────── + + Go over all combinations of elements as per rules and check if their + sum is divisible by divisor. + + ┌──── + │ unit sub MAIN( + │ Int $divisor, *@list is copy where *.elems > 0 + │ ); + │ @list = @list>>.Int; + │ + │ my Int $pairs; + │ for 0 ... @list.end -> $i { + │ for $i ... @list.end -> $j { + │ next if $i == $j; + │ $pairs++ if (@list[$i] + @list[$j]) %% $divisor; + │ } + │ } + │ put $pairs; + └──── diff --git a/challenge-273/andreas-voegele/README b/challenge-273/andreas-voegele/README new file mode 100644 index 0000000000..da9f91b22a --- /dev/null +++ b/challenge-273/andreas-voegele/README @@ -0,0 +1 @@ +Solutions by Andreas Vögele. diff --git a/challenge-273/andrezgz/README b/challenge-273/andrezgz/README new file mode 100644 index 0000000000..f4fd0da88e --- /dev/null +++ b/challenge-273/andrezgz/README @@ -0,0 +1 @@ +Solution by Andrezgz diff --git a/challenge-273/anton-fedotov/README b/challenge-273/anton-fedotov/README new file mode 100644 index 0000000000..f7c4f6deed --- /dev/null +++ b/challenge-273/anton-fedotov/README @@ -0,0 +1 @@ +Solutions by Anton Fedotov. diff --git a/challenge-273/antonio-gamiz/README b/challenge-273/antonio-gamiz/README new file mode 100644 index 0000000000..1f5ed5871a --- /dev/null +++ b/challenge-273/antonio-gamiz/README @@ -0,0 +1 @@ +Solution by Antonio Gamiz diff --git a/challenge-273/ap29600/README b/challenge-273/ap29600/README new file mode 100644 index 0000000000..003f354c89 --- /dev/null +++ b/challenge-273/ap29600/README @@ -0,0 +1 @@ +Solutions by Andrea Piseri diff --git a/challenge-273/archargelod/README b/challenge-273/archargelod/README new file mode 100644 index 0000000000..6cd57e1074 --- /dev/null +++ b/challenge-273/archargelod/README @@ -0,0 +1 @@ +Solution by archargelod diff --git a/challenge-273/arne-sommer/README b/challenge-273/arne-sommer/README new file mode 100644 index 0000000000..b5d88e4df4 --- /dev/null +++ b/challenge-273/arne-sommer/README @@ -0,0 +1 @@ +Solution by Arne Sommer. diff --git a/challenge-273/arpad-toth/README b/challenge-273/arpad-toth/README new file mode 100644 index 0000000000..6661dd82c1 --- /dev/null +++ b/challenge-273/arpad-toth/README @@ -0,0 +1 @@ +Solution by Arpad Toth diff --git a/challenge-273/ash/README b/challenge-273/ash/README new file mode 100644 index 0000000000..318b1bfb41 --- /dev/null +++ b/challenge-273/ash/README @@ -0,0 +1 @@ +Solutions by Andrew Shitov diff --git a/challenge-273/asherbhs/README b/challenge-273/asherbhs/README new file mode 100644 index 0000000000..5c37138bd7 --- /dev/null +++ b/challenge-273/asherbhs/README @@ -0,0 +1 @@ +Solutions by Asher Harvey-Smith diff --git a/challenge-273/asherbhs/hy/.gitignore b/challenge-273/asherbhs/hy/.gitignore new file mode 100644 index 0000000000..bee8a64b79 --- /dev/null +++ b/challenge-273/asherbhs/hy/.gitignore @@ -0,0 +1 @@ +__pycache__ diff --git a/challenge-273/athanasius/README b/challenge-273/athanasius/README new file mode 100644 index 0000000000..cc357fda4a --- /dev/null +++ b/challenge-273/athanasius/README @@ -0,0 +1 @@ +Solution by Athanasius diff --git a/challenge-273/atschneid/README.md b/challenge-273/atschneid/README.md new file mode 100644 index 0000000000..80bbf700d9 --- /dev/null +++ b/challenge-273/atschneid/README.md @@ -0,0 +1,281 @@ +# Defang and Sum-Abs-Char-Diffs + +**Challenge 272 solutions by Andrew Schneider** + +Being a stream of consciousness write up of some details of my code for [PWC 272](https://theweeklychallenge.org/blog/perl-weekly-challenge-272/) + +Let's get right to the problems + +## Task 1: Defang IP Address +Submitted by: Mohammad Sajid Anwar + +> You are given a valid IPv4 address.
+>
+> Write a script to return the defanged version of the given IP address.
+>
+> A defanged IP address replaces every period “.” with “[.]".
+>
+> Example 1
+> Input: $ip = "1.1.1.1"
+> Output: "1[.]1[.]1[.]1"
+> Example 2
+> Input: $ip = "255.101.1.0"
+> Output: "255[.]101[.]1[.]0"
+ +### Perl + +Really I think this problem wants a one-liner solution. Most of my chance to use Perl at work is writing one-liners like this guy + +```bash +perl -lpe 's/\./[.]/g' +``` + +which converts exactly into a legal sed expression + +```bash +sed 's/\./[.]/g' +``` + +What we're doing here is a simple regex substitution on a period literal (gotta escape special characters) replacing with `[.]` + +But, it didn't just feel right to get away with this one so easily. Where's the boilerplate? What am I learning? So I coded up a fully respectable Perl version. + +The heart of the program is this little function + +```perl +sub defang { + shift; + s/\./[.]/g; + return $_; +} +``` + +which is powered by much Perl magic. It expects a string variable, which gets `shift`ed into `$_`. Then substitution automagically happens on our `$_` variable by `s/\./[.]g;` (cf. `$_ =~ s/\./[.]/g;` for the same result with 90% less magic). Then pass back the substituted value in `$_`. I wondered if Perl would automagically return the special variable `$_` if the last line was simply `return;` and I learned it would not. So the final line is more sleight-of-hand than magic, but still. I often find it so much easier to use Perl's "do what I want" power on hidden magic variables that I contort my functions into horribly unnatural shapes just to get the magic to do what I need it to. Fortunately this particular function actually flows pretty naturally. + +### C + +Originally I had coded up my C implementation using `strtok_r`, but I realized it wasn't quite doing what I wanted. + +```c +void defang_first_try(char * input, char * output) { + char * token, * next_token; + + // blank the string contents in ouput + strcpy(output, ""); + token = strtok_r(input, ".", &next_token); + while (token) { + strcat(output, token); + printf(" %s\n", next_token); + token = strtok_r(NULL, ".", &next_token); + if (token) { + // if its not the last + strcat(output, "[.]"); + } + } +} +``` + +It handles the example cases just fine, but based on a strict reading of the specification, every '.' should be replaced by '[.]', this implementation fails on basically all edge cases: leading, multiple, and trailing '.'s all get dropped. Although I'm really overthinking this here, because, again, on a strict reading of the instructions, we are given a *valid IP address* so it shouldn't really come up. Still, I thought about how to handle these cases in general, and decided 'every' means *every* (and outweighs *valid*) so if we were to get an input like "..." I'd expect the output to be "[.][.][.]". In keeping consistency across all of my implementations I decided on this one + +```c +void defang(char * input, char * output) { + size_t out_index = 0; + for (; *input != '\0'; input++) { + if (*input == '.') { + output[out_index++] = '['; + output[out_index++] = '.'; + output[out_index++] = ']'; + } + else { + output[out_index++] = *input; + } + } + output[out_index] = '\0'; +} +``` + +Here I'm crawling along the string one character at a time. If the char is `'.'` then add the chars `'[', '.', ']'` to the output string, otherwise just add the char itself. Interesting that my crude solution here is about as long as the one using `strtok`. If this problem had been *slightly* more complicated I might have had to use a library. + +### Prolog + +Next up, Prolog. Getting anything done in Prolog is always a trip for me. It takes a little while to adjust, in particular, I always forget I have to pass the output variable to the function. With Prolog, at very high level, you're not really saying "compute this function and store the return value in X" as much as "give me an X that is a solution to this function." What's really cool is that often you can flip that to be "here is an X that is the solution to this function, give its input Y that yields X" or something like that. Besides all that, the syntax turns out to be very similar to a functional language like Haskell or Lisp. Anyway, I digress. + +I decided to write this in a way that could be run using GNU Prolog. I don't remember why I decided that, maybe I wanted a challenge. Because once I started running into issues and started Googling ([DuckDuckGoing](https://duckduckgo.com) really) for answers I got a lot of results telling me how to do the thing I wanted very easily in SWI Prolog, which is a much more fully-featured, batteries included Prolog implementation. Handling strings is not easy to do in Prolog in general, but SWI has added a lot of functionality around this. If my understanding is correct, in Prolog a string is just a list of chars, except that it's not. For instance, you can't pattern match on it. But if you print a string you get a list of char codes, so it's kind of a lose-lose. + +The solution, or rather *a* solution, or better still *my* solution is to convert strings to atoms. Prolog loves atoms and there are functions to convert a list of chars into an atom, and by the Prolog reflexive property, vice versa. Printing an atom gives its name as you would expect, so that is what I use for output too. So in my roundabout Prolog solution, I start by converting a string to a list of chars + +```prolog +str_to_chars(S, Cs) :- atom_codes(X, S), atom_chars(X, Cs). +``` + +If we initialize this function as `str_to_chars("hello", Cs).` it first looks for a solution to `atom_codes(X, "hello")` which is, it looks for an atom whose characters match the list of char codes (recall the string is represented as a list of char codes) of "hello" (explicitly `[104,101,108,108,111]`). This is exactly the atom `hello` which is bound to the variable `X`. Next it tries `atom_chars(X, Cs)` which is now `atom_chars(hello, Cs)` which attempts to find a list of chars (not char codes here) which make up the characters of `hello`, obviously giving `['h', 'e', 'l', 'l', 'o']` which gets bound to the variable `Cs`. Phew. There's got to be a better way to do this, but this works. + +Now that we have a list of chars, the rest is pretty easy. The easy part was the hard part. What we'll do is recur through the list of chars. If the list is empty, return an empty list. If the first char is `'.'` return the list `['[', '.', ']']` appended to the defanged list minus its head, and otherwise append the head to the defanged list minus its head. Like so + +```prolog +defang_chars([], []). +defang_chars(['.'|Xs], ['[', '.', ']'|Y]) :- defang_chars(Xs, Y), !. +defang_chars([X|Xs], [X|Y]) :- defang_chars(Xs, Y). +``` + +You know I really abused terminology there. Prolog doesn't return anything! It just shows how hard it is to get my mind into logic programming mode. Really it's (constructive) matching. One thing to point out is the cut `!` operator in line 2. What I want here is that if we match a `'.'` then commit to it. Don't backtrack and end up on line 3, since that won't give us the correct output. + +### Racket + +I'll mention briefly my Racket solution. After struggling through my Prolog implementation, this one was a breeze. Racket, and Scheme more broadly, includes lots of batteries, like a function to convert a string to a list of chars! The heart of the logic is basically the same as for Prolog. Given a list of chars, figure out what to do with the head of the list, and append to the operation on the tail. + +```racket +(define (defang-list s) + (let loop ([s s]) + (if (empty? s) + '() + (let ([first (car s)] [rest (cdr s)]) + (case first + [(#\.) (append '(#\[ #\. #\]) (loop rest))] + [else (cons first (loop rest))]))))) +``` + +One cool thing I dug up was `raco fmt` which is a code formatter for Racket. I used to think, "I'm a freewheelin' guy, don't fence me in, I'll format my code however I feel," but now I know that guy was a jerk! Find a style and stick with it, it will make your life easier. It doesn't matter so much what format you use as that you use a format. I read that somewhere once, and now I agree. + +### *** + +Amusing side note, I had mentally converted 'defang' to 'defrang', and coded up all my solutions using 'defrang' in the function names somewhere, then had to do a substitution to get things back to normal. Maybe that's an idea for a future PWC - fix all the function names in some C code or something like that. Also, defrang ... I like that word. I'll have to remember to try to use that somewhere. + + +## Task 2: String Score +Submitted by: Mohammad Sajid Anwar + +> You are given a string, $str.
+>
+> Write a script to return the score of the given string.
+>
+> The score of a string is defined as the sum of the absolute difference between the ASCII values of adjacent characters.
+>
+> Example 1
+> Input: $str = "hello"
+> Output: 13
+>
+> ASCII values of characters:
+> h = 104
+> e = 101
+> l = 108
+> l = 108
+> o = 111
+>
+> Score => |104 - 101| + |101 - 108| + |108 - 108| + |108 - 111|
+> => 3 + 7 + 0 + 3
+> => 13
+> Example 2
+> Input: "perl"
+> Output: 30
+>
+> ASCII values of characters:
+> p = 112
+> e = 101
+> r = 114
+> l = 108
+>
+> Score => |112 - 101| + |101 - 114| + |114 - 108|
+> => 11 + 13 + 6
+> => 30
+> Example 3
+> Input: "raku"
+> Output: 37
+>
+> ASCII values of characters:
+> r = 114
+> a = 97
+> k = 107
+> u = 117
+>
+> Score => |114 - 97| + |97 - 107| + |107 - 117|
+> => 17 + 10 + 10
+> => 37
+ +What I like most about this challenge is it finally gives us a way to directly compare programming languages. Now if someone asks if Raku is better than Perl I can say 37 > 30 so yes! + +This is a cool one. I could imagine some variation of this being used to encrypt messages somehow. + +Let's see some code + +### Perl + +Here is the Perl function that does basically all the work. + +```perl +sub sum_char_abs_diff ($s) { + my @slist = map { ord } split '', $s; + my $sum = 0; + for my $idx ( 1..scalar(@slist) - 1 ) { + $sum += abs( $slist[$idx] - $slist[$idx-1] ); + } + return $sum; +} +``` + +It takes a string, splits it on `''` which gives a list of characters. Then we map each value in that list of chars to its ascii value using `ord`. Next we initialize our sum value to 0. The for loop runs from index 1 until the end of the char-int list. This has the nice effect of handling strings of size 0 and size 1, the loop will never run and the value of 0 will be returned, which is how I would define these edge cases. Within the loop we add to the sum the absolute value of the difference of the element at the index and the element before it. That's a lot of words but it should be pretty clear by looking at the code. + +It looks like a pretty clean solution to me this time. I wonder if I could one-line it. + +### C + +The C code is very similar to the Perl solution + +```c +int sum_abs_char_diffs(const char * s) { + const size_t s_len = strlen(s); + + int abs_diff, sum = 0; + for (int i=1; i < s_len; i++) { + abs_diff = abs(s[i] - s[i-1]); + sum += abs_diff; + } + return sum; +} +``` + +One thing to point out here is that it plays to C's strengths, a char is basically an int! I though about trying some implicit casting in Perl, but it is too eager to do some `atoi` magic, in C we can simply do the arithmetic on the chars and the results come out right. + +### Prolog + +Basically everything happens in this function + +```prolog +sum_char_diffs([], 0). +sum_char_diffs([_], 0). +sum_char_diffs([A, B|Xs], S) :- + A > B, + sum_char_diffs([B|Xs], S2), S is S2 + A - B. +sum_char_diffs([A, B|Xs], S) :- + B >= A, + sum_char_diffs([B|Xs], S2), S is S2 + B - A. +``` + +Here we match explicitly on an empty string or a string of length 1 and bind the value 0, otherwise we bind the sum of the difference of the first two elements plus the value from the same function called recursively on the list minus its head. Many words, but hopefully the code makes enough sense on its own. + +The trickiest bit here is that I'm not sure if there's an absolute value function so I just treat `A > B` and `B >= A` separately. + +The fact that Prolog thinks of strings as a list of char codes works well for me here, no conversion necessary! Take that Prolog! + +### Racket + +Despite the looks of this one it was easy again to write. + +```racket +(define (sum-abs-char-diffs s) + (let* ([char-list (string->list s)] [num-list (map char->integer char-list)]) + (let loop ([num-list num-list] [diff-sum 0]) + (if (> 2 (length num-list)) + diff-sum + (loop (cdr num-list) (+ diff-sum (abs (- (car num-list) (cadr num-list))))))))) +``` + +The logic here is basically the same as for Prolog, in a functional form (returns a value). + +As far as formatting, I wasn't sure what to do about the stack of closing parens that built up at the end, but `raco fmt` just bunched them all together on the last line, so I'll accept that. + +### Conclusion + +Ok. This concludes my long, rambling notes on my various solutions to this week's challenges. I'm looking forward to seeing what comes up next week, and maybe soon I'll send in some of the challenge ideas I've been thinking up. + +See you next week. diff --git a/challenge-273/aubrey-quarcoo/README b/challenge-273/aubrey-quarcoo/README new file mode 100644 index 0000000000..8e63a2c1f5 --- /dev/null +++ b/challenge-273/aubrey-quarcoo/README @@ -0,0 +1 @@ +Solution by Aubrey Quarcoo diff --git a/challenge-273/augiedb/README b/challenge-273/augiedb/README new file mode 100644 index 0000000000..0842edd447 --- /dev/null +++ b/challenge-273/augiedb/README @@ -0,0 +1 @@ +Solution by Augie De Blieck Jr. diff --git a/challenge-273/aut0exec/README b/challenge-273/aut0exec/README new file mode 100644 index 0000000000..eaad94dcc6 --- /dev/null +++ b/challenge-273/aut0exec/README @@ -0,0 +1 @@ +Solution by Aut0exec diff --git a/challenge-273/avery-adams/README b/challenge-273/avery-adams/README new file mode 100644 index 0000000000..6aaa1f9308 --- /dev/null +++ b/challenge-273/avery-adams/README @@ -0,0 +1 @@ +Solutions by Avery Adams. diff --git a/challenge-273/aviral-goel/README b/challenge-273/aviral-goel/README new file mode 100644 index 0000000000..e64ee14512 --- /dev/null +++ b/challenge-273/aviral-goel/README @@ -0,0 +1 @@ +Solutions by Aviral Goel. diff --git a/challenge-273/barroff/README b/challenge-273/barroff/README new file mode 100644 index 0000000000..03cd0cea2e --- /dev/null +++ b/challenge-273/barroff/README @@ -0,0 +1 @@ +Solution by BarrOff. diff --git a/challenge-273/baryshevs/README b/challenge-273/baryshevs/README new file mode 100644 index 0000000000..61199