diff --git a/9/__debug_bin3099938667 b/9/__debug_bin3099938667 new file mode 100755 index 0000000..76b1ed9 Binary files /dev/null and b/9/__debug_bin3099938667 differ diff --git a/9/main.go b/9/main.go index 12e8e04..2f17a31 100644 --- a/9/main.go +++ b/9/main.go @@ -9,8 +9,8 @@ import ( ) func main() { - file, _ := os.Open("test") -// file, _ := os.Open("input") +// file, _ := os.Open("test") + file, _ := os.Open("input") defer file.Close() scanner := bufio.NewScanner(file) diskMap := []string{} @@ -40,89 +40,38 @@ func main() { } } } -// for i := range blocks { -// if blocks[i] == "." { -// for j:=len(blocks)-1;j>i;j-- { -// if blocks[j] != "." { -// blocks[i] = blocks[j] -// blocks[j] = "." -// break -// } -// } -// } -// } -// checksum := 0 -// for i := range blocks { -// blockID, _ := strconv.Atoi(blocks[i]) -// checksum = checksum + i * blockID -// } -// fmt.Println(checksum) - fmt.Println(blocks) -// moved := []bool{} -// for i:=0;i=0;id-- { -// for j:=0;j=0;id-- { - idPositions := findIDpositions(blocks, id) - for i:=0;i