Skip to content

Instantly share code, notes, and snippets.

@mdamien
Last active August 29, 2015 14:11
Show Gist options
  • Save mdamien/2241407174205ef26624 to your computer and use it in GitHub Desktop.
Save mdamien/2241407174205ef26624 to your computer and use it in GitHub Desktop.

given n, print all the combinations of 0...(n-1) of length n

example

n = 2

00
01
10
11

n = 3

000
001
002
010
011
012
020
021
022
100
101
102
110
111
112
120
121
122
200
201
202
210
211
212
220
221
222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment