Created
October 22, 2014 18:07
-
-
Save tabatkins/8c0cb8043dbb2787d59a to your computer and use it in GitHub Desktop.
All strings [a-z]+ of length N or less, in lexicographic order
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gen(N) { | |
var strings = []; | |
var max = Math.pow(36, N); | |
for(var i = 10; i < max; i++) { | |
var candidate = i.toString(36); | |
if(/^[a-z]+$/.test(candidate)) { | |
strings.push(candidate); | |
} | |
} | |
return strings; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment