/KnightlyPhoneNumbers

knight's move phone number calculation

Primary LanguageGo

Knightly Phone Numbers

a go solution to the problem of calculating valid phone numbers with the constraint that:

  • they are N digits in length
  • the phone numbers can never start with 0 or 1
  • successive digits in the phone number must be knight moves away (think chess)

Huh?

Look at main.go for further explanation. The algorithm in question was gleaned from a number of blogs and stack overflow meanderings.