Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Word Pattern by TovarischZhukov
def check_command(pattern, command):
pattern = bin(pattern)[2:].zfill(len(command))
if len(command) != len(pattern):
return False
for i in range(len(command)):
val = "0" if command[i].isdigit() else "1"
if val != pattern[i]:
return False
return True
Dec. 22, 2015