$10K coding deathmatch
jonathan at carnageblender.com
Thu Nov 2 11:13:34 MST 2006
On Thu, 2 Nov 2006 04:57:41 -0500, "Barry Roberts" <blr at robertsr.us>
> I'm still a python novice, but I thouhgt it would be fun to post a
> python solution just for discussion.
Your python reference appears to be about 5 years old. :)
Here's a translation that uses some newer features. Untested, YMMV.
for line in sys.stdin:
nums = [int(item) for item in line.strip().split()]
numset = set(nums)
for i, item in enumerate(nums[:-1]):
diff = abs(item - nums[i + 1])
if diff in numset:
print "not a match"
C++ is history repeated as tragedy. Java is history repeated as farce. --Scott McKay
More information about the PLUG