Showing posts with label Dave White. Show all posts
Showing posts with label Dave White. Show all posts

Sunday 23 November 2014

Weekend code puzzle: Dave's answer (Python)

G'day:
I'm continuing to look at each person's submissions for the code puzzle ("Something for the weekend? A wee code puzzle (in CFML, PHP, anything really...)").

Dave's done a Python version. Like Chris just before him, Dave got his answer in before I varied the rules slightly, so his answer just finds the first longest subseries within the threshold from within the series; it does not check same-lengthed subseries for which has the highest within-threshold total. "Within" three times in a sentence. Sorry about that.

Thursday 9 May 2013

A coupla bits of curious behaviour

G'day:
Here's a coupla bits of code that undid me yesterday. What do you make of these code examples: