This, I believe, is a correct Python implementation: #!/usr/bin/python
import sys, string;
for currLine in sys.stdin:
nums = map(int, string.split(string.strip(currLine), ' '))
for ind in range(len(nums)-1):
diff=abs(nums[ind]-nums[ind+1])
if diff == 0 or diff >= len(nums):
print "not a match"
break
else:
print "match"
/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/
