in reply to Challenge: prefix($x, $y) . suffix($x, $z) eq $x
Here's my straight forward solution, ungolfed...
timed as
real 0m0.387s user 0m0.381s sys 0m0.003s
update: using Limbic~Region's name list I get
real 0m12.441s user 0m12.219s sys 0m0.015s
and replacing m// with index in sub suffix above
real 0m6.405s user 0m6.273s sys 0m0.007s
on a Pentium M 2.10GHz, perl 5.8.8 - What are your timings? What is "better"? Code readability, brevity, maintainability, performance?
;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Challenge: prefix($x, $y) . suffix($x, $z) eq $x
by Limbic~Region (Chancellor) on Apr 22, 2009 at 22:18 UTC | |
by shmem (Chancellor) on Apr 22, 2009 at 22:27 UTC | |
by Limbic~Region (Chancellor) on Apr 22, 2009 at 22:35 UTC | |
by shmem (Chancellor) on Apr 22, 2009 at 23:59 UTC | |
by Limbic~Region (Chancellor) on Apr 23, 2009 at 00:23 UTC | |
|