metya преди 4 години
родител
ревизия
6f0c0f7332

Файловите разлики са ограничени, защото са твърде много
+ 0 - 7
day1_sonar_sweep/README.html


+ 3 - 2
day1_sonar_sweep/README.md

@@ -1,4 +1,5 @@
---- Day 1: Sonar Sweep ---
+
+### --- Day 1: Sonar Sweep ---
 
 You're minding your own business on a ship at sea when the overboard alarm goes off! You rush to see if you can help. Apparently, one of the Elves tripped and accidentally sent the sleigh keys flying into the ocean!
 
@@ -47,7 +48,7 @@ In this example, there are 7 measurements that are larger than the previous meas
 How many measurements are larger than the previous measurement?
 
 
---- Part Two ---
+### --- Part Two ---
 
 Considering every single measurement isn't as useful as you expected: there's just too much noise in the data.
 

+ 3 - 2
day2_drive/README.md

@@ -1,4 +1,5 @@
---- Day 2: Dive! ---
+
+### --- Day 2: Dive! ---
 
 Now, you need to figure out how to pilot this thing.
 
@@ -37,7 +38,7 @@ Calculate the horizontal position and depth you would have after following the p
 
 The first half of this puzzle is complete! It provides one gold star: *
 
---- Part Two ---
+### --- Part Two ---
 
 Based on your calculations, the planned course doesn't seem to make any sense. You find the submarine manual and discover that the process is actually slightly more complicated.
 

+ 8 - 0
day3_binary_diagnostic/Cargo.toml

@@ -0,0 +1,8 @@
+[package]
+name = "day3_binary_diagnostic"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]

+ 98 - 0
day3_binary_diagnostic/README.md

@@ -0,0 +1,98 @@
+
+--- Day 3: Binary Diagnostic ---
+--------------------------------
+
+The submarine has been making some odd creaking noises, so you ask it to produce a diagnostic report just in case.
+
+
+The diagnostic report (your puzzle input) consists of a list of binary numbers which, when decoded properly, can tell you many useful things about the conditions of the submarine. The first parameter to check is the *power consumption*.
+
+
+You need to use the binary numbers in the diagnostic report to generate two new binary numbers (called the *gamma rate* and the *epsilon rate*). The power consumption can then be found by multiplying the gamma rate by the epsilon rate.
+
+
+Each bit in the gamma rate can be determined by finding the *most common bit in the corresponding position* of all numbers in the diagnostic report. For example, given the following diagnostic report:
+
+
+
+```
+00100
+11110
+10110
+10111
+10101
+01111
+00111
+11100
+10000
+11001
+00010
+01010
+
+```
+
+Considering only the first bit of each number, there are five `0` bits and seven `1` bits. Since the most common bit is `1`, the first bit of the gamma rate is `1`.
+
+
+The most common second bit of the numbers in the diagnostic report is `0`, so the second bit of the gamma rate is `0`.
+
+
+The most common value of the third, fourth, and fifth bits are `1`, `1`, and `0`, respectively, and so the final three bits of the gamma rate are `110`.
+
+
+So, the gamma rate is the binary number `10110`, or `*22*` in decimal.
+
+
+The epsilon rate is calculated in a similar way; rather than use the most common bit, the least common bit from each position is used. So, the epsilon rate is `01001`, or `*9*` in decimal. Multiplying the gamma rate (`22`) by the epsilon rate (`9`) produces the power consumption, `*198*`.
+
+
+Use the binary numbers in your diagnostic report to calculate the gamma rate and epsilon rate, then multiply them together. *What is the power consumption of the submarine?* (Be sure to represent your answer in decimal, not binary.)
+
+
+--- Part Two ---
+----------------
+
+Next, you should verify the *life support rating*, which can be determined by multiplying the *oxygen generator rating* by the *CO2 scrubber rating*.
+
+
+Both the oxygen generator rating and the CO2 scrubber rating are values that can be found in your diagnostic report - finding them is the tricky part. Both values are located using a similar process that involves filtering out values until only one remains. Before searching for either rating value, start with the full list of binary numbers from your diagnostic report and *consider just the first bit* of those numbers. Then:
+
+
+* Keep only numbers selected by the *bit criteria* for the type of rating value for which you are searching. Discard numbers which do not match the bit criteria.
+* If you only have one number left, stop; this is the rating value for which you are searching.
+* Otherwise, repeat the process, considering the next bit to the right.
+
+
+The *bit criteria* depends on which type of rating value you want to find:
+
+
+* To find *oxygen generator rating*, determine the *most common* value (`0` or `1`) in the current bit position, and keep only numbers with that bit in that position. If `0` and `1` are equally common, keep values with a `*1*` in the position being considered.
+* To find *CO2 scrubber rating*, determine the *least common* value (`0` or `1`) in the current bit position, and keep only numbers with that bit in that position. If `0` and `1` are equally common, keep values with a `*0*` in the position being considered.
+
+
+For example, to determine the *oxygen generator rating* value using the same example diagnostic report from above:
+
+
+* Start with all 12 numbers and consider only the first bit of each number. There are more `1` bits (7) than `0` bits (5), so keep only the 7 numbers with a `1` in the first position: `11110`, `10110`, `10111`, `10101`, `11100`, `10000`, and `11001`.
+* Then, consider the second bit of the 7 remaining numbers: there are more `0` bits (4) than `1` bits (3), so keep only the 4 numbers with a `0` in the second position: `10110`, `10111`, `10101`, and `10000`.
+* In the third position, three of the four numbers have a `1`, so keep those three: `10110`, `10111`, and `10101`.
+* In the fourth position, two of the three numbers have a `1`, so keep those two: `10110` and `10111`.
+* In the fifth position, there are an equal number of `0` bits and `1` bits (one each). So, to find the *oxygen generator rating*, keep the number with a `1` in that position: `10111`.
+* As there is only one number left, stop; the *oxygen generator rating* is `10111`, or `*23*` in decimal.
+
+
+Then, to determine the *CO2 scrubber rating* value from the same example above:
+
+
+* Start again with all 12 numbers and consider only the first bit of each number. There are fewer `0` bits (5) than `1` bits (7), so keep only the 5 numbers with a `0` in the first position: `00100`, `01111`, `00111`, `00010`, and `01010`.
+* Then, consider the second bit of the 5 remaining numbers: there are fewer `1` bits (2) than `0` bits (3), so keep only the 2 numbers with a `1` in the second position: `01111` and `01010`.
+* In the third position, there are an equal number of `0` bits and `1` bits (one each). So, to find the *CO2 scrubber rating*, keep the number with a `0` in that position: `01010`.
+* As there is only one number left, stop; the *CO2 scrubber rating* is `01010`, or `*10*` in decimal.
+
+
+Finally, to find the life support rating, multiply the oxygen generator rating (`23`) by the CO2 scrubber rating (`10`) to get `*230*`.
+
+
+Use the binary numbers in your diagnostic report to calculate the oxygen generator rating and CO2 scrubber rating, then multiply them together. *What is the life support rating of the submarine?* (Be sure to represent your answer in decimal, not binary.)
+
+

+ 12 - 0
day3_binary_diagnostic/example.txt

@@ -0,0 +1,12 @@
+00100
+11110
+10110
+10111
+10101
+01111
+00111
+11100
+10000
+11001
+00010
+01010

+ 1000 - 0
day3_binary_diagnostic/input.txt

@@ -0,0 +1,1000 @@
+001111011011
+000110001010
+011010111111
+010011001110
+011001101000
+010100000011
+100001000011
+100100001101
+011011001010
+101001010010
+110100001001
+010000101010
+001001111111
+010011011101
+100000000000
+011101111000
+101100101010
+000010001110
+011101101101
+101000101010
+100011101110
+011101110011
+010100010101
+001100011011
+100010010110
+010001011001
+001010001100
+011001000111
+010010010010
+111100110101
+011011010110
+000100101011
+001011111001
+000101011100
+101011000001
+000101101101
+010000111010
+001011001001
+100110110100
+001101000011
+000011001000
+101111101000
+110011010011
+111111000111
+110100010101
+111111001111
+110011101101
+110111111110
+001101011110
+000111101001
+100100100110
+010110001110
+111001111011
+001111000101
+110000111011
+101011001110
+010111001110
+111101101111
+111110111100
+100110101010
+101100000011
+110010000101
+110101100110
+001011101101
+001011010000
+110010011010
+101101110101
+000101101110
+001001101010
+111100001011
+110110111000
+010010001000
+110101100010
+101000111111
+001110110110
+101000010100
+010111011100
+001001111000
+000010110010
+110011010010
+010101110100
+010100110000
+000001001010
+000111101000
+100100010100
+101111100010
+100001010110
+111100001110
+100011100101
+110100101010
+010000000000
+100100100000
+010101011101
+101001100011
+011001101110
+000100111111
+011110111100
+100101111001
+111110000001
+001010110111
+101011100101
+100100100101
+011010000110
+111111111010
+011110100011
+100100110111
+111001000000
+001010110100
+011110101010
+111101000011
+101011111010
+010010010111
+011111010111
+111100111011
+011011010001
+001101101111
+111010100100
+100001010000
+111010100111
+000000101101
+001110001111
+000110011100
+101001000011
+011110000011
+000101110101
+111110110100
+000011101001
+000000000101
+101100101011
+000110111000
+111010011010
+000100101000
+111111110001
+000101011111
+001000011110
+100111110000
+001010100111
+100110111010
+001101000111
+111010000100
+111001011001
+001101111001
+101000001100
+010110000111
+100001110010
+011100110000
+010001011111
+110010001101
+100001111010
+000110110111
+011110111111
+101100100111
+010001110001
+001000000111
+101110001101
+011110101001
+000110101001
+010010111110
+010001000010
+111001111001
+001101001110
+010110111010
+101110101111
+010010100001
+011100010101
+000001000011
+100111001000
+011101001110
+011101011011
+011100011001
+111111101010
+001111001011
+111010010110
+111001001101
+100000110001
+010001010010
+100010001110
+001000011011
+000111011111
+000110100011
+101100110010
+000010101101
+101100010111
+011100110100
+000010001010
+000000000011
+100000010001
+111100111111
+110001010011
+100100011101
+101000001011
+110111010011
+000111101011
+001000100000
+010110011011
+110011110101
+110100011101
+101001001000
+001101110110
+100010101111
+111001110010
+110101001001
+111100011011
+001100001001
+001001001011
+011011110100
+000000001111
+111111001001
+001011111010
+000010110111
+110100110101
+110110010011
+010100001110
+100100001011
+111111111101
+101111010110
+100111100110
+110000111000
+101011101001
+001000010010
+010000111001
+110011101000
+010100101101
+110001101100
+011000001110
+011010111100
+011110001101
+101100101001
+010111110000
+100110001111
+000000111110
+011001011010
+110110011000
+000001010101
+000000100111
+101010111001
+010011100011
+100110001100
+110001110010
+010101100001
+000101101111
+100101000011
+010110111101
+000111001101
+010000011000
+010101011001
+010100111000
+011111000010
+110111001100
+010101101111
+000111110000
+000001111100
+000110000001
+010001000011
+011011100111
+100001010101
+101000011101
+001110010101
+001000101100
+011001011001
+001101000101
+110101011000
+000100010001
+110010010101
+111010111011
+010010111000
+010110010101
+110111110110
+000110110110
+100001000000
+011000001001
+010000111011
+010010000100
+100000000111
+100100000010
+101110011111
+010111101101
+010011100000
+000111101100
+011101001100
+100001111000
+110000010000
+000011000101
+010010100000
+000000110011
+100100110010
+010100101000
+010011100111
+011111010100
+111111100010
+111011110011
+011001001100
+100110111001
+001100111001
+000001100011
+011111100010
+100011110011
+011001111010
+010101110110
+001011110100
+101101101000
+001000101110
+111001011010
+011111101000
+111001101101
+111011011011
+111001101010
+011011110010
+001010001101
+111000000110
+100010000001
+011001111101
+101011001111
+101010111110
+100111011001
+010001011010
+001001101101
+001110100101
+010111111101
+100110001101
+001010001010
+101000111000
+000011010010
+101011010001
+011100001001
+001111001110
+100010010011
+101110010001
+110100011111
+000001101110
+010010111111
+000010101010
+100100000101
+011101001011
+100000111000
+010101001100
+111010100010
+001001001100
+111110100110
+010001010000
+000111000000
+100101110111
+011001010000
+110001110101
+010111011111
+011101111011
+001100010001
+111010010010
+011010000100
+010110110011
+011100100110
+000011010110
+001001110000
+101011000011
+101011010111
+100111000000
+010111100101
+000001101011
+000110000101
+101101110111
+010101110001
+011011100011
+100001001110
+000110101111
+100111011100
+010110110010
+010010001110
+010111010100
+010101101100
+110111011001
+101100110011
+110010110001
+011001000100
+011111011111
+101101000111
+110000111110
+100101100100
+111001101000
+001110110011
+110111111010
+100101011111
+000110100101
+000000110001
+000111100001
+110001000111
+011000100110
+101010101111
+100101011110
+101000010001
+001101000100
+010100000010
+011000110100
+000101011010
+101101000100
+110101101110
+001010000000
+110110111101
+101000110011
+100010101101
+111000100101
+010110100011
+101100001100
+101101100001
+100011000001
+011010011010
+100011000000
+110000100110
+010001111100
+001101011000
+100111110001
+010010010100
+111000010011
+101000011100
+110011110001
+001110101000
+101100100101
+001101010100
+011110000100
+111000101011
+100110101011
+000111010000
+000110100010
+111100011101
+110001001010
+011011100010
+101110001000
+000011100110
+000110111111
+011111110000
+101000110110
+011110001111
+010000110111
+001111001000
+000101001010
+000000000100
+000100111110
+000101110010
+011100000010
+101010111011
+001110101110
+000100000001
+100100101111
+110000110100
+001100001100
+111011100001
+010111111100
+010111001000
+101111010111
+001011001010
+101010100001
+101011101110
+000111001100
+000000010110
+000000000001
+000010111011
+000011101110
+011011011011
+011111111110
+001111001111
+110010100100
+011111001010
+110011010100
+010011110100
+110010101100
+111111101110
+001110110111
+100111001110
+110100001111
+101101001011
+110011011110
+100110010010
+011011001000
+110000111001
+011100001101
+101101111100
+100111111110
+111001101100
+100101010011
+000100011111
+011011000100
+100101111011
+100011000010
+010101111110
+001001110110
+010111011000
+000101111100
+101000110101
+011000010001
+010010010101
+100000101100
+101010111100
+110101011110
+110011011011
+001011100001
+001111100010
+110100111100
+100010101110
+100110010110
+101011110010
+000111100000
+011011110011
+101100100010
+111101000000
+101100100110
+100111101011
+111111111011
+011001101100
+010110110000
+100000010010
+000011101101
+111110011100
+010011010011
+101000001101
+010100001001
+011110100111
+000011100010
+101001110101
+101010000000
+101101011001
+001110010001
+000000101000
+110001000100
+111111100101
+001010101001
+111000110001
+100011001110
+110001001000
+110110011011
+100100111000
+001100010110
+001111110110
+110000010010
+110110011101
+100011000111
+010100100100
+001110000000
+100010110000
+110010000011
+111011110101
+100001100110
+010110101111
+011010101010
+110101010100
+010111100011
+111101111110
+110111111111
+011111001101
+100101101010
+101010001011
+110000011001
+000101010001
+000011000000
+110111111001
+000100010100
+111100100000
+000001001001
+000010010100
+001110001001
+001001100011
+110000011100
+010000101011
+110110110000
+111111101000
+001011010001
+011001011101
+111000001000
+101101001001
+100100011110
+001100111000
+011011110101
+010001110111
+010001101101
+010011101011
+000010010111
+011111100101
+100111011000
+001011010101
+011110100010
+011100110110
+011101110000
+011000101010
+011110110011
+001101001101
+101110111001
+111101110100
+111010000101
+001010111110
+110101001011
+010010101000
+100010011011
+111001011101
+100000111100
+010011100001
+010101111011
+011010010101
+000110011111
+001110000011
+010101100011
+000010000011
+010000010111
+011111110100
+010010001001
+101101000001
+011100001011
+001110011000
+100001111001
+100011110111
+110010010000
+001100001101
+110001100000
+011010011111
+000000111101
+100010111100
+001000100101
+010101100100
+011110101110
+011010110001
+001111101110
+001111010011
+001110101101
+000001000001
+001110110100
+111101001011
+010000010010
+010100101010
+110011000101
+010101010001
+111110010000
+110100110000
+011101011100
+111000110101
+001001000011
+101111011001
+011100111111
+011000100101
+010001101001
+100001011011
+001010011011
+110001011011
+100010010001
+001010010011
+101111010010
+000001111111
+011101011010
+100100000001
+110011100111
+101100101000
+000100001000
+001011101100
+000001010010
+110001011001
+101000010111
+011100100111
+100101001110
+000100111011
+010110111011
+101110100110
+000011001111
+011110111011
+101101000000
+110011110000
+011001011111
+010011001100
+000100010111
+100000111001
+010110111001
+010000110000
+011000000111
+101010001001
+000010111111
+010100000000
+101100111000
+110010110111
+100100000110
+100110011111
+101011110100
+001111111111
+101011011111
+011111001011
+000010100010
+100000001111
+001111011101
+110101111001
+000101100110
+011110011110
+001110000001
+111101101100
+010000101001
+010011001011
+001000110000
+111000111001
+111000010111
+110011101010
+110010101001
+111110111110
+111110111000
+110110101010
+100010100110
+110111001101
+111110011001
+111111111110
+100000000101
+001000100110
+101111011111
+001000001001
+000000010000
+010101100110
+110110001000
+010100000100
+010101011000
+001010010000
+000110000010
+111010011011
+010000010011
+011110100101
+111111100000
+000100100000
+101001100110
+111011000111
+110010011111
+001000000101
+111000110010
+111010111001
+010000100010
+000001000111
+100110111011
+001111000000
+001101010110
+000010000100
+010001000001
+011110011100
+010101100101
+100001011101
+011010101111
+000101000111
+101001100100
+000000100110
+110101001110
+100100100011
+101101000110
+011010110011
+111010001000
+011110000111
+101000010101
+011001111100
+010110000011
+011010001110
+001010010100
+100111111001
+010011101010
+111110111010
+000101010010
+100010000111
+101011110001
+010110110111
+111001001010
+111010110100
+101010000100
+110010110100
+110100110001
+100011010100
+100101101101
+011010000010
+111100000010
+101110110111
+110001110110
+000001111011
+001100011100
+101011100110
+101011010101
+111101110110
+111011101000
+010110010001
+001000101111
+101000000101
+100110000010
+100111011111
+110110100100
+111100100111
+110100010000
+100001111110
+010111001011
+011001001110
+110011100100
+001001100111
+100100101011
+110000000111
+100010001101
+010101110011
+001010010101
+111111110011
+001111111110
+011010110000
+111111100110
+000001010011
+111011100111
+001111000010
+111101111011
+011101010011
+110000110111
+000010100100
+110001000101
+100111010110
+100010001100
+011011111110
+101111001000
+000010001100
+101010001101
+010011110101
+100001100010
+010001001110
+010101100111
+111011111111
+000010111100
+110100101100
+011111101100
+100100011000
+110110000011
+111100110000
+111100001111
+000101111010
+111110110110
+110101110001
+101110000010
+010000010001
+100111100100
+000000010001
+010111100100
+011100001010
+111011101100
+111101001100
+111011110000
+101100011011
+000110001111
+011110010111
+000111101010
+001110001101
+010010001011
+000100010101
+101001001101
+001001010110
+011100110010
+010111100111
+100010111111
+011010001111
+000010010001
+111000000000
+111100110111
+100101000101
+101001000111
+101001000001
+101100001111
+000100101010
+111100000001
+111100101110
+110100101110
+001011011010
+000010001101
+101100000100
+010100000101
+010010000011
+000010100101
+110100111111
+001011101110
+011000100010
+000111100101
+010111110100
+100010110110
+000111010001
+000011100000
+110010000100
+100111001101
+010011111110
+000010100000
+001001001010
+110101100111
+011100101001
+001011001110
+111010000000
+010011001000
+001000010011
+010001011000
+010010100110
+100010000000
+100010101100
+101011111001
+010001001101
+110111110100
+110000000000
+001100000110
+000111110010
+000100011011
+001100001000
+011000000010
+001101100000
+111101000111
+101110001100
+100011101111
+010001010011
+110010011110
+111010101110
+011011010101
+100110001110
+110000101110
+101111111001
+101110110011
+000100001111
+001101110011
+011111100011
+100001100001
+101100001010
+010010110110
+110110010000
+110000110001
+100001100000
+110111010001
+000101100111
+100110100010
+111100001001
+111001010100
+001111101001
+101000010110
+000001110011
+110111101101
+010100000111
+110100111011
+111000011101
+110011001001
+110111101000
+010010100100
+000011111010
+010101001000
+101110011001
+100000011001
+111010001011
+000000100001
+111110010100
+100101001101
+010110011010
+000110010110
+111000001110
+111111100001
+101111100011
+111101100011
+011100000011
+110111111000
+011111110110
+010010110111
+101001000110
+011111000100
+100111100011
+101101100101
+000000101111
+001101010000
+000010000001
+000001110101
+001011000010
+000011000111
+001011001111
+101101011110
+100100110001
+110000011011
+010010011100
+011100110101
+000011110100
+010000110001
+100010111001
+001101001111
+101101100100
+010001111001
+111110011010
+100001100011
+101011001000
+100110111111
+100101001010
+011110101111
+001101011001
+000101000001
+001010111000
+010100110111
+101111110100
+001110111011
+101100000110
+101011001001
+100011011000
+100100111100
+111110110000
+000001100010
+000101100000
+110000100001
+011000011010
+110000010111
+111111001010
+001111100001
+111011110100
+100110010011
+111010110000
+110111010000
+100010011110
+110011100110

+ 86 - 0
day3_binary_diagnostic/main.py

@@ -0,0 +1,86 @@
+import os, sys
+import numpy as np
+
+task_dir = os.path.dirname(__file__)
+sys.path.append(f"{task_dir}/..")
+from get_tasks import get_input, check_example, generate_readme
+
+
+def bits2num(bits: np.ndarray) -> int:
+    return (bits * 2 ** np.arange(bits.shape[0] - 1, -1, -1)).sum()
+
+
+def part1(input):
+
+    diagnostics = np.array(
+        [list(bits.replace("\n", "")) for bits in input], dtype=np.uint8
+    )
+    a = diagnostics.sum(axis=0)
+    b = diagnostics.shape[0] - a
+    gamma = (a > b).astype(np.uint)
+    epsilon = 1 - gamma
+    gamma_decimal = bits2num(gamma)
+    epsilon_decimal = bits2num(epsilon)
+
+    print(
+        f"The gamma rate is {gamma_decimal}, and the epsilon rate is {epsilon_decimal}."
+    )
+    print(
+        f"The power comnsuimpsion of the submarine and the answer of part1 is: {gamma_decimal * epsilon_decimal}"
+    )
+
+
+def filter_array(array: np.ndarray, CO2: bool) -> np.ndarray:
+    for ind in range(array.shape[1]):
+        a = array.sum(axis=0)
+        b = array.shape[0] - a
+        c = (a >= b).astype(np.uint)
+        if CO2:
+            c = 1 - c
+        if (temp := array[array[:, ind] == c[ind]]).size != 0:
+            array = temp
+        else:
+            break
+    return array
+
+
+def part2(input):
+
+    diagnostics = np.array(
+        [list(bits.replace("\n", "")) for bits in input], dtype=np.uint8
+    )
+    O2 = filter_array(diagnostics, False)
+    CO2 = filter_array(diagnostics, True)
+    O2_decimal = bits2num(O2[0])
+    CO2_decimal = bits2num(CO2[0])
+    print(f"The oxygen generator rating is {O2_decimal}")
+    print(f"The CO2 scrubber rating is  {CO2_decimal}")
+    print(
+        f"The life support raiting and the answer of part2 is: {O2_decimal*CO2_decimal}"
+    )
+
+
+if __name__ == "__main__":
+    import timeit
+
+    input, example = get_input(task_dir, 3)
+    setup = """
+    
+from __main__ import part1, part2
+import os, sys
+import numpy as np
+task_dir = os.path.dirname(__file__)
+sys.path.append(f"{task_dir}/..")
+from get_tasks import get_input
+input, example = get_input(task_dir, 3)
+    """
+
+    check_example(example, part1)
+    check_example(example, part2)
+    part1(input)
+    print("\n")
+    part2(input)
+    # meas = timeit.timeit("part2(input)", setup=setup, number=100)
+    # print((meas))
+
+    generate_readme(task_dir, 3)

+ 8 - 0
day3_binary_diagnostic/src/main.rs

@@ -0,0 +1,8 @@
+#![allow(dead_code)]
+#![allow(unused_variables)]
+
+fn main() {}
+
+fn part1() {
+    
+}

+ 8 - 0
day4_giant_squid/Cargo.toml

@@ -0,0 +1,8 @@
+[package]
+name = "day4_giant_squid"
+version = "0.1.0"
+edition = "2021"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]

+ 102 - 0
day4_giant_squid/README.md

@@ -0,0 +1,102 @@
+--- Day 4: Giant Squid ---
+--------------------------
+
+You're already almost 1.5km (almost a mile) below the surface of the ocean, already so deep that you can't see any sunlight. What you *can* see, however, is a giant squid that has attached itself to the outside of your submarine.
+
+
+Maybe it wants to play [bingo](https://en.wikipedia.org/wiki/Bingo_(American_version))?
+
+
+Bingo is played on a set of boards each consisting of a 5x5 grid of numbers. Numbers are chosen at random, and the chosen number is *marked* on all boards on which it appears. (Numbers may not appear on all boards.) If all numbers in any row or any column of a board are marked, that board *wins*. (Diagonals don't count.)
+
+
+The submarine has a *bingo subsystem* to help passengers (currently, you and the giant squid) pass the time. It automatically generates a random order in which to draw numbers and a random set of boards (your puzzle input). For example:
+
+
+
+```
+7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
+
+22 13 17 11  0
+ 8  2 23  4 24
+21  9 14 16  7
+ 6 10  3 18  5
+ 1 12 20 15 19
+
+ 3 15  0  2 22
+ 9 18 13 17  5
+19  8  7 25 23
+20 11 10 24  4
+14 21 16 12  6
+
+14 21 17 24  4
+10 16 15  9 19
+18  8 23 26 20
+22 11 13  6  5
+ 2  0 12  3  7
+
+```
+
+After the first five numbers are drawn (`7`, `4`, `9`, `5`, and `11`), there are no winners, but the boards are marked as follows (shown here adjacent to each other to save space):
+
+
+
+```
+22 13 17 *11*  0         3 15  0  2 22        14 21 17 24  *4*
+ 8  2 23  *4* 24         *9* 18 13 17  *5*        10 16 15  *9* 19
+21  *9* 14 16  *7*        19  8  *7* 25 23        18  8 23 26 20
+ 6 10  3 18  *5*        20 *11* 10 24  *4*        22 *11* 13  6  *5*
+ 1 12 20 15 19        14 21 16 12  6         2  0 12  3  *7*
+
+```
+
+After the next six numbers are drawn (`17`, `23`, `2`, `0`, `14`, and `21`), there are still no winners:
+
+
+
+```
+22 13 *17* *11*  *0*         3 15  *0*  *2* 22        *14* *21* *17* 24  *4*
+ 8  *2* *23*  *4* 24         *9* 18 13 *17*  *5*        10 16 15  *9* 19
+*21*  *9* *14* 16  *7*        19  8  *7* 25 *23*        18  8 *23* 26 20
+ 6 10  3 18  *5*        20 *11* 10 24  *4*        22 *11* 13  6  *5*
+ 1 12 20 15 19        *14* *21* 16 12  6         *2*  *0* 12  3  *7*
+
+```
+
+Finally, `24` is drawn:
+
+
+
+```
+22 13 *17* *11*  *0*         3 15  *0*  *2* 22        *14* *21* *17* *24*  *4*
+ 8  *2* *23*  *4* *24*         *9* 18 13 *17*  *5*        10 16 15  *9* 19
+*21*  *9* *14* 16  *7*        19  8  *7* 25 *23*        18  8 *23* 26 20
+ 6 10  3 18  *5*        20 *11* 10 *24*  *4*        22 *11* 13  6  *5*
+ 1 12 20 15 19        *14* *21* 16 12  6         *2*  *0* 12  3  *7*
+
+```
+
+At this point, the third board *wins* because it has at least one complete row or column of marked numbers (in this case, the entire top row is marked: `*14 21 17 24 4*`).
+
+
+The *score* of the winning board can now be calculated. Start by finding the *sum of all unmarked numbers* on that board; in this case, the sum is `188`. Then, multiply that sum by *the number that was just called* when the board won, `24`, to get the final score, `188 * 24 = *4512*`.
+
+
+To guarantee victory against the giant squid, figure out which board will win first. *What will your final score be if you choose that board?*
+
+
+--- Part Two ---
+----------------
+
+On the other hand, it might be wise to try a different strategy: let the giant squid win.
+
+
+You aren't sure how many bingo boards a giant squid could play at once, so rather than waste time counting its arms, the safe thing to do is to *figure out which board will win last* and choose that one. That way, no matter which boards it picks, it will win for sure.
+
+
+In the above example, the second board is the last to win, which happens after `13` is eventually called and its middle column is completely marked. If you were to keep playing until this point, the second board would have a sum of unmarked numbers equal to `148` for a final score of `148 * 13 = *1924*`.
+
+
+Figure out which board will win last. *Once it wins, what would its final score be?*
+
+

+ 19 - 0
day4_giant_squid/example.txt

@@ -0,0 +1,19 @@
+7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
+
+22 13 17 11  0
+ 8  2 23  4 24
+21  9 14 16  7
+ 6 10  3 18  5
+ 1 12 20 15 19
+
+ 3 15  0  2 22
+ 9 18 13 17  5
+19  8  7 25 23
+20 11 10 24  4
+14 21 16 12  6
+
+14 21 17 24  4
+10 16 15  9 19
+18  8 23 26 20
+22 11 13  6  5
+ 2  0 12  3  7

+ 601 - 0
day4_giant_squid/input.txt

@@ -0,0 +1,601 @@
+26,38,2,15,36,8,12,46,88,72,32,35,64,19,5,66,20,52,74,3,59,94,45,56,0,6,67,24,97,50,92,93,84,65,71,90,96,21,87,75,58,82,14,53,95,27,49,69,16,89,37,13,1,81,60,79,51,18,48,33,42,63,39,34,62,55,47,54,23,83,77,9,70,68,85,86,91,41,4,61,78,31,22,76,40,17,30,98,44,25,80,73,11,28,7,99,29,57,43,10
+
+57 12 60 96 93
+73 87 63 70 91
+74 32 43 67 46
+59 34  5 35 82
+53 40 55 29  1
+
+48 71 59 45 63
+13 42 23 95 39
+84 82 10 29  4
+16 91 32 92 62
+99 33 20 21  3
+
+51 20 32 30 90
+86 88 89  1 73
+ 5 64 78 81 22
+95 50  7 27 17
+39 82 46 35 92
+
+ 2 65 21 77 97
+50 46 38 99 82
+22  1 24 63 70
+ 8 32 80 98 35
+57 67 25 81 18
+
+64  7 26 44 14
+42 71 19 22  0
+ 4 36 51 25  6
+69 59 90 15 88
+85 65 32 76 70
+
+ 8 69 75 42 44
+64 25 72 71 34
+ 2 94 81 14 38
+97 89 59 23 88
+57 70 13  1 51
+
+93 94 26 11 35
+63 57 84 10 92
+12 29 78 65 64
+54 75 61 50 81
+13 90  2 66 99
+
+10 21 39 24 56
+90 49 25 80 59
+41 72 47 74 79
+ 9 89 42 92 31
+20  1 32 58 83
+
+81 11 58  2 69
+79 23 60  8 63
+94  9  0 45 34
+36 31 61 71 74
+51 48 59 99 70
+
+66 47 88 16 18
+35 75 54 26 77
+23 55 33  3 19
+82 71 57 80 45
+22  8 40 76 20
+
+ 8  5 95 86 76
+49 21 82 78 77
+12 38 61 85  4
+14 54 42 40 39
+69 66  1  0  7
+
+85 66 96 45 64
+25 55 36 76 37
+82 61 29 47 54
+73 94  3 59 24
+71 62 31 98 79
+
+84 10 60 61 97
+75 90 95  6  8
+93 89 65 70 80
+35 15 46 55 77
+52  3 74 39 36
+
+80 24 59 71 52
+17 43 45  8  6
+58 22 32 46 98
+48  3 56 31 77
+97 28 55  0 76
+
+51 98 12 49 19
+28 94  9 97 85
+ 5 78 47 93 24
+67  0 37 81 76
+77 48 15 69 50
+
+34 45  5 80 14
+82 42 63  2 86
+ 3 95 54 74 69
+46 27 49 92 66
+ 0 85 98 83 17
+
+41 99 93 62 96
+90 30 10  5 94
+98 32 83 78 25
+76 27 29 19 35
+58 91 34 31  3
+
+31  1 24 96 36
+58 12 59 57 92
+84  5 55 49 41
+54 72 70 95 88
+66 50 22 35 15
+
+35 57 69 13 93
+34 62 28 26 36
+ 6 64 47 74 45
+ 0 32 19 33 44
+65 25 90 91  1
+
+57 96 70 15 89
+ 7 65 29 12 34
+40 25 36 81 86
+58 39 27 79 59
+19 91 47  6 11
+
+60 74 67 87 68
+80 53 42 91 89
+11 19  8 78 31
+ 4  6 30 10 90
+64 41 27 59 12
+
+45  0 86 81 34
+ 8 29 53 12 32
+89 74 64 26 96
+60 13 87 35 73
+52 69 23 46 40
+
+43 35  1 59 40
+63 74  7 53 94
+39 42  8 84 27
+66 65 46 82 80
+61 76 13 31 45
+
+38  4 51 76  5
+36 57  3 86 84
+83 37 60 67 52
+ 0 70  7 19 72
+62 99  9 75 58
+
+95 47 78 27 14
+50 82 17 15 22
+ 1 76 64 73 71
+24 26 42 79 55
+36 40 43 81 59
+
+13  7 60 49 87
+30 31 99 19 82
+91 88 53 96 97
+37 11 47 32 81
+86 94 45 71 38
+
+64 42 19  6 69
+33  2 61 98 55
+20 48  5 82 56
+78 11 65 59 74
+85 72  1 54 29
+
+76 56 84 34 83
+16 26 33 50  3
+85 20 87 31 51
+62  7 28 96  8
+81 57 89 44 58
+
+92 49 58  8 45
+47 89 48 91 71
+53 67 37 59 88
+24 69 96 61 16
+ 2  6 68 95 60
+
+99 60 39 96  0
+62 14 77 70 47
+72 98 66 42 58
+85 19 12 23 44
+68 28 51 94 82
+
+59 32 45 99 92
+96 36 30 87  9
+61 54 71 94 22
+76  4 62 20  2
+40 18 43 70 44
+
+22 54 77 12  3
+ 5 11 41 19 58
+49 51 75 24 63
+42 20 43 92 69
+62 36 15 25 80
+
+93 40 48 21 10
+ 0 83 86 31 65
+52  7 17 67 72
+95 28 63 99 47
+51 22 85 55 44
+
+43 26 86 80 94
+93 66 84 90 61
+91 58 71 73 89
+ 9 72 81 48 54
+11 60 36 25 70
+
+33 42 73 20 69
+15 12 27 72 14
+93 30 89 86 22
+77 25 80 85 74
+66 78  0 49 82
+
+37 84 46 86 39
+55 31 96 17 43
+12 33 45 97  9
+44 57 25 77 78
+ 5 73 81 35 58
+
+19 41 87 94 59
+97 84 78 52 77
+70 15 91 53  1
+71 47 82 35 99
+25 55 58 39 29
+
+29 74 31 73 72
+23 10 83 63 25
+18 26 79 35 65
+59 44 98 45 20
+67  7 87 28 11
+
+83 89 92 55 72
+32  6 78 93 49
+66 77  5 60 61
+85 57 29 97 65
+86 84 48 20 75
+
+85 82 83 66 86
+64 61 77 38 84
+ 1 68  4 18 72
+56 97 37 98 74
+44 14 78 52 93
+
+30 73 72 24 51
+78  3 97 39  5
+90 42 58 96 17
+33 95 44 27  1
+80 16 84 54 99
+
+92 88 79 14 10
+24 52 80 46 51
+11 31 35 53 25
+44 54 63 33 93
+87 38 15 64  4
+
+14 25 61 40 95
+34 17 97 38 26
+64 90 45 91 65
+ 8 50 23 11 74
+32 33 22 88 28
+
+ 8 32 94 72 74
+27 29 22  2 76
+58 54 80  5 35
+36 24 83 59 25
+21 31 48 39  4
+
+56 13 22 53 72
+61 60 81 87 86
+ 7 74 98 28 11
+67 38 91 23  0
+42 84 24  3 47
+
+29 98 43 45 30
+86 50 15 60 11
+18 34  8 67 24
+36 97 69 27 79
+35 87 52 55 61
+
+40 50 30 75 72
+ 1 62 85 21 11
+80 10 91  7  2
+27 31 73 25 29
+63 65 55 87 23
+
+12 68 47 77 76
+98 30  6 51 80
+22 85 88 99 24
+35 90 82 18 37
+17 27 34 54 43
+
+85 46 35 16 45
+ 4  6 96  9 61
+44 90 64 29 50
+76 38 69 80 28
+27 23 51  8  7
+
+72  8 62 61 83
+ 0 30 92 29  7
+86 28 54 52  5
+32 97 82 68 31
+76 69 22 12 13
+
+66 67  1 36 94
+80 99 49 47 38
+76 95 30 13 19
+83 21 45 44 43
+29 91 14 20 98
+
+ 8 80  3 82 99
+62 41 47  6 27
+12 72 76 81 36
+30  7 67 90  5
+85 31 83 49 19
+
+25 91 86 47 27
+69 74 20 17 97
+59 45 87 28 75
+49 94 63 33  9
+ 8 66  2 30 32
+
+69 58 41 84  5
+27  2 22 65 88
+63 96 90 17 85
+26 52 86 20  8
+ 3  9 59 50 57
+
+80 85 90  5 56
+66 57 76 65 62
+81 74 15 38 32
+ 0 75 61 16 79
+96 50  8 86  1
+
+52 21 98 54 94
+73 90 87 58 50
+38 39 30 69 82
+55 12 81 48 29
+93 23 91 47 28
+
+92 14  3  1 19
+18 27 91 62 86
+61 80 49 53 97
+77 98 52  0  8
+17 54 85 59 51
+
+49 45 38 70 33
+96 18 63  5 99
+65 58 29 91 19
+78  7 98 39 17
+31 15 13 35 75
+
+55 50 58 96 94
+67 72  4 40 90
+59 31 15 78 81
+ 1 80 56 34 20
+27 52 88 75 53
+
+ 0  5 91 65 72
+53 42  4 50 25
+13 52 81 79 92
+46 89 55 58 95
+19 77 30 36 18
+
+38 97 86 69 44
+70 52 14 19 29
+ 9 36 96 24 80
+84 22 32 72 48
+28  3 46 42 87
+
+94 93 31 33 38
+21 30 34 69 35
+ 1 10 55 79 57
+54 28 44 78 73
+ 8 20 45 41 23
+
+32 13 49 80 68
+41 95 84 74 57
+15 61  5 77 67
+53 54 29 51 75
+24 66 36 88 90
+
+74 49 19  2 66
+94 45 30 84 37
+ 7 24 22 87 60
+13 40 57  9  1
+56 42 92 67 27
+
+29  7 97 22 36
+80 77 92  3 67
+48 54 73 51 41
+28  8 55 24  4
+13 11 66  5 86
+
+76 16  8 71 92
+23 61 53 27 43
+25  6 17 32 64
+40 69 21 84 93
+89 30 55 90 41
+
+86 22 81 13 33
+35 87 82 77 71
+96 65 37 62 51
+16 72 36 93 23
+84 44 26 66 27
+
+ 4 73 52 35 43
+39  9 96 34 70
+19 67 38 10 54
+21  7 36 13 90
+84 28 59 57 75
+
+55  7 32 68 97
+10 56 46 28 66
+74 81 18 73 26
+44 76 13 35 61
+90 36 45 64 58
+
+96 62 97 87 95
+45 78 38 84 41
+91 19 88 25 22
+12 27 31 92  5
+15 83  7 53 71
+
+31 17 96  6 47
+ 3 90 27 89 75
+53 39 62 82 13
+52 34 23 83 87
+19 67 50 98 84
+
+96  3 70 17 42
+50 74 65 53 31
+52 80 18 26 77
+29 57 95 25 81
+88 92 55 13 28
+
+63 34 56  1  4
+40 97 10  5 50
+96 55 15 68 37
+43 33 89 72  3
+11 88 44 86  2
+
+65 44 24 34 41
+ 1 68 67  6 26
+27 88 73 25  9
+55 56 16 48 29
+33 18 77  3 94
+
+91 75 35 33 56
+96 19 69 81 53
+25 14 32 74 22
+24  6 89 42 90
+ 9  2 77 67 20
+
+19 97 36 78 71
+16 26 99 23 92
+10 68 74 90 88
+30 60 96 11 34
+ 8 76 35 53 22
+
+84 15 76 31 63
+ 1 34 96 70 35
+66 57 71 26 61
+83 41 74 85 60
+16 28 30 23 49
+
+72 88 56 92 86
+12 44 71 47 30
+39 53  4 46 45
+38  5  9 35 25
+ 8 61 13 50 82
+
+62 92 49 21 95
+70 47 73 74 56
+17 89  0 39 60
+42 99 13 63 67
+43 16 11 20 84
+
+13 30 59 84 12
+52 88 79 62 29
+99 39 95 55 70
+80 46 31 89 69
+74 71 65  3 38
+
+47 86 21 24 22
+ 0 62 69 38 59
+27 10 41 81 92
+14 51 35 13 17
+30 15  7 71 70
+
+25 26 29 66 32
+68 46 77 45 86
+14 15 90 40 22
+ 6 36 17 76  1
+80 55 83 98 79
+
+98 76 58 27 39
+45 90 56 46 69
+10 41 54 82 25
+94 86 89 33 79
+16 30 87 24 83
+
+66 28 93 91 68
+71 51 22 10 42
+29 20 77 17  8
+55 39 89 72 12
+98 78 65 48 41
+
+49 25 80 64 99
+90  9 40 76 63
+60 93 46  4 27
+17  0 42 33 28
+59 26 18 69 75
+
+35  0 76 58 31
+87 17 42 13 33
+70 67 61 52 12
+59 85 64 80  1
+ 4 73 99 55 48
+
+40 73 94 80 90
+ 9 93 17 51 62
+96  0 57 82 47
+86 27 64 95 84
+16 99 37 41 44
+
+ 8 96 31 26 50
+20 69 75 82 89
+94 42 38 78 35
+83 13 45 62 43
+97 14 34 17 47
+
+35 88 38  7 97
+ 8 79 51 74 26
+60 22 53  5 33
+63 23 69  0 83
+21 44 91 95 18
+
+64 77  4  0 15
+80 66  9 16  5
+75  8 18 40 91
+72  1 49 60 97
+14 24 34 65 92
+
+84 75 31 56 55
+17 92 48 45 89
+88 52 10 90 47
+91 97  6 39 79
+99 65 11 42 93
+
+ 7 82 10 88 49
+11 66 54  3 53
+ 4 73 71 42 92
+22 75 84 16 48
+ 5 94 79 96 45
+
+20 87 16 25  9
+15 70 19 72 56
+71 37 69  2 62
+76 97 41  8 92
+40 65 86  0 32
+
+81 48 14 75  4
+70 30  6 74 62
+15 28 55 22 63
+36 32 35 86 71
+29 47 59 18 78
+
+10 35 27 14 64
+43 19 86 71 36
+32 79  9 51 91
+17 67 26 41 56
+15  1 95 13 65
+
+74 79 22 30 46
+80 55 57 14 37
+59 88 40 83 56
+63 10 97 64  7
+77 61 53 91 20
+
+53 81 13 72 67
+79 10 71 11  8
+ 0 99 60 20  4
+ 7 45 89 66 98
+50 36 80 57  5
+
+ 5  7 35  4 29
+28 65 31 86 33
+66 98 75 13 92
+38 67 80 46 11
+ 9 15 57 71 32
+
+21 33 22 77  5
+ 0  6 59 37 69
+50 45 32 60 96
+ 9 39 28 56 57
+34 46 43 52 25
+
+67 11 21 53 60
+52 58 54 94 47
+84 46 72 81 16
+31 51 23 36 97
+80 43 75 99 79

+ 63 - 0
day4_giant_squid/main.py

@@ -0,0 +1,63 @@
+import os, sys
+import numpy as np
+
+task_dir = os.path.dirname(__file__)
+sys.path.append(f"{task_dir}/..")
+from get_tasks import get_input, check_example, generate_readme
+
+
+def parse_input(input: str) -> tuple[np.ndarray, np.ndarray]:
+    with open(input, "r") as f:
+        inputs = f.read().split("\n\n")
+        numbers = np.fromstring(inputs.pop(0), dtype=int, sep=",")
+        boards = np.array(
+            [np.fromstring(board, dtype=int, sep=" ").reshape(5, 5) for board in inputs]
+        )
+    return numbers, boards
+
+
+def part1(input: str):
+    numbers, boards = parse_input(input)
+    for round, num in enumerate(numbers):
+        boards[boards == num] = -1
+        for axis in [1, 2]:
+            if np.any(check := np.all(boards == -1, axis=axis)):
+                num_of_board = np.where(check)[0]
+                board = boards[num_of_board]
+                print(f"Winner board is: \n\n{board}\n")
+                board[board == -1] = 0
+                board.sum()
+                print(
+                    f"Sum of all unmarked numbers is {board.sum()} and last number is {num} at the round {round}"
+                )
+                print(f"And the anwser of part1 is: {board.sum() * num}")
+                return
+
+
+def part2(input: str):
+    numbers, boards = parse_input(input)
+    for round, num in enumerate(numbers):
+        boards[boards == num] = -1
+        for axis in [1, 2]:
+            if np.any(check := np.all(boards == -1, axis=axis)):
+                num_of_board = np.where(check)[0]
+                prev_board = boards[num_of_board]
+                boards = np.delete(boards, num_of_board, 0)
+            if boards.shape[0] == 0:
+                prev_board[prev_board == -1] = 0
+                print(f"The last win board is \n\n {prev_board}\n")
+                print(f"At the round {round} and with number {num}")
+                print(f"Th sum of all unmarked mumners is {prev_board.sum()}")
+                print(f"The answer of the part2 is: {prev_board.sum()* num}")
+                return
+
+
+if __name__ == "__main__":
+
+    _, _ = get_input(task_dir, 4)
+    check_example("example.txt", part1)
+    check_example("example.txt", part2)
+    part1("input.txt")
+    print("\n")
+    part2("input.txt")
+    generate_readme(task_dir, 4)

+ 3 - 0
day4_giant_squid/src/main.rs

@@ -0,0 +1,3 @@
+fn main() {
+    println!("Hello, world!");
+}

+ 47 - 3
get_tasks.py

@@ -1,5 +1,30 @@
-import requests
 import os
+import requests
+import bs4
+import markdownify as md
+from typing import Any, Callable
+
+
+def generate_readme(task_dir, day):
+
+    readme_path = os.path.join(task_dir, "README.md")
+    cookies_dict = {
+        "session": "53616c7465645f5ffe3db8d154199da4d6e4e569142fda21d3350f5e550f2a4c509bd1b147264ffe0a0d2124909ec5d6"
+    }
+
+    if os.path.exists(readme_path):
+        pass
+    else:
+        soup = bs4.BeautifulSoup(
+            requests.get(
+                f"https://adventofcode.com/2021/day/{day}", cookies=cookies_dict
+            ).content
+        )
+        with open(readme_path, "w") as readme:
+            readme.write(md.markdownify(str(soup.find_all("article")[0])))
+        if len(soup.find_all("article")) > 1:
+            with open(readme_path, "a") as readme:
+                readme.write(md.markdownify(str(soup.find_all("article")[1])))
 
 
 def get_input(task_dir, day):
@@ -17,17 +42,36 @@ def get_input(task_dir, day):
         input = requests.get(
             f"https://adventofcode.com/2021/day/{day}/input", cookies=cookies_dict
         ).text
+
         with open(input_path, "w") as f:
             f.write(input)
+
         input = input.splitlines()
+
     if os.path.exists(example_path):
         with open(example_path, "r") as e:
             example = e.readlines()
     else:
-        example = None
+        example = bs4.BeautifulSoup(
+            requests.get(
+                f"https://adventofcode.com/2021/day/{day}", cookies=cookies_dict
+            ).content
+        ).code.text
+
+        with open(example_path, "w") as f:
+            f.write(example)
+
+        example = example.splitlines()
 
     return input, example
 
 
+def check_example(example: Any, part: Callable):
+    print(f'\n{10*"-"}Example test here{10*"-"}\n')
+    part(example)
+    print(f'\n{10*"-"}End example test{10*"-"}\n')
+
+
 if __name__ == "__main__":
-    print(get_input("day_1_sonar_sweep", 1))
+    # print(get_input("day_1_sonar_sweep", 3))
+    generate_readme("../day3_binary_diagnostic", 3)

Някои файлове не бяха показани, защото твърде много файлове са промени