aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-057/pete-houston/perl/5702.pm43
-rw-r--r--challenge-057/pete-houston/perl/ch-2.pl11
-rw-r--r--stats/pwc-current.json101
-rw-r--r--stats/pwc-language-breakdown-summary.json64
-rw-r--r--stats/pwc-language-breakdown.json408
-rw-r--r--stats/pwc-leaders.json350
-rw-r--r--stats/pwc-summary-1-30.json44
-rw-r--r--stats/pwc-summary-121-150.json122
-rw-r--r--stats/pwc-summary-151-180.json64
-rw-r--r--stats/pwc-summary-31-60.json38
-rw-r--r--stats/pwc-summary-61-90.json112
-rw-r--r--stats/pwc-summary-91-120.json106
-rw-r--r--stats/pwc-summary.json360
13 files changed, 946 insertions, 877 deletions
diff --git a/challenge-057/pete-houston/perl/5702.pm b/challenge-057/pete-houston/perl/5702.pm
new file mode 100644
index 0000000000..3985383f6a
--- /dev/null
+++ b/challenge-057/pete-houston/perl/5702.pm
@@ -0,0 +1,43 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+main () unless caller;
+
+sub shortest_prefs {
+ my $wordlist = shift;
+ my $prefcounts = prefcounts (@$wordlist);
+ return [ map { minpref ($_, $prefcounts) } @$wordlist ];
+}
+
+sub prefcounts {
+ my @wordlist = @_;
+ my %counts;
+ for my $word (@wordlist) {
+ while (length ($word)) {
+ $counts{$word}++;
+ $word =~ s/.$//;
+ }
+ }
+ return \%counts;
+}
+
+sub minpref {
+ my ($word, $counts) = @_;
+ for my $i (1 .. length ($word)) {
+ my $pref = substr $word, 0, $i;
+ return $pref if $counts->{$pref} == 1;
+ }
+ return ''; # If non-unique
+}
+
+sub aref_from_argv {
+ # Sanitise input format
+ my @in = map { s/[",]//g; $_ } grep { ! /^[[\]]$/ } @ARGV;
+ return \@in;
+}
+
+sub main {
+ my $out = shortest_prefs (aref_from_argv ());
+ print '[ ', join (', ', map { qq{"$_"} } @$out), " ]\n";
+} \ No newline at end of file
diff --git a/challenge-057/pete-houston/perl/ch-2.pl b/challenge-057/pete-houston/perl/ch-2.pl
new file mode 100644
index 0000000000..3d0aa24ea6
--- /dev/null
+++ b/challenge-057/pete-houston/perl/ch-2.pl
@@ -0,0 +1,11 @@
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+use lib '.';
+require '5702.pm';
+
+my $in = [ "alphabet", "book", "carpet", "cadmium", "cadeau", "alpine" ];
+my $want = [ "alph", "b", "car", "cadm", "cade", "alpi" ];
+
+is_deeply shortest_prefs ($in), $want;
diff --git a/stats/pwc-current.json b/stats/pwc-current.json
index efa759fb3e..dc2ee29dd4 100644
--- a/stats/pwc-current.json
+++ b/stats/pwc-current.json
@@ -1,8 +1,19 @@
{
+ "xAxis" : {
+ "type" : "category"
+ },
+ "chart" : {
+ "type" : "column"
+ },
+ "subtitle" : {
+ "text" : "[Champions: 6] Last updated at 2020-04-20 15:34:51 GMT"
+ },
+ "title" : {
+ "text" : "Perl Weekly Challenge - 057"
+ },
"drilldown" : {
"series" : [
{
- "id" : "Luca Ferrari",
"name" : "Luca Ferrari",
"data" : [
[
@@ -13,7 +24,8 @@
"Blog",
2
]
- ]
+ ],
+ "id" : "Luca Ferrari"
},
{
"data" : [
@@ -26,8 +38,18 @@
"name" : "Markus Holzer"
},
{
- "id" : "Roger Bell West",
+ "data" : [
+ [
+ "Perl",
+ 1
+ ]
+ ],
+ "id" : "Pete Houston",
+ "name" : "Pete Houston"
+ },
+ {
"name" : "Roger Bell West",
+ "id" : "Roger Bell West",
"data" : [
[
"Perl",
@@ -36,65 +58,66 @@
]
},
{
+ "name" : "Simon Proctor",
"data" : [
[
"Raku",
2
]
],
- "id" : "Simon Proctor",
- "name" : "Simon Proctor"
+ "id" : "Simon Proctor"
},
{
- "id" : "Yet Ebreo",
- "name" : "Yet Ebreo",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "id" : "Yet Ebreo",
+ "name" : "Yet Ebreo"
}
]
},
- "yAxis" : {
- "title" : {
- "text" : "Total Solutions"
- }
- },
- "subtitle" : {
- "text" : "[Champions: 5] Last updated at 2020-04-20 15:16:23 GMT"
- },
- "chart" : {
- "type" : "column"
- },
- "xAxis" : {
- "type" : "category"
- },
- "title" : {
- "text" : "Perl Weekly Challenge - 057"
- },
"tooltip" : {
"headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>",
"pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>",
"followPointer" : 1
},
+ "yAxis" : {
+ "title" : {
+ "text" : "Total Solutions"
+ }
+ },
"legend" : {
"enabled" : 0
},
+ "plotOptions" : {
+ "series" : {
+ "borderWidth" : 0,
+ "dataLabels" : {
+ "enabled" : 1,
+ "format" : "{point.y}"
+ }
+ }
+ },
"series" : [
{
- "colorByPoint" : 1,
"data" : [
{
- "y" : 4,
+ "name" : "Luca Ferrari",
"drilldown" : "Luca Ferrari",
- "name" : "Luca Ferrari"
+ "y" : 4
},
{
- "y" : 1,
"name" : "Markus Holzer",
- "drilldown" : "Markus Holzer"
+ "drilldown" : "Markus Holzer",
+ "y" : 1
+ },
+ {
+ "y" : 1,
+ "name" : "Pete Houston",
+ "drilldown" : "Pete Houston"
},
{
"name" : "Roger Bell West",
@@ -102,26 +125,18 @@
"y" : 2
},
{
- "name" : "Simon Proctor",
"drilldown" : "Simon Proctor",
+ "name" : "Simon Proctor",
"y" : 2
},
{
- "name" : "Yet Ebreo",
"drilldown" : "Yet Ebreo",
+ "name" : "Yet Ebreo",
"y" : 2
}
],
- "name" : "Perl Weekly Challenge - 057"
- }
- ],
- "plotOptions" : {
- "series" : {
- "borderWidth" : 0,
- "dataLabels" : {
- "format" : "{point.y}",
- "enabled" : 1
- }
+ "name" : "Perl Weekly Challenge - 057",
+ "colorByPoint" : 1
}
- }
+ ]
}
diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json
index 081586363f..81217787a3 100644
--- a/stats/pwc-language-breakdown-summary.json
+++ b/stats/pwc-language-breakdown-summary.json
@@ -1,22 +1,6 @@
{
- "legend" : {
- "enabled" : "false"
- },
"series" : [
{
- "name" : "Contributions",
- "dataLabels" : {
- "rotation" : -90,
- "y" : 10,
- "align" : "right",
- "style" : {
- "fontSize" : "13px",
- "fontFamily" : "Verdana, sans-serif"
- },
- "enabled" : "true",
- "color" : "#FFFFFF",
- "format" : "{point.y:.0f}"
- },
"data" : [
[
"Blog",
@@ -24,40 +8,56 @@
],
[
"Perl",
- 2390
+ 2391
],
[
"Raku",
1497
]
- ]
+ ],
+ "name" : "Contributions",
+ "dataLabels" : {
+ "enabled" : "true",
+ "rotation" : -90,
+ "align" : "right",
+ "y" : 10,
+ "format" : "{point.y:.0f}",
+ "color" : "#FFFFFF",
+ "style" : {
+ "fontSize" : "13px",
+ "fontFamily" : "Verdana, sans-serif"
+ }
+ }
}
],
- "chart" : {
- "type" : "column"
- },
"yAxis" : {
+ "min" : 0,
"title" : {
"text" : null
- },
- "min" : 0
+ }
},
- "subtitle" : {
- "text" : "Last updated at 2020-04-20 15:16:23 GMT"
+ "legend" : {
+ "enabled" : "false"
},
"tooltip" : {
"pointFormat" : "<b>{point.y:.0f}</b>"
},
+ "title" : {
+ "text" : "Perl Weekly Challenge Contributions [2019 - 2020]"
+ },
+ "subtitle" : {
+ "text" : "Last updated at 2020-04-20 15:34:51 GMT"
+ },
+ "chart" : {
+ "type" : "column"
+ },
"xAxis" : {
- "type" : "category",
"labels" : {
"style" : {
- "fontSize" : "13px",
- "fontFamily" : "Verdana, sans-serif"
+ "fontFamily" : "Verdana, sans-serif",
+ "fontSize" : "13px"
}
- }
- },
- "title" : {
- "text" : "Perl Weekly Challenge Contributions [2019 - 2020]"
+ },
+ "type" : "category"
}
}
diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json
index 5376889182..a9665687c8 100644
--- a/stats/pwc-language-breakdown.json
+++ b/stats/pwc-language-breakdown.json
@@ -1,18 +1,20 @@
{
+ "xAxis" : {
+ "type" : "category"
+ },
"chart" : {
"type" : "column"
},
"subtitle" : {
- "text" : "Click the columns to drilldown the language breakdown. Last updated at 2020-04-20 15:16:23 GMT"
+ "text" : "Click the columns to drilldown the language breakdown. Last updated at 2020-04-20 15:34:51 GMT"
},
- "yAxis" : {
- "title" : {
- "text" : "Total Solutions"
- }
+ "title" : {
+ "text" : "Perl Weekly Challenge Language"
},
"drilldown" : {
"series" : [
{
+ "id" : "001",
"data" : [
[
"Perl",
@@ -27,11 +29,9 @@
11
]
],
- "name" : "001",
- "id" : "001"
+ "name" : "001"
},
{
- "name" : "002",
"id" : "002",
"data" : [
[
@@ -46,11 +46,10 @@
"Blog",
10
]
- ]
+ ],
+ "name" : "002"
},
{
- "id" : "003",
- "name" : "003",
"data" : [
[
"Perl",
@@ -64,7 +63,9 @@
"Blog",
9
]
- ]
+ ],
+ "id" : "003",
+ "name" : "003"
},
{
"data" : [
@@ -85,7 +86,6 @@
"name" : "004"
},
{
- "name" : "005",
"id" : "005",
"data" : [
[
@@ -100,9 +100,11 @@
"Blog",
12
]
- ]
+ ],
+ "name" : "005"
},
{
+ "name" : "006",
"data" : [
[
"Perl",
@@ -117,11 +119,9 @@
7
]
],
- "name" : "006",
"id" : "006"
},
{
- "id" : "007",
"name" : "007",
"data" : [
[
@@ -136,9 +136,11 @@
"Blog",
10
]
- ]
+ ],
+ "id" : "007"
},
{
+ "name" : "008",
"data" : [
[
"Perl",
@@ -153,12 +155,9 @@
12
]
],
- "name" : "008",
"id" : "008"
},
{
- "id" : "009",
- "name" : "009",
"data" : [
[
"Perl",
@@ -172,11 +171,13 @@
"Blog",
13
]
- ]
+ ],
+ "id" : "009",
+ "name" : "009"
},
{
- "id" : "010",
"name" : "010",
+ "id" : "010",
"data" : [
[
"Perl",
@@ -193,6 +194,7 @@
]
},
{
+ "id" : "011",
"data" : [
[
"Perl",
@@ -207,12 +209,11 @@
10
]
],
- "id" : "011",
"name" : "011"
},
{
- "id" : "012",
"name" : "012",
+ "id" : "012",
"data" : [
[
"Perl",
@@ -229,6 +230,7 @@
]
},
{
+ "name" : "013",
"data" : [
[
"Perl",
@@ -243,10 +245,11 @@
13
]
],
- "name" : "013",
"id" : "013"
},
{
+ "name" : "014",
+ "id" : "014",
"data" : [
[
"Perl",
@@ -260,11 +263,10 @@
"Blog",
15
]
- ],
- "id" : "014",
- "name" : "014"
+ ]
},
{
+ "id" : "015",
"data" : [
[
"Perl",
@@ -279,12 +281,9 @@
15
]
],
- "name" : "015",
- "id" : "015"
+ "name" : "015"
},
{
- "id" : "016",
- "name" : "016",
"data" : [
[
"Perl",
@@ -298,11 +297,12 @@
"Blog",
12
]
- ]
+ ],
+ "id" : "016",
+ "name" : "016"
},
{
"name" : "017",
- "id" : "017",
"data" : [
[
"Perl",
@@ -316,11 +316,10 @@
"Blog",
12
]
- ]
+ ],
+ "id" : "017"
},
{
- "id" : "018",
- "name" : "018",
"data" : [
[
"Perl",
@@ -334,7 +333,9 @@
"Blog",
14
]
- ]
+ ],
+ "id" : "018",
+ "name" : "018"
},
{
"data" : [
@@ -351,10 +352,11 @@
13
]
],
- "name" : "019",
- "id" : "019"
+ "id" : "019",
+ "name" : "019"
},
{
+ "name" : "020",
"data" : [
[
"Perl",
@@ -369,7 +371,6 @@
13
]
],
- "name" : "020",
"id" : "020"
},
{
@@ -423,11 +424,10 @@
12
]
],
- "name" : "023",
- "id" : "023"
+ "id" : "023",
+ "name" : "023"
},
{
- "id" : "024",
"name" : "024",
"data" : [
[
@@ -442,7 +442,8 @@
"Blog",
11
]
- ]
+ ],
+ "id" : "024"
},
{
"name" : "025",
@@ -463,6 +464,7 @@
]
},
{
+ "id" : "026",
"data" : [
[
"Perl",
@@ -477,12 +479,9 @@
10
]
],
- "name" : "026",
- "id" : "026"
+ "name" : "026"
},
{
- "id" : "027",
- "name" : "027",
"data" : [
[
"Perl",
@@ -496,10 +495,11 @@
"Blog",
9
]
- ]
+ ],
+ "id" : "027",
+ "name" : "027"
},
{
- "name" : "028",
"id" : "028",
"data" : [
[
@@ -514,7 +514,8 @@
"Blog",
9
]
- ]
+ ],
+ "name" : "028"
},
{
"data" : [
@@ -531,10 +532,11 @@
12
]
],
- "name" : "029",
- "id" : "029"
+ "id" : "029",
+ "name" : "029"
},
{
+ "id" : "030",
"data" : [
[
"Perl",
@@ -549,10 +551,11 @@
10
]
],
- "id" : "030",
"name" : "030"
},
{
+ "name" : "031",
+ "id" : "031",
"data" : [
[
"Perl",
@@ -566,13 +569,9 @@
"Blog",
9
]
- ],
- "name" : "031",
- "id" : "031"
+ ]
},
{
- "id" : "032",
- "name" : "032",
"data" : [
[
"Perl",
@@ -586,7 +585,9 @@
"Blog",
10
]
- ]
+ ],
+ "id" : "032",
+ "name" : "032"
},
{
"data" : [
@@ -603,10 +604,12 @@
10
]
],
- "name" : "033",
- "id" : "033"
+ "id" : "033",
+ "name" : "033"
},
{
+ "name" : "034",
+ "id" : "034",
"data" : [
[
"Perl",
@@ -620,11 +623,10 @@
"Blog",
11
]
- ],
- "name" : "034",
- "id" : "034"
+ ]
},
{
+ "name" : "035",
"data" : [
[
"Perl",
@@ -639,10 +641,10 @@
9
]
],
- "id" : "035",
- "name" : "035"
+ "id" : "035"
},
{
+ "id" : "036",
"data" : [
[
"Perl",
@@ -657,11 +659,9 @@
11
]
],
- "name" : "036",
- "id" : "036"
+ "name" : "036"
},
{
- "id" : "037",
"name" : "037",
"data" : [
[
@@ -676,9 +676,11 @@
"Blog",
9
]
- ]
+ ],
+ "id" : "037"
},
{
+ "name" : "038",
"data" : [
[
"Perl",
@@ -693,7 +695,6 @@
12
]
],
- "name" : "038",
"id" : "038"
},
{
@@ -711,12 +712,10 @@
12
]
],
- "name" : "039",
- "id" : "039"
+ "id" : "039",
+ "name" : "039"
},
{
- "id" : "040",
- "name" : "040",
"data" : [
[
"Perl",
@@ -730,9 +729,13 @@
"Blog",
10
]
- ]
+ ],
+ "id" : "040",
+ "name" : "040"
},
{
+ "name" : "041",
+ "id" : "041",
"data" : [
[
"Perl",
@@ -746,9 +749,7 @@
"Blog",
9
]
- ],
- "id" : "041",
- "name" : "041"
+ ]
},
{
"data" : [
@@ -769,7 +770,6 @@
"name" : "042"
},
{
- "id" : "043",
"name" : "043",
"data" : [
[
@@ -784,11 +784,11 @@
"Blog",
10
]
- ]
+ ],
+ "id" : "043"
},
{
"id" : "044",
- "name" : "044",
"data" : [
[
"Perl",
@@ -802,9 +802,11 @@
"Blog",
10
]
- ]
+ ],
+ "name" : "044"
},
{
+ "name" : "045",
"data" : [
[
"Perl",
@@ -819,11 +821,9 @@
11
]
],
- "id" : "045",
- "name" : "045"
+ "id" : "045"
},
{
- "id" : "046",
"name" : "046",
"data" : [
[
@@ -838,9 +838,11 @@
"Blog",
10
]
- ]
+ ],
+ "id" : "046"
},
{
+ "id" : "047",
"data" : [
[
"Perl",
@@ -855,11 +857,9 @@
10
]
],
- "id" : "047",
"name" : "047"
},
{
- "name" : "048",
"id" : "048",
"data" : [
[
@@ -874,10 +874,10 @@
"Blog",
12
]
- ]
+ ],
+ "name" : "048"
},
{
- "id" : "049",
"name" : "049",
"data" : [
[
@@ -892,9 +892,12 @@
"Blog",
12
]
- ]
+ ],
+ "id" : "049"
},
{
+ "name" : "050",
+ "id" : "050",
"data" : [
[
"Perl",
@@ -908,12 +911,9 @@
"Blog",
12
]
- ],
- "name" : "050",
- "id" : "050"
+ ]
},
{
- "id" : "051",
"name" : "051",
"data" : [
[
@@ -928,7 +928,8 @@
"Blog",
11
]
- ]
+ ],
+ "id" : "051"
},
{
"name" : "052",
@@ -949,8 +950,6 @@
]
},
{
- "name" : "053",
- "id" : "053",
"data" : [
[
"Perl",
@@ -964,9 +963,12 @@
"Blog",
15
]
- ]
+ ],
+ "id" : "053",
+ "name" : "053"
},
{
+ "name" : "054",
"data" : [
[
"Perl",
@@ -981,11 +983,9 @@
12
]
],
- "id" : "054",
- "name" : "054"
+ "id" : "054"
},
{
- "id" : "055",
"name" : "055",
"data" : [
[
@@ -1000,10 +1000,10 @@
"Blog",
13
]
- ]
+ ],
+ "id" : "055"
},
{
- "name" : "056",
"id" : "056",
"data" : [
[
@@ -1018,13 +1018,14 @@
"Blog",
13
]
- ]
+ ],
+ "name" : "056"
},
{
"data" : [
[
"Perl",
- 4
+ 5
],
[
"Raku",
@@ -1042,43 +1043,55 @@
},
"tooltip" : {
"headerFormat" : "<span style=\"font-size:11px\"></span>",
- "followPointer" : "true",
- "pointFormat" : "<span style=\"color:{point.color}\">Challenge {point.name}</span>: <b>{point.y:f}</b><br/>"
+ "pointFormat" : "<span style=\"color:{point.color}\">Challenge {point.name}</span>: <b>{point.y:f}</b><br/>",
+ "followPointer" : "true"
},
- "title" : {
- "text" : "Perl Weekly Challenge Language"
+ "plotOptions" : {
+ "series" : {
+ "dataLabels" : {
+ "enabled" : 1,
+ "format" : "{point.y}"
+ },
+ "borderWidth" : 0
+ }
},
- "xAxis" : {
- "type" : "category"
+ "yAxis" : {
+ "title" : {
+ "text" : "Total Solutions"
+ }
+ },
+ "legend" : {
+ "enabled" : "false"
},
"series" : [
{
+ "colorByPoint" : "true",
"name" : "Perl Weekly Challenge Languages",
"data" : [
{
"y" : 140,
- "name" : "#001",
- "drilldown" : "001"
+ "drilldown" : "001",
+ "name" : "#001"
},
{
- "drilldown" : "002",
"name" : "#002",
+ "drilldown" : "002",
"y" : 109
},
{
"y" : 71,
- "name" : "#003",
- "drilldown" : "003"
+ "drilldown" : "003",
+ "name" : "#003"
},
{
- "y" : 91,
+ "drilldown" : "004",
"name" : "#004",
- "drilldown" : "004"
+ "y" : 91
},
{
- "drilldown" : "005",
+ "y" : 71,
"name" : "#005",
- "y" : 71
+ "drilldown" : "005"
},
{
"y" : 52,
@@ -1091,9 +1104,9 @@
"y" : 58
},
{
+ "y" : 70,
"drilldown" : "008",
- "name" : "#008",
- "y" : 70
+ "name" : "#008"
},
{
"name" : "#009",
@@ -1101,9 +1114,9 @@
"y" : 68
},
{
- "drilldown" : "010",
+ "y" : 60,
"name" : "#010",
- "y" : 60
+ "drilldown" : "010"
},
{
"y" : 79,
@@ -1111,19 +1124,19 @@
"drilldown" : "011"
},
{
- "drilldown" : "012",
"name" : "#012",
+ "drilldown" : "012",
"y" : 83
},
{
- "y" : 76,
+ "drilldown" : "013",
"name" : "#013",
- "drilldown" : "013"
+ "y" : 76
},
{
+ "y" : 96,
"drilldown" : "014",
- "name" : "#014",
- "y" : 96
+ "name" : "#014"
},
{
"y" : 93,
@@ -1131,24 +1144,24 @@
"name" : "#015"
},
{
- "drilldown" : "016",
+ "y" : 66,
"name" : "#016",
- "y" : 66
+ "drilldown" : "016"
},
{
- "y" : 79,
"drilldown" : "017",
- "name" : "#017"
+ "name" : "#017",
+ "y" : 79
},
{
- "name" : "#018",
"drilldown" : "018",
+ "name" : "#018",
"y" : 76
},
{
"y" : 97,
- "drilldown" : "019",
- "name" : "#019"
+ "name" : "#019",
+ "drilldown" : "019"
},
{
"y" : 95,
@@ -1156,8 +1169,8 @@
"drilldown" : "020"
},
{
- "name" : "#021",