/AdventOfCode

My solutions for Advent of Code 2021

Primary LanguageC++

AdventOfCode


My attempt at Advent of Code 2021


What is Advent of Code?

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.

~ via About - Advent of Code 2021


Side Learnings


Wrote a bash script to create the folder structure like this.


day
|__part1.cpp
|__part2.cpp

Find the bash script here.


for num in {1..25}
do
if [ $num -lt 10 ]
then
    mkdir 0$num
    cd 0$num
        > 1.cpp
        > 2.cpp
else
    mkdir $num
    cd $num
        > 1.cpp
        > 2.cpp
fi
cd ..
done

or simply šŸ¤­

for num in {1..25}; do if [ $num -lt 10 ]; then mkdir 0$num; cd 0$num; > 1.cpp; > 2.cpp; else mkdir $num; cd $num; > 1.cpp; > 2.cpp; fi; cd ..; done

Author

Tushar Nankani