{"id":16211966,"url":"https://github.com/tidbitsjs/devadvent2021","last_synced_at":"2025-06-16T09:34:14.454Z","repository":{"id":110917738,"uuid":"434968347","full_name":"TidbitsJS/devadvent2021","owner":"TidbitsJS","description":null,"archived":false,"fork":false,"pushed_at":"2022-02-05T18:17:50.000Z","size":8444,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T21:45:38.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TidbitsJS.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-04T17:40:21.000Z","updated_at":"2024-08-20T03:41:06.000Z","dependencies_parsed_at":"2023-03-13T13:47:01.124Z","dependency_job_id":null,"html_url":"https://github.com/TidbitsJS/devadvent2021","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TidbitsJS/devadvent2021","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TidbitsJS%2Fdevadvent2021","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TidbitsJS%2Fdevadvent2021/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TidbitsJS%2Fdevadvent2021/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TidbitsJS%2Fdevadvent2021/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TidbitsJS","download_url":"https://codeload.github.com/TidbitsJS/devadvent2021/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TidbitsJS%2Fdevadvent2021/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260133847,"owners_count":22963808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T10:49:46.266Z","updated_at":"2025-06-16T09:34:14.415Z","avatar_url":"https://github.com/TidbitsJS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎅 Dev Advent Calendar 2021\n\nThe **Dev Advent Calendar** is an initiative by [@themarcba](https://twitter.com/themarcba) in order to give back to the community and learn something on the way.\n\nFor every day from the **1st to the 24th of December**, an Xmas-themed coding puzzle is given as a repository to solve.\n\nThis repository contains the respective valid solutions for all the puzzles.\n\n# 🧩 Puzzles\n\n## Day 1\n\nWeeks before Christmas, Santa's reindeers start practicing their flying in order to be fit for the big night. Unfortunately, one of them (Rudolf) crashed and landed in the forest 🌲\n\nNow, Santa 🎅 needs YOUR help to find him.\n\nPuzzle: [Puzzle 01](./puzzle-1)\n\n## Day 2\n\nThe Elf Coffee Shop has its big reopening after lengthy renovation works during the summer. Not only is it completely modernized, but has also a whole new range of available drinks. In the old coffee shop, the elves could only choose between \"Hot Chocolate\" and \"Coffee\". This new coffee shop has a list of various drinks (e.g. Latte, Hot Chocolate, etc.) and optional flavors (e.g. Gingerbread, Peppermint, etc.).\n\nSince this is new and confusing to the elves, especially because the pricing is a bit more complicated than before, the owner of Elf Coffee Shop asked if you could create an automated menu. He would provide you with the name/price of each drink, and the name/price of each available flavor.\n\nIt now is your job to create a list of all possible combinations of these drinks (including those without extra flavor), and the pricing.\n\nPuzzle: [Puzzle 02](./puzzle-2)\n\n## Day 3\n\n[Yesterday's puzzle](./puzzle-2) was about creating the menu for the Elf Coffee Shop. The owner was very satisfied with the result.\n\nDue to the high demand, the savy entrepreneur hired someone to make an app where elves can order their drink, and it would be delivered home, or to their workplace.\n\nThe only thing missing is a REST API to get the drinks.\nIt is your job to populate the API with the correct data, so it can be consumed by the app.\n\nPuzzle: [Puzzle 03](./puzzle-3)\n\n## Day 4\n\nYou might not know this, but the Elf Post Service 📯 (ECS) is the largest parcel organization in the world. (For obvious reasons though, now that you think about, right?). They are ecologically responsible, so they continuously try to make everything more efficient, also when sending out packages.\n\nThat's why they introduced some new box sizes, in order to waste less paper/carton. Before, there were only 3 sizes (S, M, L), now there is a selection of 7 different sizes. This makes it not always that obvious which package is right for which item.\n\nSanta himself asked for your help to develop an algorithm that can select the smallest possible box (but big enough for the item to fit) for any given item.\n\nPuzzle: [Puzzle 04](./puzzle-4)\n\n## Day 5\n\nThe elves are about to prepare bags of candy that they want to add to each present this year (you know, everyone had a hard year with Covid still being around and all). Because Santa is a perfectionist, he wants no repeated candy in any of the bags.\n\nHe asked you if you could write a program that creates bags of candy that has no repeated candy in it.\n\nPuzzle: [Puzzle 05](./puzzle-5)\n\n## Day 6\n\nYou might have heard from the song Santa Claus is Coming to Town the lines:\n\nHe's making a list. He's checking it twice. He's gonna find out who's naughty or nice\n\nWell, that is exactly what your task is for today: Write a program that checks a list of kids and analyze whether they were naughty or nice, so that Santa knows if they deserve candy and toys, or coal...\n\nPuzzle: [Puzzle 06](./puzzle-6)\n\n## Day 7\n\nThere was a minor accident in the EPS (Elf Postal Service). The door of a delivery truck was not closed correctly, and some gifts fell in the snow.\n\nThis caused some name tags to be smudged in a way that some of the letters are not recognized anymore.\n\nIt is your task to recuperate the original names from the gift tags.\n\nPuzzle: [Puzzle 07](./puzzle-7)\n\n## Day 8\n\nThe elves are organizing a pre-Christmas party, and they want to organize a \"secret santa\".\n\nIt is your job to write an algorithm that selects a secret santa for each participant.\n\n_The concept of \"secret santa\" is the following: Each participant is assigned a so-called \"secret santa\", a person that will have to get a thoughtful gift for that person.\nUsually this is in-person: All names are thrown in a hat, and each participant draws one. The paper you draw it the person you have to give a gift to. _\n\nPuzzle: [Puzzle 08](./puzzle-8)\n\n## Day 9\n\nSanta received a strange looking file in his mailbox. It looks like it could be a hidden message.\n\nHe needs your help to decypher the message in the file.\n\nPuzzle: [Puzzle 09](./puzzle-9)\n\n## Day 10\n\nWinters at the North Pole can be harsh, which not only affects the elves, but also technology.\nSome of the train wagons that are used to transport materials, presents, etc. in and out of the North Pole are really old.\nIn this hash weather, fauly breaks can cause accidents on the tracks.\n\nThat is why you help the head mechanic elf to check today's train wagons if they're up to code or not.\n\nPuzzle: [Puzzle 10](./puzzle-10)\n\n## Day 11\n\nSome sections of the North Pole have restricted access, because they contain secrets, like Mrs. Claus's Hot Chocolate Recipe, codes to deactivate the invisibility shield around the village/factory, etc.\n\nThese passwords are being changed regularly, and the person that changes it (head elf) just keeps it in his mind. However, it has been noticed that he keeps reusing old passwords.\nThat's why the board has decided that passwords should be auto-generated.\n\nPuzzle: [Puzzle 11](./puzzle-11)\n\n## Day 12\n\n\u003e This puzzle will be less a puzzle and more a challenge. It will be different from the JavaScript puzzles before 😉\n\nThe elves are having a little competition about who makes the most beautiful art about a Christmas tree, and since you've been helping them out a great deal lately, they invited you to participate.\n\nPuzzle: [Puzzle 12](./puzzle-12)\n\n## Day 13\n\nFor hundreds of years, the elves have been working with roman numerals. They use it everywhere - in file cabinets, in notes, etc.\nThis was okay when the numbers were smaller. But some index cards sure are getting big, and the roman version of reading it is just not practical anymore.\n\nTherefore once again the head elf 🧝 counts on your help.\n\nPuzzle: [Puzzle 13](./puzzle-13)\n\n\n## Day 14\n\nWhen two elves have to decide who has to do a chore, sometimes they use an ancient game to determine which player will be free of work.\n\nThe game is called Earth-Fire-Snow, and it works like this:\nThe two players choose either one of _snow_, _earth_, or _fire_. Then, at the same time they announce their choice.\nThe combination of the two defines who wins:\n\n-   Fire _melts_ snow\n-   Snow _covers_ earth\n-   Earth _extinguishes_ fire\n\nIf both players select the same choice, it is a draw.\n\nYour task is it to create a digital version for this, when it comes up when the elves do some work from home.\n\nPuzzle: [Puzzle 14](./puzzle-14)\n\n\n## Day 15\n\nElves are extremely looking forward to Christmas. So the closer December 25th gets, the more excited they are.\nTherefore Santa decided to make a big display of how much time left until Christmas, **in real-time**.\n\nYou are in charge to create this display.\n\nPuzzle: [Puzzle 15](./puzzle-15)\n\n## Day 16\n\nTo get home to the North Pole after his big night, Santa uses star constellations.\nBut after a whole night of delivering presents to children all around the world, he is tired, so that doing the navigation is a hassle.\n\nSince on his way home, his sleigh flies at an altitude where it is not interfering with planes, drones, satellites, or other objects, it is safe to automate this.\n\nHelp the elves develop an autopilot for Santa's Sleigh.\n\nPuzzle: [Puzzle 16](./puzzle-16)\n\n## Day 17\n\nWhile the head elf was replacing all existing password with the number generator made in [puzzle 11](https://github.com/devadvent/puzzle-11), he came upon one specific case where he actually forgot the password.\nIt is a very old password, when security was not an issue, and we have access to the database to extract the _hashcode_ from the password.\n\nIt is your job to extract the password from the given hash code.\n\nPuzzle: [Puzzle 17](./puzzle-17)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidbitsjs%2Fdevadvent2021","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidbitsjs%2Fdevadvent2021","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidbitsjs%2Fdevadvent2021/lists"}