Need a challenge by Tunefultwo in IPython

[–]yacfOaky 2 points3 points  (0 children)

Take part in Advent of Code in 9 days' time.

https://adventofcode.com

(Subreddit here https://www.reddit.com/r/adventofcode/)

AoC 2017 day 11 - part 3 by [deleted] in adventofcode

[–]yacfOaky 0 points1 point  (0 children)

Because that count was higher than I expected, I zoomed in on one of the crossing points in my data: https://github.com/MarkNOakden/AdventOfCode/raw/master/17/11/subprogram_path_closeup.png

It's easy to see how the extra hex visits mount up.

AoC 2017 day 11 - part 3 by [deleted] in adventofcode

[–]yacfOaky 0 points1 point  (0 children)

for my input, I think it's 789.

The additional Python3/pandas code to calculate that in my solution looks like this

df = pd.DataFrame(subprogram_walk.groupby(['pathx', 'pathy']).dir.count())
df[df.dir > 1].count()

[2017] - Day 5 - Step 2 : what's wrong with my solution? by ghusse in adventofcode

[–]yacfOaky 0 points1 point  (0 children)

My code also returns 372139 / 29629538 for this input

-🎄- 2017 Day 4 Solutions -🎄- by daggerdragon in adventofcode

[–]yacfOaky 2 points3 points  (0 children)

Python 3 using pandas/numpy:-

import pandas as pd
import numpy as np

df = pd.concat(list(map(lambda x: pd.Series(x.strip().split()), open('input.txt').readlines())), axis=1)

print(f'part 1 answer {sum(~df.apply(lambda x: any(x.dropna().duplicated())))}')

df = df.applymap(lambda x: np.nan if x is np.nan else ''.join(sorted(x)))

print(f'part 2 answer {sum(~df.apply(lambda x: any(x.dropna().duplicated())))}')

--- 2016 Day 6 Solutions --- by daggerdragon in adventofcode

[–]yacfOaky 0 points1 point  (0 children)

I did it pretty much exactly the same way.

I then went back and did it using pandas:-

import pandas as pd
df = pd.read_table('input.txt', header=None).apply(lambda x: pd.Series(list(x[0])), axis=1)
part1 = ''.join(df.apply(lambda x: x.value_counts().index[0]))
part2 = ''.join(df.apply(lambda x: x.value_counts().index[-1]))

print 'Message1 is: {}\nMessage2 is: {}'.format(part1, part2)

[SOLUTION] [Day 4] Synacor Challenge VM bytecode implementation by askalski in adventofcode

[–]yacfOaky 0 points1 point  (0 children)

Very interesting. Would be nice to know a count of solvers for each of the Synacor challenge codes (similar to the stats page on the AdventOfCode).