Skip to content

Instantly share code, notes, and snippets.

@kierdavis
Created June 17, 2016 01:49
Show Gist options
  • Save kierdavis/bd0e7604f57db0e9166834ec7e4d7113 to your computer and use it in GitHub Desktop.
Save kierdavis/bd0e7604f57db0e9166834ec7e4d7113 to your computer and use it in GitHub Desktop.
# define and initialise a set
var states: set[char] = {}
# iterate over each character of each string in 'chains'
for s in chains:
for c in s:
states.incl(c) # add character to the set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment