We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a3e42b commit ed5bca7Copy full SHA for ed5bca7
2022/Day09/Solution.cs
@@ -10,6 +10,8 @@ class Solution : Solver {
10
public object PartOne(string input) => Tails(input, 2).ToHashSet().Count;
11
public object PartTwo(string input) => Tails(input, 10).ToHashSet().Count;
12
13
+ // Moves a rope with the given length according to the input and
14
+ // returns the position of its tail in each step.
15
private IEnumerable<Knot> Tails(string input, int ropeLength) {
16
var rope = Enumerable.Repeat(new Knot(0, 0), ropeLength).ToArray();
17
yield return rope.Last();
0 commit comments