Skip to content

Instantly share code, notes, and snippets.

@chansuke
Created August 22, 2014 22:30
Show Gist options
  • Save chansuke/2773fd9112862d88b284 to your computer and use it in GitHub Desktop.
Save chansuke/2773fd9112862d88b284 to your computer and use it in GitHub Desktop.
simple solution for CheckiO - "Pawn Brotherhood"
safe_pawns=lambda s:sum(chr(ord(i[0])-1) + str(int(i[1])-1)in s or chr(ord(i[0])+1) + str(int(i[1])-1)in s for i in s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment