Aaron's Page

This is where I post about what I'm working on.

--- Day 7: The Treachery of Whales ---

or..

If only quick solves were as valuable as ambergris...

one art please

Part 1

Python

This one was surprisingly straight-forward. A big assist from the dict comprehension with lambda sort to get me the lowest fuel number easily.

Go

TBD

Part 2

Python

The only thing to show off in this solution is the formula to calculate the fuel series:

>>>> t = [1,2,3,4,5]
>>> for n in t:
	print(int(((1 + n)/2 ) * n))


1
3
6
10
15

Only works for all numbers guaranteed in a series, but it does what we needed.

<< - Table of Contents - >>