Hi

I stumbled over some blog posts choosing brute-forc'ish algos to solve the perl-weekly-challenge-206.

Here my take on it ... (I hid the "spoilers")

I hope my approaches are clever solutions, please correct me otherwise.

But I'm not too fond of my approach with List::Util::reduce() for task1. It's a hack to process successive pairs instead of even pairs.( 1-2 than 2-3 vs 3-4 )

Is there a more elegant way to do it with a function from List::Util ?

BTW: Generating the tests from the POD is nice too. :)

--- Task 1 ok 1 - ("00:00", "23:55", "20:00") -> 5 ok 2 - ("01:01", "00:50", "00:57") -> 4 ok 3 - ("10:10", "09:30", "09:00", "09:55") -> 15 --- Task 2 ok 4 - (1,2,3,4) -> 4 ok 5 - (0,2,1,3) -> 2 1..5

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery


In reply to Perl Weekly Challenge 206 with List::Util by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.