Skip to content

Instantly share code, notes, and snippets.

View ghallberg's full-sized avatar

Gustaf Hallberg ghallberg

  • Gothenburg, Sweden
View GitHub Profile
from itertools import combinations
from functools import reduce
from operator import mul
input_l = [1721, 979, 366, 299, 675, 1456]¬
def is_match(num_group):
return sum(num_group) == 2020
def get_match(nums, group_size):
groups = combinations(nums, group_size)

Keybase proof

I hereby claim:

  • I am ghallberg on github.
  • I am ghallberg (https://keybase.io/ghallberg) on keybase.
  • I have a public key ASCied2S6HF2x1uEhuNSPqAguTrTd14CGvBWCDObX5RaVwo

To claim this, I am signing this object:

@ghallberg
ghallberg / gist:3031397
Created July 2, 2012 06:15
nexuspersonal.install
post_install() {
ln -s /usr/local/lib/libtokenapi.so /usr/lib/libtokenapi.so
ln -s /usr/local/lib/libai.so /usr/lib/libai.so
}
pre_remove() {
rm /usr/local/lib/libtokenapi.so
rm /usr/local/lib/libai.so
}
[gustaf@psyche ~]$ locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"