Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-the-Bomb committed Dec 21, 2023
1 parent 80f7bb7 commit 08ef1f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/bin/day18.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ impl Day18 {
where
T: Iterator<Item = (i64, (i64, i64))>
{
let mut points = vec![(0, 0)];
let (low, high) = data.size_hint();
let mut points = Vec::with_capacity(
high.unwrap_or(low) + 1
);
points.push((0, 0));

let mut perimeter = 0;

for (dist, (dir_x, dir_y)) in data {
Expand Down
3 changes: 1 addition & 2 deletions src/bin/day19.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ impl Day19 {
.unwrap();
let mut data = data
.trim_end_matches('}')
.split(',')
.rev();
.rsplit(',');
let default = data
.next()
.unwrap();
Expand Down

0 comments on commit 08ef1f5

Please sign in to comment.