You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: advent-of-code/2018/day-01/README.md
+12-12
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,17 @@ After feeling like you've been falling for a few minutes, you look at the device
4
4
5
5
For example, if the device displays frequency changes of `+1, -2, +3, +1`, then starting from a frequency of zero, the following changes would occur:
6
6
7
-
- Current frequency `0`, change of `+1`; resulting frequency `1`.
8
-
- Current frequency `1`, change of `-2`; resulting frequency `-1`.
9
-
- Current frequency `-1`, change of `+3`; resulting frequency `2`.
10
-
- Current frequency `2`, change of `+1`; resulting frequency `3`.
7
+
- Current frequency `0`, change of `+1`; resulting frequency `1`.
8
+
- Current frequency `1`, change of `-2`; resulting frequency `-1`.
9
+
- Current frequency `-1`, change of `+3`; resulting frequency `2`.
10
+
- Current frequency `2`, change of `+1`; resulting frequency `3`.
11
11
12
12
In this example, the resulting frequency is `3`.
13
13
14
14
Here are other example situations:
15
15
16
-
-`+1, +1, +1` results in `3`
17
-
-`+1, +1, -2` results in `0`
16
+
-`+1, +1, +1` results in `3`
17
+
-`+1, +1, -2` results in `0`
18
18
-`-1, -2, -3` results in `-6`
19
19
20
20
Starting with a frequency of zero, **what is the resulting frequency** after all of the changes in frequency have been applied?
@@ -25,13 +25,13 @@ You notice that the device repeats the same frequency change list over and over.
25
25
26
26
For example, using the same list of changes above, the device would loop as follows:
27
27
28
-
- Current frequency `0`, change of `+1`; resulting frequency `1`.
29
-
- Current frequency `1`, change of `-2`; resulting frequency `-1`.
30
-
- Current frequency `-1`, change of `+3`; resulting frequency `2`.
31
-
- Current frequency `2`, change of `+1`; resulting frequency `3`.
28
+
- Current frequency `0`, change of `+1`; resulting frequency `1`.
29
+
- Current frequency `1`, change of `-2`; resulting frequency `-1`.
30
+
- Current frequency `-1`, change of `+3`; resulting frequency `2`.
31
+
- Current frequency `2`, change of `+1`; resulting frequency `3`.
32
32
- (At this point, the device continues from the start of the list.)
33
-
- Current frequency `3`, change of `+1`; resulting frequency `4`.
34
-
- Current frequency `4`, change of `-2`; resulting frequency `2`, which has already been seen.
33
+
- Current frequency `3`, change of `+1`; resulting frequency `4`.
34
+
- Current frequency `4`, change of `-2`; resulting frequency `2`, which has already been seen.
35
35
36
36
In this example, the first frequency reached twice is `2`. Note that your device might need to repeat its list of frequency changes many times before a duplicate frequency is found, and that duplicates might be found while in the middle of processing the list.
Copy file name to clipboardExpand all lines: advent-of-code/README.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# :christmas_tree: Advent of Code
2
2
3
-
[Advent of Code](http://adventofcode.com) is an event where each year, starting on December 1st and ending on December 25th, a new programming puzzle is posted once a day. Advent of Code began in 2015.
3
+
[Advent of Code](https://adventofcode.com/) is an event where each year, starting on December 1st and ending on December 25th, a new programming puzzle is posted once a day. Advent of Code began in 2015.
0 commit comments