Ben Kadel
12/02/2024, 12:34 PMrocketraman
12/02/2024, 12:46 PMBen Kadel
12/02/2024, 12:49 PMrocketraman
12/02/2024, 12:50 PMzipWithNext?Ben Kadel
12/02/2024, 12:50 PMzip interestinggggg ok
can you tell me more? this is the exact sort of thing i was hoping to get hahah 😉rocketraman
12/02/2024, 12:52 PMzipWithNext is a reasonable data structure to use for part 1, because it makes the test trivial to implement. But for part 2 its a bit tricky because removing a level changes two entries in the zipWithNext list.Ben Kadel
12/02/2024, 12:52 PMBen Kadel
12/02/2024, 12:52 PMBen Kadel
12/02/2024, 1:51 PMBen Kadel
12/02/2024, 1:52 PMDmitry Stakhov
12/02/2024, 2:32 PMzipWithNext so I just used windowed(2) that should work the same.Norbert Kiesel
12/02/2024, 11:37 PMwindowed work similar, but zipWithNext supports a lambda parameter, and thus you can use
zipWithNext { a, b -> a - b }
to get a list of deltas.Safi K
12/04/2024, 3:08 PMBen Kadel
12/05/2024, 8:01 AM