Skip to content

Instantly share code, notes, and snippets.

@sheac
Last active July 4, 2019 16:59
Show Gist options
  • Save sheac/5b7f4fcbfb7f7b989950dddb25d5a569 to your computer and use it in GitHub Desktop.
Save sheac/5b7f4fcbfb7f7b989950dddb25d5a569 to your computer and use it in GitHub Desktop.

How many passwords combinations can we find of length 3?

*    *    *

*    *    *

*    *    *

examples:

  • [0,0], [0,0], [0,0]
  • [2,1], [1,1], [0,1]

Constraint 1: all the combinations must be "adjacent"

Where "adjacent" means they're either up, down, left or right.

examples:

  • [0,0], [0,1], [1,1]
1----2    *
     |
*    3    *

*    *    *
  • [2,1], [1,1], [0,1]
*    3    *
     |
*    2    *
     |
*    1    *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment