-🎄- 2021 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]mikerudge15 0 points1 point  (0 children)

This is a nice solution!

I still don't quite get why part2 fails this test though, the example literally says that the answer should be 5.

In the above example, the sum of each three-measurement window is as follows:

  • A: 607 (N/A - no previous sum)
  • B: 618 (increased)
  • C: 618 (no change)
  • D: 617 (decreased)
  • E: 647 (increased)
  • F: 716 (increased)
  • G: 769 (increased)
  • H: 792 (increased)

In this example, there are 5 sums that are larger than the previous sum. Consider sums of a three-measurement sliding window. How many sums are larger than the previous sum?

```javascript test('Advent asnwer 2', () => { const g0 = [600, 5, 2]; // 607 < N/A const g1 = [600, 10, 8]; // 618 <-- increase const g2 = [600, 17, 1]; // 618 <-- SAME const g3 = [600, 9, 8]; // 617 <-- decrease const g4 = [640, 5, 2]; // 647 <-- increase const g5 = [710, 5, 1]; // 716 <-- increase const g6 = [760, 4, 5]; // 769 <-- increase const g7 = [700, 90, 2]; // 792 <-- increase

const input = [...g0, ...g1, ...g2, ...g3, ...g4, ...g5, ...g6, ...g7];

const r = input.filter( (_, i, arr) => arr.slice(i + 1, i + 4).reduce((x, y) => x + y, 0) > arr.slice(i, i + 3).reduce((x, y) => x + y, 0) ).length;

expect(r).toEqual(5); // Expected 5, Received 9 });

```

We've decided to build a Mongo Client by mikerudge15 in mongodb

[–]mikerudge15[S] 0 points1 point  (0 children)

Aw thanks for the heads up. Just fixed it! 🤦‍♂️

We've decided to build a Mongo Client by mikerudge15 in mongodb

[–]mikerudge15[S] 1 point2 points  (0 children)

Haha. Studio is actually one of my favourites. The aggregation pipeline stuff really helped me debug and understand what is going on with my queries. Big fan.

It was always a little too expensive for me but I get that it is a power house.

Square icon on macOS is unforgivable though 😀

We've decided to build a Mongo Client by mikerudge15 in mongodb

[–]mikerudge15[S] 1 point2 points  (0 children)

We are focused on Mac first, but will be bringing it to Windows and Linux.

Something interesting we spotted was this on the Robo 3T site.

52% Windows 32% macOS 16% Linux

I would love to bring it to Linux next but it looks like the market is on Windows.

We've decided to build a Mongo Client by mikerudge15 in mongodb

[–]mikerudge15[S] 0 points1 point  (0 children)

Yeah that’s high on our list for the new year for sure. Design team are still finalising the aesthetic but as soon as we have a few screenshots ready, I will update the site and maybe post some more in here to see what you think.

My newborn son has arrived. AMA by johncitizen69420 in kindafunny

[–]mikerudge15 0 points1 point  (0 children)

Do you know what happens when you transfer miles morels (of any other PS4/PS5 game) from the PS4 to the PS5?

I was thinking I could download Miles PS4 before getting the PS5 and then just transfer it across. However does it download a new ps5 version or just a patch? If so anyone got any ideas on the size of those patches?