/AdventOfCode2021

Hsv.py Advent of Code 2021 Repository: Share code, tips, notes, and other useful info!

MIT LicenseMIT

AdventOfCode2021

Hsv.py Advent of Code 2021 Repository: Share code, tips, notes, and other useful info!

Hsv.py Advent of Code 2021!

This repository is meant for sharing code, tricks, tips, and anything that would be beneficial to others learning and improving their python skills. All ages and coding skill levels are invited to participate! Enjoy the challenge and remember to have fun!

How to contribute to this repo

Feel free to fork this repo and add your code to your fork. Please save any shared files with your name (or nickname--something that can be used to identify you through our Meetup group) and the challenge day number. If your code pertains to a specific part of the challenge (for example, the second star on day 3), please include the part in the filename. For example:

guidoVanRossum_day03part2.py

How to get help

You can always e-mail us at Huntsville.py@gmail.com, message Ashley directly on Meetup, or ask in our slack channel (#hsv-dot-py).

If you need help getting started or with a particular puzzle, you can check out our hsv-dot-py channel on tech256 (sign up here), add a message to our Meetup.com discussion, e-mail us (huntsville.py@gmail.com), or send a Meetup message and we'll help direct you! (Also, though not directly affiliated with our group, there are an active Reddit r/adventofcode and a general Advent of Code Slack channel on tech256.)

Hsv.py's 2021 Advent Challenges

We're doing prizes again this year! Here are the rules to be eligible to win a prize:

  1. Hsv.py's Advent 2021's timeline runs through January 10, 2022, for any submissions. Winners will be notified that week.
  2. Players must be a member of the Hsv.py Meetup group and have a valid e-mail connected to their account for notification purposes. Unclaimed prizes will time-out after 30 days, so make sure we can contact you!
  3. Players must join the Hsv.py leadership board on https://adventofcode.com/ (our leadership board code is: 135149-377bf0f5) and must be identifiable between Meetup and the leadership board and GitHub (so we can tell who is who).
  4. Players must complete any 15 challenges from the 2021 year (any 15, does not have to be sequential) and at least 5 of these challenges must have both stars completed. The more challenges you complete, the better your placement within the group.
  5. Players must publish their code (accessible from their fork or a merge request to our repo or pushed to their personal repo, as long as a link is available) for the challenges completed. Our repo is located on GitHub. We must be able to access your code for it to qualify for this challenge.
  6. Players must use Python for the challenges completed. (We're Hsv.py after all!)
  7. The player with the most solved challenges by January 10th 2022 will receive the first place prize: a signed copy of Pat Viafore's book, "Robust Python: Write Clean and Maintainable Code". All other prizes will be great surprises! :)
  8. If you have any questions about the rules, please send Ashley a Meetup.com message or send us an e-mail at Huntsville.py@gmail.com
  9. Winners will be limited to the top 10. More challenges completed successfully and faster will factor into who wins in the case of close competition.
  10. Winners will be contacted through a Meetup message. Please make sure we can identify you between GitHub and Meetup.com and please make sure your message notifications are on!

About Advent of Code

Advent of Code is a project created by Eric Wastl (@ericwastl); each year during the month of December, puzzles are listed on the challenge website. A new puzzle is listed each day of the month and requires code to solve (actually any language will work--but we especially love Python!). Puzzles are created for a variety of skill levels and are perfect for challenging yourself, others, or collaborating together to solve.

Users' Repos

Check out solutions from our community below! If you'd like yours listed, feel free to open up a PR against this repo.

Extra Python Challenges

If you'd like to learn a little bit more Python, check out some of these extra challenges each day to level up your Python skills!

Day 1

  • Can you solve the challenge with no for loops (comprehensions are okay)
  • Can you solve the challenge using the zip function?
  • Can you solve the challenge by writing a function for part 1, and having part 2 use that function?

Day 2

  • Can you solve the challenge with no if statements? (hint: try a dictionary that maps move type to function)
  • Can you solve the challenge using Python 3.10's pattern matching?

Day 3

  • Can you solve the challenge with using bitwise operators (hint: check out the & operator and the ~ operator?
  • Can you solve the challenge with no bitwise operators?

Day 4

  • Are you familiar with the any() and all() functions? Try to solve using those!

Day 5

  • Can you solve this without creating a grid?
  • Can you solve this with a Counter?

Day 6

  • Can you solve this with a Counter?

Day 7

  • Can you solve this using the abs function?

Day 8

Day 9

Day 10

  • Can you solve this using a list as a stack?

Day 11

  • Can you solve this recursively?

Day 12

Day 13

  • Can you solve this without making a grid until you've done all the folds (only using a list of points)

Day 13

  • Can you solve this with the max and min functions