Skip to content

Instantly share code, notes, and snippets.

@imerchant
Last active January 21, 2020 19:58
Show Gist options
  • Save imerchant/0f78ca12921d6620f7bde6d5f1d3da1b to your computer and use it in GitHub Desktop.
Save imerchant/0f78ca12921d6620f7bde6d5f1d3da1b to your computer and use it in GitHub Desktop.
Password hacking: How many possible numbers exist to hack a password with the rules below, and what are they?
1. Composed of the digits 1-9
2. 2-9 digits in length
3. Digits do not repeat
4. Digits are in ascending order
Output should include a full list of possible password strings and the total count.
Good examples
29
234
289
23456789
Bad examples
2 (too short)
243 (not ascending)
4556 (repetition of 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment