File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 77	"slices" 
88
99	"github.com/agrmohit/aoc/internal/inputs" 
10- 	mathinternal  "github.com/agrmohit/aoc/internal/math " 
10+ 	"github.com/agrmohit/aoc/internal/mathutils " 
1111)
1212
1313//go:embed input.txt 
@@ -25,7 +25,7 @@ func solvePart1(input string) int {
2525	totalDistance  :=  0 
2626
2727	for  i  :=  range  left  {
28- 		totalDistance  +=  mathinternal .Abs (left [i ] -  right [i ])
28+ 		totalDistance  +=  mathutils .Abs (left [i ] -  right [i ])
2929	}
3030
3131	return  totalDistance 
Original file line number Diff line number Diff line change 66	"slices" 
77
88	"github.com/agrmohit/aoc/internal/inputs" 
9- 	mathinternal  "github.com/agrmohit/aoc/internal/math " 
9+ 	"github.com/agrmohit/aoc/internal/mathutils " 
1010)
1111
1212//go:embed input.txt 
@@ -28,7 +28,7 @@ func checkIsSafe(row []int) bool {
2828		}
2929
3030		// If absolute difference between consecutive numbers is not 1, 2 or 3 
31- 		if  mathinternal .Abs (row [i ]- row [i - 1 ]) >  3  {
31+ 		if  mathutils .Abs (row [i ]- row [i - 1 ]) >  3  {
3232			return  false 
3333		}
3434	}
Original file line number Diff line number Diff line change 1- // Package math  contains commonly used mathematical functions 
2- package  math 
1+ // Package mathutils  contains commonly used mathematical functions 
2+ package  mathutils 
33
44// Abs takes an int and returns the absolute value 
55func  Abs (num  int ) int  {
Original file line number Diff line number Diff line change 1- package  math 
1+ package  mathutils 
22
33import  "testing" 
44
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments