aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-060/javier-luque/blog.txt1
-rw-r--r--challenge-060/javier-luque/perl/ch-1.pl25
-rw-r--r--challenge-060/javier-luque/perl/ch-2.pl23
-rw-r--r--challenge-060/javier-luque/raku/ch-1.p619
-rw-r--r--challenge-060/javier-luque/raku/ch-2.p619
-rw-r--r--stats/pwc-current.json103
-rw-r--r--stats/pwc-language-breakdown-summary.json74
-rw-r--r--stats/pwc-language-breakdown.json428
-rw-r--r--stats/pwc-leaders.json370
-rw-r--r--stats/pwc-summary-1-30.json114
-rw-r--r--stats/pwc-summary-121-150.json104
-rw-r--r--stats/pwc-summary-151-180.json68
-rw-r--r--stats/pwc-summary-31-60.json110
-rw-r--r--stats/pwc-summary-61-90.json100
-rw-r--r--stats/pwc-summary-91-120.json100
-rw-r--r--stats/pwc-summary.json50
16 files changed, 909 insertions, 799 deletions
diff --git a/challenge-060/javier-luque/blog.txt b/challenge-060/javier-luque/blog.txt
new file mode 100644
index 0000000000..9ca6a6a5a6
--- /dev/null
+++ b/challenge-060/javier-luque/blog.txt
@@ -0,0 +1 @@
+https://perlchallenges.wordpress.com/2020/05/11/perl-weekly-challenge-060/
diff --git a/challenge-060/javier-luque/perl/ch-1.pl b/challenge-060/javier-luque/perl/ch-1.pl
new file mode 100644
index 0000000000..c1be7ebcca
--- /dev/null
+++ b/challenge-060/javier-luque/perl/ch-1.pl
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+# Test: ./ch-1.pl 30
+use strict;
+use warnings;
+use feature qw /say/;
+
+say to_excel($ARGV[0]);
+
+sub to_excel {
+ my $n = shift;
+
+ # Array to store digits
+ my @digits;
+
+ # Break down the digits to base 26
+ while ($n > 0) {
+ push @digits, ($n-1) % 26;
+ $n = int(($n-1)/26);
+ }
+
+ # Join the digits
+ return join '',
+ map { chr(ord('A') + $_) }
+ reverse @digits;
+}
diff --git a/challenge-060/javier-luque/perl/ch-2.pl b/challenge-060/javier-luque/perl/ch-2.pl
new file mode 100644
index 0000000000..2cbab657b6
--- /dev/null
+++ b/challenge-060/javier-luque/perl/ch-2.pl
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+# Test: ./ch-2.pl
+
+use strict;
+use warnings;
+use feature qw /say/;
+use Algorithm::Combinatorics qw /variations/;
+
+my @L = (0, 1, 2, 5);
+my $X = 2;
+my $Y = 21;
+my @answers;
+
+# Brute force the variations
+my $variations = variations(\@L, $X);
+while (my $v = $variations->next) {
+ my $n = join '', @$v;
+ $n = int($n); #Remove leading 0
+ push @answers, $n
+ if ($n < $Y && length($n) == $X);
+}
+
+say join ', ', sort @answers;
diff --git a/challenge-060/javier-luque/raku/ch-1.p6 b/challenge-060/javier-luque/raku/ch-1.p6
new file mode 100644
index 0000000000..5bfc03ec28
--- /dev/null
+++ b/challenge-060/javier-luque/raku/ch-1.p6
@@ -0,0 +1,19 @@
+# Test: perl6 ch-1.p6 30
+sub MAIN(Int $n) {
+ say to-excel($n);
+}
+
+
+sub to-excel(Int $n is copy) {
+ # Array to store digits
+ my @digits;
+
+ # Break down the digits to base 26
+ while ($n > 0) {
+ @digits.push(($n-1) % 26);
+ $n = Int( ($n-1)/26 );
+ }
+
+ # Join the digits
+ return @digits.reverse.map({ chr(ord('A') + .Int) }).join('');
+}
diff --git a/challenge-060/javier-luque/raku/ch-2.p6 b/challenge-060/javier-luque/raku/ch-2.p6
new file mode 100644
index 0000000000..7ef6bbc4c6
--- /dev/null
+++ b/challenge-060/javier-luque/raku/ch-2.p6
@@ -0,0 +1,19 @@
+# Test: perl6 ch-2.p6
+sub MAIN() {
+ my @L = (0, 1, 2, 5);
+ my $X = 2;
+ my $Y = 21;
+ my @answers;
+
+ # Brute force the variations
+ my @combos = @L.combinations: $X;
+ for @combos -> $combo {
+ for $combo.permutations -> $perms {
+ my $n = $perms.join('').Int;
+ @answers.push($n)
+ if ($n < $Y && $n.chars == $X);
+ }
+ }
+
+ say @answers.sort.join(', ');
+}
diff --git a/stats/pwc-current.json b/stats/pwc-current.json
index bdb1d0b1b7..b69abaf2ed 100644
--- a/stats/pwc-current.json
+++ b/stats/pwc-current.json
@@ -1,27 +1,43 @@
{
- "legend" : {
- "enabled" : 0
- },
- "tooltip" : {
- "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>",
- "followPointer" : 1,
- "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>"
- },
- "chart" : {
- "type" : "column"
- },
- "title" : {
- "text" : "Perl Weekly Challenge - 060"
- },
- "xAxis" : {
- "type" : "category"
- },
- "subtitle" : {
- "text" : "[Champions: 1] Last updated at 2020-05-11 08:10:40 GMT"
- },
+ "series" : [
+ {
+ "data" : [
+ {
+ "drilldown" : "Javier Luque",
+ "y" : 5,
+ "name" : "Javier Luque"
+ },
+ {
+ "drilldown" : "Luca Ferrari",
+ "y" : 4,
+ "name" : "Luca Ferrari"
+ }
+ ],
+ "name" : "Perl Weekly Challenge - 060",
+ "colorByPoint" : 1
+ }
+ ],
"drilldown" : {
"series" : [
{
+ "name" : "Javier Luque",
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Raku",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Javier Luque"
+ },
+ {
"data" : [
[
"Raku",
@@ -37,31 +53,38 @@
}
]
},
- "plotOptions" : {
- "series" : {
- "borderWidth" : 0,
- "dataLabels" : {
- "enabled" : 1,
- "format" : "{point.y}"
- }
- }
+ "legend" : {
+ "enabled" : 0
+ },
+ "xAxis" : {
+ "type" : "category"
+ },
+ "subtitle" : {
+ "text" : "[Champions: 2] Last updated at 2020-05-11 08:33:44 GMT"
+ },
+ "title" : {
+ "text" : "Perl Weekly Challenge - 060"
+ },
+ "chart" : {
+ "type" : "column"
+ },
+ "tooltip" : {
+ "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>",
+ "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>",
+ "followPointer" : 1
},
"yAxis" : {
"title" : {
"text" : "Total Solutions"
}
},
- "series" : [
- {
- "name" : "Perl Weekly Challenge - 060",
- "data" : [
- {
- "drilldown" : "Luca Ferrari",
- "y" : 4,
- "name" : "Luca Ferrari"
- }
- ],
- "colorByPoint" : 1
+ "plotOptions" : {
+ "series" : {
+ "dataLabels" : {
+ "enabled" : 1,
+ "format" : "{point.y}"
+ },
+ "borderWidth" : 0
}
- ]
+ }
}
diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json
index 53dd82e8d6..add2cbb0be 100644
--- a/stats/pwc-language-breakdown-summary.json
+++ b/stats/pwc-language-breakdown-summary.json
@@ -1,63 +1,63 @@
{
- "legend" : {
- "enabled" : "false"
- },
- "tooltip" : {
- "pointFormat" : "<b>{point.y:.0f}</b>"
- },
- "title" : {
- "text" : "Perl Weekly Challenge Contributions [2019 - 2020]"
- },
"xAxis" : {
"labels" : {
"style" : {
- "fontFamily" : "Verdana, sans-serif",
- "fontSize" : "13px"
+ "fontSize" : "13px",
+ "fontFamily" : "Verdana, sans-serif"
}
},
"type" : "category"
},
- "chart" : {
- "type" : "column"
- },
"subtitle" : {
- "text" : "Last updated at 2020-05-11 08:10:40 GMT"
+ "text" : "Last updated at 2020-05-11 08:33:44 GMT"
},
- "yAxis" : {
- "min" : 0,
- "title" : {
- "text" : null
- }
+ "title" : {
+ "text" : "Perl Weekly Challenge Contributions [2019 - 2020]"
+ },
+ "legend" : {
+ "enabled" : "false"
},
"series" : [
{
- "name" : "Contributions",
+ "dataLabels" : {
+ "align" : "right",
+ "color" : "#FFFFFF",
+ "style" : {
+ "fontFamily" : "Verdana, sans-serif",
+ "fontSize" : "13px"
+ },
+ "y" : 10,
+ "enabled" : "true",
+ "format" : "{point.y:.0f}",
+ "rotation" : -90
+ },
"data" : [
[
"Blog",
- 678
+ 679
],
[
"Perl",
- 2501
+ 2503
],
[
"Raku",
- 1572
+ 1574
]
],
- "dataLabels" : {
- "format" : "{point.y:.0f}",
- "y" : 10,
- "align" : "right",
- "rotation" : -90,
- "style" : {
- "fontFamily" : "Verdana, sans-serif",
- "fontSize" : "13px"
- },
- "enabled" : "true",
- "color" : "#FFFFFF"
- }
+ "name" : "Contributions"
}
- ]
+ ],
+ "chart" : {
+ "type" : "column"
+ },
+ "tooltip" : {
+ "pointFormat" : "<b>{point.y:.0f}</b>"
+ },
+ "yAxis" : {
+ "title" : {
+ "text" : null
+ },
+ "min" : 0
+ }
}
diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json
index a95f1efdc4..7fb1327362 100644
--- a/stats/pwc-language-breakdown.json
+++ b/stats/pwc-language-breakdown.json
@@ -1,18 +1,13 @@
{
- "plotOptions" : {
- "series" : {
- "dataLabels" : {
- "enabled" : 1,
- "format" : "{point.y}"
- },
- "borderWidth" : 0
- }
+ "chart" : {
+ "type" : "column"
+ },
+ "legend" : {
+ "enabled" : "false"
},
"drilldown" : {
"series" : [
{
- "name" : "001",
- "id" : "001",
"data" : [
[
"Perl",
@@ -26,9 +21,12 @@
"Blog",
11
]
- ]
+ ],
+ "name" : "001",
+ "id" : "001"
},
{
+ "id" : "002",
"data" : [
[
"Perl",
@@ -43,12 +41,10 @@
10
]
],
- "name" : "002",
- "id" : "002"
+ "name" : "002"
},
{
"id" : "003",
- "name" : "003",
"data" : [
[
"Perl",
@@ -62,11 +58,10 @@
"Blog",
9
]
- ]
+ ],
+ "name" : "003"
},
{
- "id" : "004",
- "name" : "004",
"data" : [
[
"Perl",
@@ -80,11 +75,11 @@
"Blog",
10
]
- ]
+ ],
+ "id" : "004",
+ "name" : "004"
},
{
- "name" : "005",
- "id" : "005",
"data" : [
[
"Perl",
@@ -98,9 +93,12 @@
"Blog",
12
]
- ]
+ ],
+ "id" : "005",
+ "name" : "005"
},
{
+ "name" : "006",
"data" : [
[
"Perl",
@@ -115,8 +113,7 @@
7
]
],
- "id" : "006",
- "name" : "006"
+ "id" : "006"
},
{
"data" : [
@@ -155,6 +152,7 @@
"id" : "008"
},
{
+ "id" : "009",
"data" : [
[
"Perl",
@@ -169,10 +167,10 @@
13
]
],
- "name" : "009",
- "id" : "009"
+ "name" : "009"
},
{
+ "name" : "010",
"data" : [
[
"Perl",
@@ -187,12 +185,10 @@
11
]
],
- "name" : "010",
"id" : "010"
},
{
"name" : "011",
- "id" : "011",
"data" : [
[
"Perl",
@@ -206,11 +202,10 @@
"Blog",
10
]
- ]
+ ],
+ "id" : "011"
},
{
- "name" : "012",
- "id" : "012",
"data" : [
[
"Perl",
@@ -224,9 +219,12 @@
"Blog",
11
]
- ]
+ ],
+ "id" : "012",
+ "name" : "012"
},
{
+ "id" : "013",
"data" : [
[
"Perl",
@@ -241,12 +239,10 @@
13
]
],
- "name" : "013",
- "id" : "013"
+ "name" : "013"
},
{
"id" : "014",
- "name" : "014",
"data" : [
[
"Perl",
@@ -260,7 +256,8 @@
"Blog",
15
]
- ]
+ ],
+ "name" : "014"
},
{
"data" : [
@@ -299,6 +296,7 @@
"name" : "016"
},
{
+ "id" : "017",
"data" : [
[
"Perl",
@@ -313,12 +311,9 @@
12
]
],
- "id" : "017",
"name" : "017"
},
{
- "name" : "018",
- "id" : "018",
"data" : [
[
"Perl",
@@ -332,11 +327,11 @@
"Blog",
14
]
- ]
+ ],
+ "name" : "018",
+ "id" : "018"
},
{
- "name" : "019",
- "id" : "019",
"data" : [
[
"Perl",
@@ -350,11 +345,12 @@
"Blog",
13
]
- ]
+ ],
+ "id" : "019",
+ "name" : "019"
},
{
"name" : "020",
- "id" : "020",
"data" : [
[
"Perl",
@@ -368,11 +364,11 @@
"Blog",
13
]
- ]
+ ],
+ "id" : "020"
},
{
"id" : "021",
- "name" : "021",
"data" : [
[
"Perl",
@@ -386,11 +382,10 @@
"Blog",
10
]
- ]
+ ],
+ "name" : "021"
},
{
- "id" : "022",
- "name" : "022",
"data" : [
[
"Perl",
@@ -404,11 +399,11 @@
"Blog",
10
]
- ]
+ ],
+ "id" : "022",
+ "name" : "022"
},
{
- "id" : "023",
- "name" : "023",
"data" : [
[
"Perl",
@@ -422,11 +417,11 @@
"Blog",
12
]
- ]
+ ],
+ "id" : "023",
+ "name" : "023"
},
{
- "name" : "024",
- "id" : "024",
"data" : [
[
"Perl",
@@ -440,11 +435,11 @@
"Blog",
11
]
- ]
+ ],
+ "id" : "024",
+ "name" : "024"
},
{
- "id" : "025",
- "name" : "025",
"data" : [
[
"Perl",
@@ -458,11 +453,11 @@
"Blog",
12
]
- ]
+ ],
+ "name" : "025",
+ "id" : "025"
},
{
- "id" : "026",
- "name" : "026",
"data" : [
[
"Perl",
@@ -476,7 +471,9 @@
"Blog",
10
]
- ]
+ ],
+ "id" : "026",
+ "name" : "026"
},
{
"data" : [
@@ -497,6 +494,7 @@
"id" : "027"
},
{
+ "name" : "028",
"data" : [
[
"Perl",
@@ -511,10 +509,10 @@
9
]
],
- "name" : "028",
"id" : "028"
},
{
+ "name" : "029",
"data" : [
[
"Perl",
@@ -529,12 +527,9 @@
12
]
],
- "name" : "029",
"id" : "029"
},
{
- "id" : "030",
- "name" : "030",
"data" : [
[
"Perl",
@@ -548,11 +543,12 @@
"Blog",
10
]
- ]
+ ],
+ "name" : "030",
+ "id" : "030"
},
{
"id" : "031",
- "name" : "031",
"data" : [
[
"Perl",
@@ -566,10 +562,10 @@
"Blog",
9
]
- ]
+ ],
+ "name" : "031"
},
{
- "name" : "032",
"id" : "032",
"data" : [
[
@@ -584,11 +580,10 @@
"Blog",
10
]
- ]
+ ],
+ "name" : "032"
},
{
- "name" : "033",
- "id" : "033",
"data" : [
[
"Perl",
@@ -602,10 +597,11 @@
"Blog",
10
]
- ]
+ ],
+ "name" : "033",
+ "id" : "033"
},
{
- "name" : "034",
"id" : "034",
"data" : [
[
@@ -620,9 +616,11 @@
"Blog",
11
]
- ]
+ ],
+ "name" : "034"
},
{
+ "id" : "035",
"data" : [
[
"Perl",
@@ -637,8 +635,7 @@
9
]
],
- "name" : "035",
- "id" : "035"
+ "name" : "035"
},
{
"data" : [
@@ -655,8 +652,8 @@
11
]
],
- "name" : "036",
- "id" : "036"
+ "id" : "036",
+ "name" : "036"
},
{
"data" : [
@@ -673,11 +670,10 @@
9
]
],
- "name" : "037",
- "id" : "037"
+ "id" : "037",
+ "name" : "037"
},
{
- "id" : "038",
"name" : "038",
"data" : [
[
@@ -692,7 +688,8 @@
"Blog",
12
]
- ]
+ ],
+ "id" : "038"
},
{
"data" : [
@@ -727,10 +724,11 @@
10
]
],
- "id" : "040",
- "name" : "040"
+ "name" : "040",
+ "id" : "040"
},
{
+ "id" : "041",
"data" : [
[
"Perl",
@@ -745,11 +743,9 @@
9
]
],
- "id" : "041",
"name" : "041"
},
{
- "id" : "042",
"name" : "042",
"data" : [
[
@@ -764,10 +760,10 @@
"Blog",
11
]
- ]
+ ],
+ "id" : "042"
},
{
- "id" : "043",
"name" : "043",
"data" : [
[
@@ -782,7 +778,8 @@
"Blog",
11
]
- ]
+ ],
+ "id" : "043"
},
{
"data" : [
@@ -803,6 +800,7 @@
"name" : "044"
},
{
+ "id" : "045",
"data" : [
[
"Perl",
@@ -817,10 +815,10 @@
11
]
],
- "name" : "045",
- "id" : "045"
+ "name" : "045"
},
{
+ "id" : "046",
"data" : [
[
"Perl",
@@ -835,8 +833,7 @@
10
]
],
- "name" : "046",
- "id" : "046"
+ "name" : "046"
},
{
"data" : [
@@ -876,7 +873,6 @@
},
{
"id" : "049",
- "name" : "049",
"data" : [
[
"Perl",
@@ -890,7 +886,8 @@
"Blog",
12
]
- ]
+ ],
+ "name" : "049"
},
{
"data" : [
@@ -907,8 +904,8 @@
12
]
],
- "id" : "050",
- "name" : "050"
+ "name" : "050",
+ "id" : "050"
},
{
"data" : [
@@ -929,6 +926,7 @@
"name" : "051"
},
{
+ "name" : "052",
"data" : [
[
"Perl",
@@ -943,10 +941,10 @@
14
]
],
- "name" : "052",
"id" : "052"
},
{
+ "id" : "053",
"data" : [
[
"Perl",
@@ -961,12 +959,9 @@
15
]
],
- "id" : "053",
"name" : "053"
},
{
- "id" : "054",
- "name" : "054",
"data" : [
[
"Perl",
@@ -980,11 +975,11 @@
"Blog",
16
]
- ]
+ ],
+ "id" : "054",
+ "name" : "054"
},
{
- "id" : "055",
- "name" : "055",
"data" : [
[
"Perl",
@@ -998,11 +993,11 @@
"Blog",
14
]
- ]
+ ],
+ "id" : "055",
+ "name" : "055"
},
{
- "name" : "056",
- "id" : "056",
"data" : [
[
"Perl",
@@ -1016,7 +1011,9 @@
"Blog",
16
]
- ]
+ ],
+ "id" : "056",
+ "name" : "056"
},
{
"data" : [
@@ -1055,8 +1052,6 @@
"name" : "058"
},
{
- "id" : "059",
- "name" : "059",
"data" : [
[
"Perl",
@@ -1070,69 +1065,63 @@
"Blog",
14
]
- ]
+ ],
+ "name" : "059",
+ "id" : "059"
},
{
- "id" : "060",
"name" : "060",
"data" : [
[
"Perl",
- 0
+ 2
],
[
"Raku",
- 2
+ 4
],
[
"Blog",
- 2
+ 3
]
- ]
+ ],
+ "id" : "060"
}
]
},
- "subtitle" : {
- "text" : "Click the columns to drilldown the language breakdown. Last updated at 2020-05-11 08:10:40 GMT"
- },
- "yAxis" : {
- "title" : {
- "text" : "Total Solutions"
- }
- },
"series" : [
{
- "colorByPoint" : "true",
+ "name" : "Perl Weekly Challenge Languages",
"data" : [
{
"name" : "#001",
- "y" : 142,
- "drilldown" : "001"
+ "drilldown" : "001",
+ "y" : 142
},
{
- "y" : 109,
"drilldown" : "002",
+ "y" : 109,
"name" : "#002"
},
{
- "name" : "#003",
"y" : 71,
- "drilldown" : "003"
+ "drilldown" : "003",
+ "name" : "#003"
},
{
- "y" : 91,
"drilldown" : "004",
+ "y" : 91,
"name" : "#004"
},
{
- "drilldown" : "005",
+ "name" : "#005",
"y" : 72,
- "name" : "#005"
+ "drilldown" : "005"
},
{
+ "name" : "#006",
"drilldown" : "006",
- "y" : 52,
- "name" : "#006"
+ "y" : 52
},
{
"name" : "#007",
@@ -1155,9 +1144,9 @@
"y" : 60
},
{
+ "name" : "#011",
"drilldown" : "011",
- "y" : 79,
- "name" : "#011"
+ "y" : 79
},
{
"name" : "#012",
@@ -1165,14 +1154,14 @@
"drilldown" : "012"
},
{
- "drilldown" : "013",
"y" : 76,
+ "drilldown" : "013",
"name" : "#013"
},
{
- "name" : "#014",
"y" : 96,
- "drilldown" : "014"
+ "drilldown" : "014",
+ "name" : "#014"
},
{
"drilldown" : "015",
@@ -1195,33 +1184,33 @@
"drilldown" : "018"
},
{
- "y" : 97,
+ "name" : "#019",
"drilldown" : "019",
- "name" : "#019"
+ "y" : 97
},
{
- "name" : "#020",
"y" : 95,
- "drilldown" : "020"
+ "drilldown" : "020",
+ "name" : "#020"
},
{
- "name" : "#021",
"drilldown" : "021",
- "y" : 67
+ "y" : 67,
+ "name" : "#021"
},
{
- "y" : 63,
+ "name" : "#022",
"drilldown" : "022",