Browse Source

solution day 9 part 2

AbderFaiz 4 months ago
parent
commit
4831cf1b23
2 changed files with 2 additions and 2 deletions
  1. 1 1
      9/solve_2.ml
  2. 1 1
      README.md

+ 1 - 1
9/solve_2.ml

@@ -41,7 +41,7 @@ let expand dm =
 let reverse_list = List.rev;;
 
 let fill_empty_space file1 file2 gain_space =
-  let new_ept_space = if (gain_space) then file1.empty_space - file2.size + file2.empty_space
+  let new_ept_space = if (gain_space) then file1.empty_space - file2.size + file2.empty_space + file2.size
                       else file1.empty_space - file2.size
   in
   let n_file1 = {id = file1.id; size = file1.size; empty_space = 0; can_move=file1.can_move} in

+ 1 - 1
README.md

@@ -50,7 +50,7 @@ replace `<part_number>` with 1 for Part 1 or 2 for Part 2
 | 6   | ✅     | ✅     |
 | 7   | ✅     | ✅     |
 | 8   | ✅     | ✅     |
-| 9   | ✅     |      |
+| 9   | ✅     |      |
 | 10  | ⬜     | ⬜     |
 | 11  | ⬜     | ⬜     |
 | 12  | ⬜     | ⬜     |