Skip to content

Instantly share code, notes, and snippets.

@ty60
Created December 7, 2017 02:08
Show Gist options
  • Save ty60/d63842f06deba3acddd4f5cda493b64f to your computer and use it in GitHub Desktop.
Save ty60/d63842f06deba3acddd4f5cda493b64f to your computer and use it in GitHub Desktop.
def gen_vector_counter(vec_len):
if vec_len <= 1:
return defaultdict(int)
else:
t = partial(gen_vector_counter, vec_len - 1)
return defaultdict(t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment