Another harder problem. The first part was pretty simple and didn't take me too much time to solve, but adapting for the second part of the problem took a lot more time.
27 posts tagged with "C#"
View All TagsDay 10: The Stars Align
So this one really took me by surprise at the start and had me trying a lot of different stuff to find the best solution.
Day 9: Marble Mania
Today's problem came with a pretty complex explanation, but solving the first part was pretty simple. I created a MarbleGame class that dealt with the actual game mechanics. My solution was pretty straight forward by using a list to save the circle's state and loop through each marble. It worked pretty good for finding the solution for the first part of the problem.
Day 8: Memory Maneuver
First problem where I used recursion. Traversing trees is just so much easier with recursion.
Day 7: The Sum of Its Parts
Nice little graph problem today. I started by creating a Step class which contained references to other steps it depended on. The first part was then solved by looping and flagging steps as completed until all step where completed. Finding the next step to complete simply involved a little LINQ to determine the first (considering a list of steps ordered alphabetically) incomplete step for which all its requirements are completed: