Skip to content

Commit ed5bca7

Browse files
authored
Update Solution.cs
1 parent 7a3e42b commit ed5bca7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

2022/Day09/Solution.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class Solution : Solver {
1010
public object PartOne(string input) => Tails(input, 2).ToHashSet().Count;
1111
public object PartTwo(string input) => Tails(input, 10).ToHashSet().Count;
1212

13+
// Moves a rope with the given length according to the input and
14+
// returns the position of its tail in each step.
1315
private IEnumerable<Knot> Tails(string input, int ropeLength) {
1416
var rope = Enumerable.Repeat(new Knot(0, 0), ropeLength).ToArray();
1517
yield return rope.Last();

0 commit comments

Comments
 (0)