File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
internal/puzzles/solutions/2017/day02 Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ func (s solution) Year() string {
2828
2929func (s solution ) Part1 (input io.Reader ) (string , error ) {
3030 var f checksumFunc = func (row []string ) (int , error ) {
31- var min , max int
31+ var minVal , maxVal int
3232
3333 for i , number := range row {
3434 d , err := strconv .Atoi (number )
@@ -37,19 +37,19 @@ func (s solution) Part1(input io.Reader) (string, error) {
3737 }
3838
3939 if i == 0 {
40- min , max = d , d
40+ minVal , maxVal = d , d
4141 }
4242
43- if d < min {
44- min = d
43+ if d < minVal {
44+ minVal = d
4545 }
4646
47- if d > max {
48- max = d
47+ if d > maxVal {
48+ maxVal = d
4949 }
5050 }
5151
52- return max - min , nil
52+ return maxVal - minVal , nil
5353 }
5454
5555 return findChecksum (input , f )
You can’t perform that action at this time.
0 commit comments