Skip to content

Instantly share code, notes, and snippets.

@Ape
Created December 3, 2016 07:26
Show Gist options
  • Save Ape/f76a63362db4d72b8086ed8ff3ea27f5 to your computer and use it in GitHub Desktop.
Save Ape/f76a63362db4d72b8086ed8ff3ea27f5 to your computer and use it in GitHub Desktop.
AoC 2016 Day 3 Part 2 with Numpy
#!/usr/bin/env python3
import sys
import numpy as np
data = np.loadtxt(sys.stdin).T.reshape(-1, 3).T
data.sort(axis=0)
print(np.sum(sum(data[:2]) > data[2]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment