From b06418cfa910d41d2ac1c01143fa5c91c147810e Mon Sep 17 00:00:00 2001 From: Jose Luis Perez Date: Tue, 13 Oct 2020 17:31:03 +0200 Subject: chalenge 1 first iteration --- challenge-082/jluis/perl/ch-1.pl | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 challenge-082/jluis/perl/ch-1.pl diff --git a/challenge-082/jluis/perl/ch-1.pl b/challenge-082/jluis/perl/ch-1.pl new file mode 100755 index 0000000000..03085bbc6d --- /dev/null +++ b/challenge-082/jluis/perl/ch-1.pl @@ -0,0 +1,55 @@ +#!/usr/bin/env perl +# common divisors +# + +use strict; +use warnings; + +use 5.010; + +if (2 > @ARGV ) { + say STDERR qq(you sould pass 2 integer numbers ex : ./ch-1.pl 30 50); +} + +my ($M,$N) = @ARGV; + +if (qq($M$N) !~ /^\d+$/xms) { + say STDERR qq(only integers are allowed "$M$N"); +} + +# by the examples we should discard that any number is a factor of itself 1*n == n and n/n = 1 +# +sub factors { + my $num = shift; + if ($num > 0) { + my $upper = int $num / 2; + return ( 1,grep {! ($num % $_) } (2..$upper) ) + } + return (); +} + +sub comon { + my @a = factors shift; + say join "a",@a; + my @b = factors shift; + say join "b",@b; + if ($#a == 0 or $#b == 0) { + return (); + } + my ($i,$j) = (1,1); + my @common = (); + while ($i <= $#a and $j <= $#b) { + if ($a[$i] == $b[$j]) { + push @common, $a[$i] ; + $i += 1; + $j += 1; + } elsif ($a[$i] > $b[$j]) { + $j += 1; + } else { + $i += 1; + } + } + return (1,@common); +} + +say join q{,} , comon $M,$N; -- cgit From 39d1057daca1a3f0ebd9bdf5de4b3488ee8bc7ce Mon Sep 17 00:00:00 2001 From: Walt Mankowski Date: Tue, 13 Oct 2020 20:44:27 -0400 Subject: Perl code for Challenge 82 Task 1 --- challenge-082/walt-mankowski/perl/ch-1.pl | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 challenge-082/walt-mankowski/perl/ch-1.pl diff --git a/challenge-082/walt-mankowski/perl/ch-1.pl b/challenge-082/walt-mankowski/perl/ch-1.pl new file mode 100644 index 0000000000..8a426edc85 --- /dev/null +++ b/challenge-082/walt-mankowski/perl/ch-1.pl @@ -0,0 +1,29 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use feature qw(:5.32); +use experimental qw(signatures); +use Set::Scalar; + +# TASK #1 › Common Factors +# Submitted by: Niels van Dijke +# +# You are given 2 positive numbers $M and $N. +# +# Write a script to list all common factors of the given numbers. + +my ($m, $n) = @ARGV; +local $, = ", "; +my $s1 = factors($m); +my $s2 = factors($n); +say $s1->intersection($s2); + +sub factors($n) { + my $s = Set::Scalar->new(1); + for my $i (2..sqrt($n)) { + $s->insert($i, $n / $i) if $n % $i == 0; + } + + return $s; +} + -- cgit From 7da03966566adf488a5f47b9787e9b9fff531ca6 Mon Sep 17 00:00:00 2001 From: Walt Mankowski Date: Tue, 13 Oct 2020 20:55:32 -0400 Subject: Perl code for Challenge 82 Task 2 --- challenge-082/walt-mankowski/perl/ch-2.pl | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 challenge-082/walt-mankowski/perl/ch-2.pl diff --git a/challenge-082/walt-mankowski/perl/ch-2.pl b/challenge-082/walt-mankowski/perl/ch-2.pl new file mode 100644 index 0000000000..df3cb42818 --- /dev/null +++ b/challenge-082/walt-mankowski/perl/ch-2.pl @@ -0,0 +1,35 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use feature qw(:5.32); +use experimental qw(signatures); + +# TASK #2 › Interleave String +# Submitted by: Mohammad S Anwar +# +# You are given 3 strings; $A, $B and $C. +# +# Write a script to check if $C is created by interleave $A and $B. +# +# Print 1 if check is success otherwise 0. + +my ($A, $B, $C) = @ARGV; + +say is_interleave($A, $B, $C); + +sub is_interleave($A, $B, $C) { + if ($A eq '' && $B eq '' && $C eq '') { + return 1; + } + + my $found = 0; + if (substr($A, 0, 1) eq substr($C, 0, 1)) { + $found = 1; + return is_interleave(substr($A, 1), $B, substr($C, 1)); + } + if (substr($B, 0, 1) eq substr($C, 0, 1)) { + $found = 1; + return is_interleave($A, substr($B, 1), substr($C, 1)); + } + return 0 unless $found; +} -- cgit From fa86269bd5c1a37f0f28d528ecb278b7899b88f1 Mon Sep 17 00:00:00 2001 From: Walt Mankowski Date: Tue, 13 Oct 2020 21:14:59 -0400 Subject: Python code for Challenge 82 Task 2 --- challenge-082/walt-mankowski/python/ch-2.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 challenge-082/walt-mankowski/python/ch-2.py diff --git a/challenge-082/walt-mankowski/python/ch-2.py b/challenge-082/walt-mankowski/python/ch-2.py new file mode 100644 index 0000000000..662f0816d6 --- /dev/null +++ b/challenge-082/walt-mankowski/python/ch-2.py @@ -0,0 +1,23 @@ +from sys import argv + +def is_interleave(a, b, c): + if a == '' and b == '' and c == '': + return 1 + elif c == '': + return 0 + + found = False + if len(a) > 0 and a[0] == c[0]: + found = True + return is_interleave(a[1:], b, c[1:]) + + if len(b) > 0 and b[0] == c[0]: + found = True + return is_interleave(a, b[1:], c[1:]) + + if not found: + return 0 + +a, b, c = argv[1:] + +print(is_interleave(a, b, c)) -- cgit From 2d0c4c1678aa2caa7f0c42e90708ffa019dfc988 Mon Sep 17 00:00:00 2001 From: Walt Mankowski Date: Tue, 13 Oct 2020 21:18:20 -0400 Subject: replaced bounds checking with try clauses --- challenge-082/walt-mankowski/python/ch-2.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/challenge-082/walt-mankowski/python/ch-2.py b/challenge-082/walt-mankowski/python/ch-2.py index 662f0816d6..c9ef4de6f2 100644 --- a/challenge-082/walt-mankowski/python/ch-2.py +++ b/challenge-082/walt-mankowski/python/ch-2.py @@ -3,17 +3,21 @@ from sys import argv def is_interleave(a, b, c): if a == '' and b == '' and c == '': return 1 - elif c == '': - return 0 found = False - if len(a) > 0 and a[0] == c[0]: - found = True - return is_interleave(a[1:], b, c[1:]) + try: + if a[0] == c[0]: + found = True + return is_interleave(a[1:], b, c[1:]) + except IndexError: + pass - if len(b) > 0 and b[0] == c[0]: - found = True - return is_interleave(a, b[1:], c[1:]) + try: + if b[0] == c[0]: + found = True + return is_interleave(a, b[1:], c[1:]) + except IndexError: + pass if not found: return 0 -- cgit From e0cea5b6dcbc43a547d1401d70335c6ba74ec0c8 Mon Sep 17 00:00:00 2001 From: Walt Mankowski Date: Tue, 13 Oct 2020 21:18:31 -0400 Subject: Python code for Challenge 82 Task 1 --- challenge-082/walt-mankowski/python/ch-1.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 challenge-082/walt-mankowski/python/ch-1.py diff --git a/challenge-082/walt-mankowski/python/ch-1.py b/challenge-082/walt-mankowski/python/ch-1.py new file mode 100644 index 0000000000..d0f56b7fcb --- /dev/null +++ b/challenge-082/walt-mankowski/python/ch-1.py @@ -0,0 +1,13 @@ +from sys import argv +from math import sqrt + +def factors(n): + s = set([1]) + for i in range(2, int(sqrt(n))+1) : + if n % i == 0: + s.add(i) + s.add(n // i) + return s + +m, n = [int(x) for x in argv[1:]] +print(factors(m) & factors(n)) -- cgit From c5460619b5d2581253ef6dd1b45f192fa1c7cb03 Mon Sep 17 00:00:00 2001 From: Jose Luis Perez Date: Wed, 14 Oct 2020 12:30:22 +0200 Subject: nice the output of ch-1 --- challenge-082/jluis/perl/ch-1.pl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/challenge-082/jluis/perl/ch-1.pl b/challenge-082/jluis/perl/ch-1.pl index 03085bbc6d..f1718b68bf 100755 --- a/challenge-082/jluis/perl/ch-1.pl +++ b/challenge-082/jluis/perl/ch-1.pl @@ -9,12 +9,14 @@ use 5.010; if (2 > @ARGV ) { say STDERR qq(you sould pass 2 integer numbers ex : ./ch-1.pl 30 50); + exit; } my ($M,$N) = @ARGV; if (qq($M$N) !~ /^\d+$/xms) { say STDERR qq(only integers are allowed "$M$N"); + exit; } # by the examples we should discard that any number is a factor of itself 1*n == n and n/n = 1 @@ -30,9 +32,7 @@ sub factors { sub comon { my @a = factors shift; - say join "a",@a; my @b = factors shift; - say join "b",@b; if ($#a == 0 or $#b == 0) { return (); } @@ -52,4 +52,14 @@ sub comon { return (1,@common); } -say join q{,} , comon $M,$N; +sub format_list { + my $out = "("; + while (my $val = shift) { + $out .= '"'.$val.'"'; + $out .= ',' if defined $_[0]; + } + return "$out)"; +} + + +say format_list comon $M,$N; -- cgit From c1241ad23756bb8da746cb0bf44f61d56759be33 Mon Sep 17 00:00:00 2001 From: Jose Luis Perez Date: Wed, 14 Oct 2020 18:12:34 +0200 Subject: chalenge 2 complete --- challenge-082/jluis/perl/ch-2.pl | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 challenge-082/jluis/perl/ch-2.pl diff --git a/challenge-082/jluis/perl/ch-2.pl b/challenge-082/jluis/perl/ch-2.pl new file mode 100755 index 0000000000..4a14048e02 --- /dev/null +++ b/challenge-082/jluis/perl/ch-2.pl @@ -0,0 +1,42 @@ +#!/usr/bin/env perl +# common divisors +# + +use strict; +use warnings; + +use 5.010; + +if (3 != @ARGV ) { + say STDERR qq(you sould pass 3 strings quoted if they contain spaces : ./ch-2.pl " oc" casa "ca saoc"); + exit; +} + +my ($A,$B,$C) = @ARGV; + +say 0 and exit if length $C != length qq($A$B); + +my %source =(A=>$A,B=>$B); + + + +my $pos = 0; +my $bases = q{}; + +while ( length $bases < length $C) { + my $check = length $bases; + for my $choice (qw(A B)) { + if ( length $source{$choice}) { + if ( (substr $source{$choice},0,1 ) eq substr $C,length $bases ,1 ) { + $bases .= $choice; + (substr $source{$choice},0,1 ) = q{}; + last; + } + } + + } + last if $check == length $bases + +} + +say 0 + (length $bases == length $C) ; -- cgit From 2bb8074a1e3d409e9a99ff936f67f5ec9c8d5d30 Mon Sep 17 00:00:00 2001 From: "E. Choroba" Date: Fri, 16 Oct 2020 09:19:30 +0200 Subject: Optimize 082/1 by E. Choroba: Only iterate to a square root --- challenge-082/e-choroba/perl5/ch-1.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/challenge-082/e-choroba/perl5/ch-1.pl b/challenge-082/e-choroba/perl5/ch-1.pl index bac0ff5500..aeea793065 100755 --- a/challenge-082/e-choroba/perl5/ch-1.pl +++ b/challenge-082/e-choroba/perl5/ch-1.pl @@ -5,12 +5,14 @@ use strict; sub common_factors { my ($m, $n) = @_; ($m, $n) = ($n, $m) if $n < $m; - my @r; - for my $i (1 .. $m) { - push @r, $i if 0 == $m % $i - && 0 == $n % $i; + my (@r, @rev_r); + for my $i (1 .. sqrt $m) { + if (0 == $m % $i) { + push @r, $i if 0 == $n % $i; + unshift @rev_r, $m / $i if 0 == $n % ($m / $i); + } } - return \@r + return [@r, @rev_r] } use Test::More; -- cgit From d04340bbc0ff6dc42a4fe2fc6cc849ff4bc53c66 Mon Sep 17 00:00:00 2001 From: juliodcs Date: Fri, 16 Oct 2020 20:35:37 +0200 Subject: Re-do ch-2; I completely misunderstood the requirements 😳 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- challenge-082/juliodcs/perl/ch-2.pl | 9 +++++---- challenge-082/juliodcs/raku/ch-2.raku | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/challenge-082/juliodcs/perl/ch-2.pl b/challenge-082/juliodcs/perl/ch-2.pl index 6480571850..5e6398cfdf 100644 --- a/challenge-082/juliodcs/perl/ch-2.pl +++ b/challenge-082/juliodcs/perl/ch-2.pl @@ -2,10 +2,11 @@ use strict; use warnings; use experimental 'signatures'; use feature 'say'; -use experimental 'smartmatch'; -sub comparable($string) { - join q(), sort split m//, $string +sub interleaved($a, $b, $c) { + my ($is_a, $is_b) = (0, 0); + $c =~ s/(\Q$a\E)|\Q$b\E/ $1 and ++$is_a or ++$is_b; '' /e for 1 .. 2; + $c eq q() && $is_a && $is_b } -say comparable(shift . shift) eq comparable(shift) ? 1 : 0; +say interleaved(@ARGV) ? 1 : 0; diff --git a/challenge-082/juliodcs/raku/ch-2.raku b/challenge-082/juliodcs/raku/ch-2.raku index 2b4cfcc3ee..2821998f72 100644 --- a/challenge-082/juliodcs/raku/ch-2.raku +++ b/challenge-082/juliodcs/raku/ch-2.raku @@ -1,9 +1,9 @@ #!/usr/bin/env raku -sub infix:<≈≈>(Str \x, Str \y) is equiv(&[eq]) returns Bool { - x.ords.sort == y.ords.sort +sub interleaved($a, $b, $c is rw) { + my ($is_a, $is_b) = 0, 0; + $c ~~ s/($a)|$b/{ $0 and ++$is_a or ++$is_b; 「」 }/ for ^2; + +($c eq 「」 && $is_a && $is_b) } -sub MAIN(Str \a, Str \b, Str \c) { - say +(a ~ b ≈≈ c) -} +say interleaved |@*ARGS; -- cgit From 22833e3a33c399358b0229525e0a6a587db8aa3b Mon Sep 17 00:00:00 2001 From: Lubos Kolouch Date: Fri, 16 Oct 2020 21:15:56 +0200 Subject: Challenge 082 Task 2 Perl LK --- challenge-082/lubos-kolouch/perl/ch-2.pl | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 challenge-082/lubos-kolouch/perl/ch-2.pl diff --git a/challenge-082/lubos-kolouch/perl/ch-2.pl b/challenge-082/lubos-kolouch/perl/ch-2.pl new file mode 100644 index 0000000000..10afd11037 --- /dev/null +++ b/challenge-082/lubos-kolouch/perl/ch-2.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: ch-2.pl +# +# USAGE: ./ch-2.pl +# +# DESCRIPTION: Perl Weekly Challenge 082 +# http://www.perlweeklychallenge.org +# Task 2 - Interleave String +# +# AUTHOR: Lubos Kolouch +# CREATED: 10/16/2020 07:25:23 PM +#=============================================================================== + +use strict; +use warnings; +use 5.022; + +sub InterLeave { + + my ($params) = @_; + + my $result = $params->{'result'} // {}; + my $a = $params->{'a'}; + my $b = $params->{'b'}; + my $c = $params->{'c'}; + my $current = $params->{'current'} // ''; + + if (not $a and not $b) { + $result->{$current} = 1; + return $result; + } + + $result = InterLeave({'a' => substr($a, 1), 'b' => $b, 'current' => $current.substr($a,0,1), 'result' => $result }) if length($a); + $result = InterLeave({'b' => substr($b, 1), 'a' => $a, 'current' => $current.substr($b,0,1), 'result' => $result }) if length($b); + + return $result; +} + +sub can_interleave { + my ($params) = @_; + + return 0 unless length($params->{'a'}) + length($params->{'b'}) == length($params->{'c'}); + + my $result = InterLeave($params); + + return defined $$result{$params->{'c'}}? 1: 0; +} + +use Test::More; + +is_deeply(can_interleave( { 'a' => 'XY', 'b' => 'X', c => 'XXY' } ), 1); +is_deeply(can_interleave( { 'a' => 'XXY', 'b' => 'XXZ', c => 'XXXXZY' } ), 1); +is_deeply(can_interleave( { 'a' => 'YX', 'b' => 'X', c => 'XXY' } ), 0); +is_deeply(can_interleave( { 'a' => 'XXY', 'b' => 'X', c => 'XXY' } ), 0); + +done_testing; -- cgit From 6c79809ecc52ebb517c521d9095ae5785e9c1862 Mon Sep 17 00:00:00 2001 From: Nuno Vieira Date: Fri, 16 Oct 2020 21:28:06 +0100 Subject: Add nunovieira220 perl solution to challenge 082 --- challenge-082/nunovieira220/perl/ch-1.pl | 18 +++++++++++++++ challenge-082/nunovieira220/perl/ch-2.pl | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 challenge-082/nunovieira220/perl/ch-1.pl create mode 100644 challenge-082/nunovieira220/perl/ch-2.pl diff --git a/challenge-082/nunovieira220/perl/ch-1.pl b/challenge-082/nunovieira220/perl/ch-1.pl new file mode 100644 index 0000000000..c0026791b3 --- /dev/null +++ b/challenge-082/nunovieira220/perl/ch-1.pl @@ -0,0 +1,18 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use List::Util qw[min]; + +# Input +my $M = 12; +my $N = 18; + +# Get common factors +my @res = (); +for (1..min($M, $N)) { + push @res, $_ if($M % $_ == 0 && $N % $_ == 0); +} + +# Output +print join(', ', @res); \ No newline at end of file diff --git a/challenge-082/nunovieira220/perl/ch-2.pl b/challenge-082/nunovieira220/perl/ch-2.pl new file mode 100644 index 0000000000..d0926b6a3b --- /dev/null +++ b/challenge-082/nunovieira220/perl/ch-2.pl @@ -0,0 +1,39 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use feature qw(say); + +# Input +my $A = "XXY"; +my $B = "XXZ"; +my $C = "XXXXZY"; + +# Output +say interleave($A, $B, $C); + +# Interleave +sub interleave { + my ($A, $B, $C) = @_; + + return 0 if(length($A) + length($B) != length($C)); + return interleaveChecker($A, $B, $C); +} + +# Interleave checker +sub interleaveChecker { + my ($A, $B, $C) = @_; + + return 1 if (!$C); + + my $a = substr($A, 0, 1); + my $b = substr($B, 0, 1); + my $c = substr($C, 0, 1); + my $firstTree = 0; + my $secondTree = 0; + + $firstTree = interleaveChecker(substr($A, 1, 1), $B, substr($C, 1, 1)) if($a eq $c); + $secondTree = interleaveChecker($A, substr($B, 1, 1), substr($C, 1, 1)) if($b eq $c); + + return $firstTree + $secondTree > 0 || 0; +} \ No newline at end of file -- cgit From c75b8f6de3623c7263cc44b26786873da78747bd Mon Sep 17 00:00:00 2001 From: Nuno Vieira Date: Fri, 16 Oct 2020 21:28:23 +0100 Subject: Add nunovieira220 js solution to challenge 082 --- challenge-082/nunovieira220/js/ch-1.js | 13 ++++++++++++ challenge-082/nunovieira220/js/ch-2.js | 38 ++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 challenge-082/nunovieira220/js/ch-1.js create mode 100644 challenge-082/nunovieira220/js/ch-2.js diff --git a/challenge-082/nunovieira220/js/ch-1.js b/challenge-082/nunovieira220/js/ch-1.js new file mode 100644 index 0000000000..6e5b2ef1cf --- /dev/null +++ b/challenge-082/nunovieira220/js/ch-1.js @@ -0,0 +1,13 @@ +// Input +const M = 12; +const N = 18; + +// Common Base String +const res = []; + +for (let i = 1; i < Math.min(M, N); i++) { + if(M % i === 0 && N % i == 0) res.push(i); +} + +// Output +console.log(res); \ No newline at end of file diff --git a/challenge-082/nunovieira220/js/ch-2.js b/challenge-082/nunovieira220/js/ch-2.js new file mode 100644 index 0000000000..67c8bf2f59 --- /dev/null +++ b/challenge-082/nunovieira220/js/ch-2.js @@ -0,0 +1,38 @@ +// Interleave +const interleave = (A, B, C) => { + if(A.length + B.length !== C.length) { + return 0; + } + + return interleaveChecker(A, B, C); +} + +// Interleave checker +const interleaveChecker = (A, B, C) => { + if(!C) return 1; + + const a = A.charAt(0); + const b = B.charAt(0); + const c = C.charAt(0); + let firstTree = 0; + let secondTree = 0; + + if(a === c) { + firstTree = interleaveChecker(A.substring(1), B, C.substring(1)); + } + + if(b === c) { + secondTree = interleaveChecker(A, B.substring(1), C.substring(1)) + } + + return firstTree + secondTree > 0 | 0; +} + +// Input +const A = 'XXY'; +const B = 'XXZ'; +const C = 'XXXXZY'; + +// Output +console.log(interleave(A, B, C)); + -- cgit From d198f9c1f1477ca6a02f67dade78b846fff54d02 Mon Sep 17 00:00:00 2001 From: juliodcs Date: Sat, 17 Oct 2020 01:04:48 +0200 Subject: Fix case when a=b --- challenge-082/juliodcs/perl/ch-2.pl | 3 ++- challenge-082/juliodcs/raku/ch-2.raku | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/challenge-082/juliodcs/perl/ch-2.pl b/challenge-082/juliodcs/perl/ch-2.pl index 5e6398cfdf..e21df5eee7 100644 --- a/challenge-082/juliodcs/perl/ch-2.pl +++ b/challenge-082/juliodcs/perl/ch-2.pl @@ -4,9 +4,10 @@ use experimental 'signatures'; use feature 'say'; sub interleaved($a, $b, $c) { + ($a, $b) = ($b, $a) if length $a < length $b; my ($is_a, $is_b) = (0, 0); $c =~ s/(\Q$a\E)|\Q$b\E/ $1 and ++$is_a or ++$is_b; '' /e for 1 .. 2; - $c eq q() && $is_a && $is_b + $c eq q() && ($is_a && $is_b || $a eq $b) } say interleaved(@ARGV) ? 1 : 0; diff --git a/challenge-082/juliodcs/raku/ch-2.raku b/challenge-082/juliodcs/raku/ch-2.raku index 2821998f72..ad7c3388f9 100644 --- a/challenge-082/juliodcs/raku/ch-2.raku +++ b/challenge-082/juliodcs/raku/ch-2.raku @@ -1,9 +1,10 @@ #!/usr/bin/env raku -sub interleaved($a, $b, $c is rw) { - my ($is_a, $is_b) = 0, 0; - $c ~~ s/($a)|$b/{ $0 and ++$is_a or ++$is_b; 「」 }/ for ^2; - +($c eq 「」 && $is_a && $is_b) +sub interleaved($a is rw, $b is rw, $c is rw) { + ($a, $b) .= reverse if $a.chars < $b.chars; + my ($has-a, $has-b) = False, False; + $c ~~ s/ $a {$has-a = True} | $b {$has-b = True} // for ^2; + +($c eq 「」 && ($has-a && $has-b || $a eq $b)) } say interleaved |@*ARGS; -- cgit From c67b505da8e678ae41bbba8ce75abb3ef0824fb8 Mon Sep 17 00:00:00 2001 From: juliodcs Date: Sat, 17 Oct 2020 01:16:31 +0200 Subject: Optimize it a little --- challenge-082/juliodcs/perl/ch-2.pl | 6 +++--- challenge-082/juliodcs/raku/ch-2.raku | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/challenge-082/juliodcs/perl/ch-2.pl b/challenge-082/juliodcs/perl/ch-2.pl index e21df5eee7..a3736cde3f 100644 --- a/challenge-082/juliodcs/perl/ch-2.pl +++ b/challenge-082/juliodcs/perl/ch-2.pl @@ -5,9 +5,9 @@ use feature 'say'; sub interleaved($a, $b, $c) { ($a, $b) = ($b, $a) if length $a < length $b; - my ($is_a, $is_b) = (0, 0); - $c =~ s/(\Q$a\E)|\Q$b\E/ $1 and ++$is_a or ++$is_b; '' /e for 1 .. 2; - $c eq q() && ($is_a && $is_b || $a eq $b) + my $found = 0 + $c =~ s/\Q$a\E|\Q$b\E/ $found++; '' /e for 1 .. 2; + $c eq q() && ($found == 2 || $a eq $b) } say interleaved(@ARGV) ? 1 : 0; diff --git a/challenge-082/juliodcs/raku/ch-2.raku b/challenge-082/juliodcs/raku/ch-2.raku index ad7c3388f9..2d15b4937e 100644 --- a/challenge-082/juliodcs/raku/ch-2.raku +++ b/challenge-082/juliodcs/raku/ch-2.raku @@ -2,9 +2,9 @@ sub interleaved($a is rw, $b is rw, $c is rw) { ($a, $b) .= reverse if $a.chars < $b.chars; - my ($has-a, $has-b) = False, False; - $c ~~ s/ $a {$has-a = True} | $b {$has-b = True} // for ^2; - +($c eq 「」 && ($has-a && $has-b || $a eq $b)) + my $found = 0; + $c ~~ s/ $a | $b /{ $found++; 「」 }/ for ^2; + +($c eq 「」 && ($found == 2 || $a eq $b)) } say interleaved |@*ARGS; -- cgit From da55a0914d58c6b84e3ac3aaa1fa9d69078c2db2 Mon Sep 17 00:00:00 2001 From: juliodcs Date: Sat, 17 Oct 2020 02:53:44 +0200 Subject: Fixes and add tests --- challenge-082/juliodcs/perl/ch-2.pl | 35 +++++++++++++++++++++--- challenge-082/juliodcs/raku/ch-2.raku | 51 ++++++++++++++++++++++++++++++++--- 2 files changed, 78 insertions(+), 8 deletions(-) diff --git a/challenge-082/juliodcs/perl/ch-2.pl b/challenge-082/juliodcs/perl/ch-2.pl index a3736cde3f..9cd69fe6b8 100644 --- a/challenge-082/juliodcs/perl/ch-2.pl +++ b/challenge-082/juliodcs/perl/ch-2.pl @@ -5,9 +5,36 @@ use feature 'say'; sub interleaved($a, $b, $c) { ($a, $b) = ($b, $a) if length $a < length $b; - my $found = 0 - $c =~ s/\Q$a\E|\Q$b\E/ $found++; '' /e for 1 .. 2; - $c eq q() && ($found == 2 || $a eq $b) + my ($is_a, $is_b) = (0, 0); + $c =~ s/(\Q$a\E)|\Q$b\E/ $1 and ++$is_a or ++$is_b; '' /e for 1 .. 2; + $c eq q() && ($is_a && $is_b || $a eq $b) } -say interleaved(@ARGV) ? 1 : 0; +if (@ARGV == 3) { + say +interleaved(@ARGV); + exit 0; +} + +eval <<'EOTEST'; +use Test::More tests => 15; +ok !interleaved('A', 'B', 'BB'), 'missing char from a'; +ok !interleaved('A', 'B', 'AA'), 'missing char from b'; +ok !interleaved('A', 'B', 'XX'), 'missing char from a,b'; + +ok interleaved('A', 'B', 'AB'), 'two letters v1'; +ok interleaved('A', 'B', 'BA'), 'two letters v2'; +ok interleaved('B', 'A', 'AB'), 'two letters v3'; +ok interleaved('B', 'A', 'BA'), 'two letters v4'; + +ok interleaved('A', 'A', 'AA'), 'a=b'; +ok interleaved('ABC', 'ABC', 'ABCABC'), 'long a=b'; +ok interleaved('AAA', 'AAA', 'AAAAAA'), 'long a=b, single char'; + +ok interleaved('AB', 'C', 'ACB'), 'ACB basket v1'; +ok interleaved('C', 'AB', 'ACB'), 'ACB basket v2'; + +ok interleaved('XY', 'X', 'XXY'), 'Example 1'; +ok interleaved('XXY', 'XXZ', 'XXXXZY'), 'Example 2'; +ok !interleaved('YX', 'X', 'XXY'), 'Example 3'; + +EOTEST diff --git a/challenge-082/juliodcs/raku/ch-2.raku b/challenge-082/juliodcs/raku/ch-2.raku index 2d15b4937e..965cfbccb4 100644 --- a/challenge-082/juliodcs/raku/ch-2.raku +++ b/challenge-082/juliodcs/raku/ch-2.raku @@ -2,9 +2,52 @@ sub interleaved($a is rw, $b is rw, $c is rw) { ($a, $b) .= reverse if $a.chars < $b.chars; - my $found = 0; - $c ~~ s/ $a | $b /{ $found++; 「」 }/ for ^2; - +($c eq 「」 && ($found == 2 || $a eq $b)) + my ($has-a, $has-b) = False, False; + $c ~~ s/ $a {$has-a = True} | $b {$has-b = True} // for ^2; + $c eq 「」 && ($has-a && $has-b || $a eq $b) } -say interleaved |@*ARGS; +if (@*ARGS.elems == 3) { + say +interleaved |@*ARGS; + exit 0; +} + +use Test; + +plan 15; +my @params; + +@params = 'A', 'B', 'BB'; +ok !interleaved(|@params), 'missing char from a'; +@params = 'A', 'B', 'AA'; +ok !interleaved(|@params), 'missing char from b'; +@params = 'A', 'B', 'XX'; +ok !interleaved(|@params), 'missing char from a,b'; + +@params = 'A', 'B', 'AB'; +ok interleaved(|@params), 'two letters v1'; +@params = 'A', 'B', 'BA'; +ok interleaved(|@params), 'two letters v2'; +@params = 'B', 'A', 'AB'; +ok interleaved(|@params), 'two letters v3'; +@params = 'B', 'A', 'BA'; +ok interleaved(|@params), 'two letters v4'; + +@params = 'A', 'A', 'AA'; +ok interleaved(|@params), 'a=b'; +@params = 'ABC', 'ABC', 'ABCABC'; +ok interleaved(|@params), 'long a=b'; +@params = 'AAA', 'AAA', 'AAAAAA'; +ok interleaved(|@params), 'long a=b, single char'; + +@params = 'AB', 'C', 'ACB'; +ok interleaved(|@params), 'ACB basket v1'; +@params = 'C', 'AB', 'ACB'; +ok interleaved(|@params), 'ACB basket v2'; + +@params = 'XY', 'X', 'XXY'; +ok interleaved(|@params), 'Example 1'; +@params = 'XXY', 'XXZ', 'XXXXZY'; +ok interleaved(|@params), 'Example 2'; +@params = 'YX', 'X', 'XXY'; +ok !interleaved(|@params), 'Example 3'; -- cgit From fe8a4cda4c82033de73826779cc440b7d03dba19 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Sat, 17 Oct 2020 10:21:25 +0100 Subject: - Added solutions by Jose Luis. --- stats/pwc-current.json | 221 +++--- stats/pwc-language-breakdown-summary.json | 38 +- stats/pwc-language-breakdown.json | 1214 ++++++++++++++--------------- stats/pwc-leaders.json | 760 +++++++++--------- stats/pwc-summary-1-30.json | 120 +-- stats/pwc-summary-121-150.json | 104 +-- stats/pwc-summary-151-180.json | 32 +- stats/pwc-summary-181-210.json | 66 +- stats/pwc-summary-31-60.json | 28 +- stats/pwc-summary-61-90.json | 38 +- stats/pwc-summary-91-120.json | 106 +-- stats/pwc-summary.json | 42 +- 12 files changed, 1392 insertions(+), 1377 deletions(-) diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 0bc3f86f21..1a10656d75 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,20 +1,37 @@ { - "tooltip" : { - "pointFormat" : "{point.name}: {point.y:f}
", - "followPointer" : 1, - "headerFormat" : "{series.name}
" - }, "xAxis" : { "type" : "category" }, + "title" : { + "text" : "Perl Weekly Challenge - 082" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + } + } + }, "yAxis" : { "title" : { "text" : "Total Solutions" } }, + "legend" : { + "enabled" : 0 + }, + "tooltip" : { + "pointFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "{series.name}
", + "followPointer" : 1 + }, "drilldown" : { "series" : [ { + "id" : "Abigail", + "name" : "Abigail", "data" : [ [ "Perl", @@ -24,19 +41,17 @@ "Blog", 2 ] - ], - "id" : "Abigail", - "name" : "Abigail" + ] }, { + "name" : "Alexander Pankoff", "data" : [ [ "Perl", 2 ] ], - "id" : "Alexander Pankoff", - "name" : "Alexander Pankoff" + "id" : "Alexander Pankoff" }, { "id" : "Andinus", @@ -53,18 +68,16 @@ "name" : "Andinus" }, { + "name" : "Andrew Shitov", "data" : [ [ "Raku", 2 ] ], - "id" : "Andrew Shitov", - "name" : "Andrew Shitov" + "id" : "Andrew Shitov" }, { - "name" : "Dave Jacoby", - "id" : "Dave Jacoby", "data" : [ [ "Perl", @@ -74,29 +87,32 @@ "Blog", 1 ] - ] + ], + "name" : "Dave Jacoby", + "id" : "Dave Jacoby" }, { - "name" : "E. Choroba", "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "E. Choroba" }, { - "id" : "Feng Chang", "data" : [ [ "Raku", 2 ] ], - "name" : "Feng Chang" + "name" : "Feng Chang", + "id" : "Feng Chang" }, { + "id" : "Flavio Poletti", "name" : "Flavio Poletti", "data" : [ [ @@ -107,12 +123,20 @@ "Blog", 2 ] - ], - "id" : "Flavio Poletti" + ] + }, + { + "id" : "Jose Luis", + "name" : "Jose Luis", + "data" : [ + [ + "Perl", + 2 + ] + ] }, { "name" : "Julio de Castro", - "id" : "Julio de Castro", "data" : [ [ "Perl", @@ -122,7 +146,8 @@ "Raku", 2 ] - ] + ], + "id" : "Julio de Castro" }, { "name" : "Kang-min Liu", @@ -139,24 +164,24 @@ "id" : "Kang-min Liu" }, { - "name" : "Lubos Kolouch", - "id" : "Lubos Kolouch", "data" : [ [ "Perl", 1 ] - ] + ], + "name" : "Lubos Kolouch", + "id" : "Lubos Kolouch" }, { + "id" : "Mark Anderson", + "name" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ], - "id" : "Mark Anderson", - "name" : "Mark Anderson" + ] }, { "id" : "Markus Holzer", @@ -169,24 +194,24 @@ "name" : "Markus Holzer" }, { + "id" : "Myoungjin Jeon", + "name" : "Myoungjin Jeon", "data" : [ [ "Blog", 2 ] - ], - "id" : "Myoungjin Jeon", - "name" : "Myoungjin Jeon" + ] }, { - "name" : "Niels van Dijke", - "id" : "Niels van Dijke", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Niels van Dijke", + "id" : "Niels van Dijke" }, { "name" : "Roger Bell_West", @@ -207,6 +232,8 @@ "id" : "Roger Bell_West" }, { + "id" : "Simon Green", + "name" : "Simon Green", "data" : [ [ "Perl", @@ -216,23 +243,21 @@ "Blog", 1 ] - ], - "id" : "Simon Green", - "name" : "Simon Green" + ] }, { - "name" : "Simon Proctor", + "id" : "Simon Proctor", "data" : [ [ "Raku", 2 ] ], - "id" : "Simon Proctor" + "name" : "Simon Proctor" }, { - "name" : "Steven Wilson", "id" : "Steven Wilson", + "name" : "Steven Wilson", "data" : [ [ "Perl", @@ -241,6 +266,7 @@ ] }, { + "id" : "Ulrich Rieke", "name" : "Ulrich Rieke", "data" : [ [ @@ -251,153 +277,142 @@ "Raku", 2 ] - ], - "id" : "Ulrich Rieke" + ] }, { "name" : "Vinod Kumar K", - "id" : "Vinod Kumar K", "data" : [ [ "Perl", 1 ] - ] + ], + "id" : "Vinod Kumar K" } ] }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - } - } - }, - "subtitle" : { - "text" : "[Champions: 21] Last updated at 2020-10-15 20:52:15 GMT" - }, - "title" : { - "text" : "Perl Weekly Challenge - 082" - }, "series" : [ { - "colorByPoint" : 1, + "name" : "Perl Weekly Challenge - 082", "data" : [ { - "y" : 4, "drilldown" : "Abigail", - "name" : "Abigail" + "name" : "Abigail", + "y" : 4 }, { - "drilldown" : "Alexander Pankoff", + "name" : "Alexander Pankoff", "y" : 2, - "name" : "Alexander Pankoff" + "drilldown" : "Alexander Pankoff" }, { - "name" : "Andinus", "drilldown" : "Andinus", - "y" : 2 + "y" : 2, + "name" : "Andinus" }, { - "name" : "Andrew Shitov", + "drilldown" : "Andrew Shitov", "y" : 2, - "drilldown" : "Andrew Shitov" + "name" : "Andrew Shitov" }, { - "name" : "Dave Jacoby", "drilldown" : "Dave Jacoby", - "y" : 3 + "y" : 3, + "name" : "Dave Jacoby" }, { "name" : "E. Choroba", - "drilldown" : "E. Choroba", - "y" : 2 + "y" : 2, + "drilldown" : "E. Choroba" }, { + "y" : 2, "name" : "Feng Chang", - "drilldown" : "Feng Chang", - "y" : 2 + "drilldown" : "Feng Chang" }, { + "y" : 4, "name" : "Flavio Poletti", - "drilldown" : "Flavio Poletti", - "y" : 4 + "drilldown" : "Flavio Poletti" + }, + { + "drilldown" : "Jose Luis", + "name" : "Jose Luis", + "y" : 2 }, { "name" : "Julio de Castro", - "drilldown" : "Julio de Castro", - "y" : 4 + "y" : 4, + "drilldown" : "Julio de Castro" }, { - "name" : "Kang-min Liu", "drilldown" : "Kang-min Liu", + "name" : "Kang-min Liu", "y" : 4 }, { - "y" : 1, "drilldown" : "Lubos Kolouch", + "y" : 1, "name" : "Lubos Kolouch" }, { "y" : 2, - "drilldown" : "Mark Anderson", - "name" : "Mark Anderson" + "name" : "Mark Anderson", + "drilldown" : "Mark Anderson" }, { - "name" : "Markus Holzer", "drilldown" : "Markus Holzer", - "y" : 2 + "y" : 2, + "name" : "Markus Holzer" }, { "drilldown" : "Myoungjin Jeon", - "y" : 2, - "name" : "Myoungjin Jeon" + "name" : "Myoungjin Jeon", + "y" : 2 }, { "name" : "Niels van Dijke", - "drilldown" : "Niels van Dijke", - "y" : 2 + "y" : 2, + "drilldown" : "Niels van Dijke" }, { + "name" : "Roger Bell_West", "y" : 5, - "drilldown" : "Roger Bell_West", - "name" : "Roger Bell_West" + "drilldown" : "Roger Bell_West" }, { - "name" : "Simon Green", + "drilldown" : "Simon Green", "y" : 3, - "drilldown" : "Simon Green" + "name" : "Simon Green" }, { - "y" : 2, "drilldown" : "Simon Proctor", - "name" : "Simon Proctor" + "name" : "Simon Proctor", + "y" : 2 }, { - "name" : "Steven Wilson", "y" : 1, + "name" : "Steven Wilson", "drilldown" : "Steven Wilson" }, { - "name" : "Ulrich Rieke", "y" : 4, + "name" : "Ulrich Rieke", "drilldown" : "Ulrich Rieke" }, { + "drilldown" : "Vinod Kumar K", "name" : "Vinod Kumar K", - "y" : 1, - "drilldown" : "Vinod Kumar K" + "y" : 1 } ], - "name" : "Perl Weekly Challenge - 082" + "colorByPoint" : 1 } ], - "legend" : { - "enabled" : 0 - }, "chart" : { "type" : "column" + }, + "subtitle" : { + "text" : "[Champions: 22] Last updated at 2020-10-17 09:18:25 GMT" } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index d2a9977a26..27b1c5f7b9 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,20 +1,20 @@ { - "chart" : { - "type" : "column" + "subtitle" : { + "text" : "Last updated at 2020-10-17 09:18:25 GMT" }, "series" : [ { "dataLabels" : { - "format" : "{point.y:.0f}", "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" }, - "enabled" : "true", - "align" : "right", "rotation" : -90, + "align" : "right", + "y" : 10, "color" : "#FFFFFF", - "y" : 10 + "enabled" : "true", + "format" : "{point.y:.0f}" }, "data" : [ [ @@ -23,7 +23,7 @@ ], [ "Perl", - 3547 + 3549 ], [ "Raku", @@ -33,14 +33,14 @@ "name" : "Contributions" } ], - "legend" : { - "enabled" : "false" + "tooltip" : { + "pointFormat" : "{point.y:.0f}" }, - "title" : { - "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" + "chart" : { + "type" : "column" }, - "subtitle" : { - "text" : "Last updated at 2020-10-15 20:52:15 GMT" + "legend" : { + "enabled" : "false" }, "yAxis" : { "title" : { @@ -49,15 +49,15 @@ "min" : 0 }, "xAxis" : { - "type" : "category", "labels" : { "style" : { "fontFamily" : "Verdana, sans-serif", "fontSize" : "13px" } - } + }, + "type" : "category" }, - "tooltip" : { - "pointFormat" : "{point.y:.0f}" + "title" : { + "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index c14fb2ea9d..3efcb43004 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,446 +1,8 @@ { - "title" : { - "text" : "Perl Weekly Challenge Language" - }, - "series" : [ - { - "colorByPoint" : "true", - "name" : "Perl Weekly Challenge Languages", - "data" : [ - { - "drilldown" : "001", - "y" : 144, - "name" : "#001" - }, - { - "name" : "#002", - "y" : 113, - "drilldown" : "002" - }, - { - "y" : 71, - "drilldown" : "003", - "name" : "#003" - }, - { - "name" : "#004", - "y" : 91, - "drilldown" : "004" - }, - { - "name" : "#005", - "drilldown" : "005", - "y" : 72 - }, - { - "drilldown" : "006", - "y" : 52, - "name" : "#006" - }, - { - "name" : "#007", - "drilldown" : "007", - "y" : 59 - }, - { - "drilldown" : "008", - "y" : 72, - "name" : "#008" - }, - { - "name" : "#009", - "drilldown" : "009", - "y" : 70 - }, - { - "y" : 60, - "drilldown" : "010", - "name" : "#010" - }, - { - "name" : "#011", - "drilldown" : "011", - "y" : 79 - }, - { - "name" : "#012", - "y" : 83, - "drilldown" : "012" - }, - { - "name" : "#013", - "drilldown" : "013", - "y" : 78 - }, - { - "name" : "#014", - "y" : 96, - "drilldown" : "014" - }, - { - "drilldown" : "015", - "y" : 93, - "name" : "#015" - }, - { - "y" : 66, - "drilldown" : "016", - "name" : "#016" - }, - { - "name" : "#017", - "y" : 79, - "drilldown" : "017" - }, - { - "drilldown" : "018", - "y" : 76, - "name" : "#018" - }, - { - "y" : 97, - "drilldown" : "019", - "name" : "#019" - }, - { - "y" : 95, - "drilldown" : "020", - "name" : "#020" - }, - { - "name" : "#021", - "y" : 67, - "drilldown" : "021" - }, - { - "name" : "#022", - "drilldown" : "022", - "y" : 63 - }, - { - "drilldown" : "023", - "y" : 91, - "name" : "#023" - }, - { - "drilldown" : "024", - "y" : 70, - "name" : "#024" - }, - { - "drilldown" : "025", - "y" : 55, - "name" : "#025" - }, - { - "y" : 70, - "drilldown" : "026", - "name" : "#026" - }, - { - "drilldown" : "027", - "y" : 58, - "name" : "#027" - }, - { - "name" : "#028", - "drilldown" : "028", - "y" : 78 - }, - { - "drilldown" : "029", - "y" : 77, - "name" : "#029" - }, - { - "name" : "#030", - "drilldown" : "030", - "y" : 115 - }, - { - "name" : "#031", - "y" : 87, - "drilldown" : "031" - }, - { - "name" : "#032", - "drilldown" : "032", - "y" : 92 - }, - { - "drilldown" : "033", - "y" : 108, - "name" : "#033" - }, - { - "y" : 62, - "drilldown" : "034", - "name" : "#034" - }, - { - "y" : 62, - "drilldown" : "035", - "name" : "#035" - }, - { - "name" : "#036", - "y" : 66, - "drilldown" : "036" - }, - { - "drilldown" : "037", - "y" : 65, - "name" : "#037" - }, - { - "name" : "#038", - "drilldown" : "038", - "y" : 65 - }, - { - "name" : "#039", - "drilldown" : "039", - "y" : 60 - }, - { - "name" : "#040", - "drilldown" : "040", - "y" : 71 - }, - { - "y" : 74, - "drilldown" : "041", - "name" : "#041" - }, - { - "name" : "#042", - "drilldown" : "042", - "y" : 88 - }, - { - "drilldown" : "043", - "y" : 66, - "name" : "#043" - }, - { - "y" : 82, - "drilldown" : "044", - "name" : "#044" - }, - { - "y" : 94, - "drilldown" : "045", - "name" : "#045" - }, - { - "name" : "#046", - "drilldown" : "046", - "y" : 85 - }, - { - "drilldown" : "047", - "y" : 82, - "name" : "#047" - }, - { - "y" : 106, - "drilldown" : "048", - "name" : "#048" - }, - { - "y" : 85, - "drilldown" : "049", - "name" : "#049" - }, - { - "drilldown" : "050", - "y" : 96, - "name" : "#050" - }, - { - "drilldown" : "051", - "y" : 87, - "name" : "#051" - }, - { - "name" : "#052", - "drilldown" : "052", - "y" : 89 - }, - { - "y" : 99, - "drilldown" : "053", - "name" : "#053" - }, - { - "name" : "#054", - "drilldown" : "054", - "y" : 101 - }, - { - "drilldown" : "055", - "y" : 86, - "name" : "#055" - }, - { - "name" : "#056", - "drilldown" : "056", - "y" : 93 - }, - { - "name" : "#057", - "drilldown" : "057", - "y" : 78 - }, - { - "y" : 67, - "drilldown" : "058", - "name" : "#058" - }, - { - "name" : "#059", - "drilldown" : "059", - "y" : 87 - }, - { - "drilldown" : "060", - "y" : 83, - "name" : "#060" - }, - { - "drilldown" : "061", - "y" : 79, - "name" : "#061" - }, - { - "drilldown" : "062", - "y" : 54, - "name" : "#062" - }, - { - "name" : "#063", - "y" : 87, - "drilldown" : "063" - }, - { - "name" : "#064", - "y" : 78, - "drilldown" : "064" - }, - { - "name" : "#065", - "drilldown" : "065", - "y" : 71 - }, - { - "name" : "#066", - "y" : 82, - "drilldown" : "066" - }, - { - "name" : "#067", - "y" : 88, - "drilldown" : "067" - }, - { - "y" : 73, - "drilldown" : "068", - "name" : "#068" - }, - { - "drilldown" : "069", - "y" : 81, - "name" : "#069" - }, - { - "name" : "#070", - "drilldown" : "070", - "y" : 91 - }, - { - "name" : "#071", - "drilldown" : "071", - "y" : 76 - }, - { - "name" : "#072", - "drilldown" : "072", - "y" : 110 - }, - { - "drilldown" : "073", - "y" : 108, - "name" : "#073" - }, - { - "name" : "#074", - "y" : 113, - "drilldown" : "074" - }, - { - "name" : "#075", - "drilldown" : "075", - "y" : 111 - }, - { - "name" : "#076", - "y" : 93, - "drilldown" : "076" - }, - { - "drilldown" : "077", - "y" : 94, - "name" : "#077" - }, - { - "name" : "#078", - "y" : 123, - "drilldown" : "078" - }, - { - "name" : "#079", - "drilldown" : "079", - "y" : 118 - }, - { - "y" : 123, - "drilldown" : "080", - "name" : "#080" - }, - { - "y" : 108, - "drilldown" : "081", - "name" : "#081" - }, - { - "name" : "#082", - "drilldown" : "082", - "y" : 54 - } - ] - } - ], - "legend" : { - "enabled" : "false" - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2020-10-15 20:52:15 GMT" - }, - "chart" : { - "type" : "column" - }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } - }, "drilldown" : { "series" : [ { + "name" : "001", "data" : [ [ "Perl", @@ -455,11 +17,9 @@ 11 ] ], - "id" : "001", - "name" : "001" + "id" : "001" }, { - "name" : "002", "data" : [ [ "Perl", @@ -474,11 +34,11 @@ 10 ] ], + "name" : "002", "id" : "002" }, { "name" : "003", - "id" : "003", "data" : [ [ "Perl", @@ -492,9 +52,12 @@ "Blog", 9 ] - ] + ], + "id" : "003" }, { + "id" : "004", + "name" : "004", "data" : [ [ "Perl", @@ -508,12 +71,9 @@ "Blog", 10 ] - ], - "id" : "004", - "name" : "004" + ] }, { - "id" : "005", "data" : [ [ "Perl", @@ -528,9 +88,12 @@ 12 ] ], - "name" : "005" + "name" : "005", + "id" : "005" }, { + "id" : "006", + "name" : "006", "data" : [ [ "Perl", @@ -544,13 +107,10 @@ "Blog", 7 ] - ], - "id" : "006", - "name" : "006" + ] }, { "name" : "007", - "id" : "007", "data" : [ [ "Perl", @@ -564,9 +124,12 @@ "Blog", 10 ] - ] + ], + "id" : "007" }, { + "id" : "008", + "name" : "008", "data" : [ [ "Perl", @@ -580,9 +143,7 @@ "Blog", 12 ] - ], - "id" : "008", - "name" : "008" + ] }, { "id" : "009", @@ -603,7 +164,6 @@ "name" : "009" }, { - "name" : "010", "id" : "010", "data" : [ [ @@ -618,11 +178,12 @@ "Blog", 11 ] - ] + ], + "name" : "010" }, { - "name" : "011", "id" : "011", + "name" : "011", "data" : [ [ "Perl", @@ -639,6 +200,7 @@ ] }, { + "id" : "012", "name" : "012", "data" : [ [ @@ -653,8 +215,7 @@ "Blog", 11 ] - ], - "id" : "012" + ] }, { "id" : "013", @@ -675,8 +236,8 @@ "name" : "013" }, { - "name" : "014", "id" : "014", + "name" : "014", "data" : [ [ "Perl", @@ -693,7 +254,7 @@ ] }, { - "id" : "015", + "name" : "015", "data" : [ [ "Perl", @@ -708,11 +269,10 @@ 15 ] ], - "name" : "015" + "id" : "015" }, { "name" : "016", - "id" : "016", "data" : [ [ "Perl", @@ -726,7 +286,8 @@ "Blog", 12 ] - ] + ], + "id" : "016" }, { "id" : "017", @@ -747,6 +308,7 @@ "name" : "017" }, { + "name" : "018", "data" : [ [ "Perl", @@ -761,11 +323,9 @@ 14 ] ], - "id" : "018", - "name" : "018" + "id" : "018" }, { - "name" : "019", "data" : [ [ "Perl", @@ -780,10 +340,11 @@ 13 ] ], + "name" : "019", "id" : "019" }, { - "id" : "020", + "name" : "020", "data" : [ [ "Perl", @@ -798,7 +359,7 @@ 13 ] ], - "name" : "020" + "id" : "020" }, { "data" : [ @@ -815,12 +376,10 @@ 10 ] ], - "id" : "021", - "name" : "021" + "name" : "021", + "id" : "021" }, { - "name" : "022", - "id" : "022", "data" : [ [ "Perl", @@ -834,9 +393,12 @@ "Blog", 10 ] - ] + ], + "name" : "022", + "id" : "022" }, { + "id" : "023", "name" : "023", "data" : [ [ @@ -851,8 +413,7 @@ "Blog", 12 ] - ], - "id" : "023" + ] }, { "id" : "024", @@ -873,6 +434,7 @@ "name" : "024" }, { + "name" : "025", "data" : [ [ "Perl", @@ -887,10 +449,11 @@ 12 ] ], - "id" : "025", - "name" : "025" + "id" : "025" }, { + "id" : "026", + "name" : "026", "data" : [ [ "Perl", @@ -904,9 +467,7 @@ "Blog", 10 ] - ], - "id" : "026", - "name" : "026" + ] }, { "data" : [ @@ -923,8 +484,8 @@ 9 ] ], - "id" : "027", - "name" : "027" + "name" : "027", + "id" : "027" }, { "data" : [ @@ -941,10 +502,11 @@ 9 ] ], - "id" : "028", - "name" : "028" + "name" : "028", + "id" : "028" }, { + "name" : "029", "data" : [ [ "Perl", @@ -959,11 +521,10 @@ 12 ] ], - "id" : "029", - "name" : "029" + "id" : "029" }, { - "name" : "030", + "id" : "030", "data" : [ [ "Perl", @@ -978,9 +539,10 @@ 10 ] ], - "id" : "030" + "name" : "030" }, { + "id" : "031", "data" : [ [ "Perl", @@ -995,10 +557,11 @@ 9 ] ], - "id" : "031", "name" : "031" }, { + "id" : "032", + "name" : "032", "data" : [ [ "Perl", @@ -1012,9 +575,7 @@ "Blog", 10 ] - ], - "id" : "032", - "name" : "032" + ] }, { "name" : "033", @@ -1035,7 +596,6 @@ "id" : "033" }, { - "id" : "034", "data" : [ [ "Perl", @@ -1050,11 +610,11 @@ 11 ] ], - "name" : "034" + "name" : "034", + "id" : "034" }, { "name" : "035", - "id" : "035", "data" : [ [ "Perl", @@ -1068,11 +628,12 @@ "Blog", 9 ] - ] + ], + "id" : "035" }, { - "name" : "036", "id" : "036", + "name" : "036", "data" : [ [ "Perl", @@ -1103,11 +664,12 @@ 9 ] ], - "id" : "037", - "name" : "037" + "name" : "037", + "id" : "037" }, { "id" : "038", + "name" : "038", "data" : [ [ "Perl", @@ -1121,10 +683,10 @@ "Blog", 12 ] - ], - "name" : "038" + ] }, { + "id" : "039", "name" : "039", "data" : [ [ @@ -1139,10 +701,11 @@ "Blog", 12 ] - ], - "id" : "039" + ] }, { + "id" : "040", + "name" : "040", "data" : [ [ "Perl", @@ -1156,12 +719,9 @@ "Blog", 10 ] - ], - "id" : "040", - "name" : "040" + ] }, { - "id" : "041", "data" : [ [ "Perl", @@ -1176,7 +736,8 @@ 9 ] ], - "name" : "041" + "name" : "041", + "id" : "041" }, { "id" : "042", @@ -1215,7 +776,7 @@ "id" : "043" }, { - "id" : "044", + "name" : "044", "data" : [ [ "Perl", @@ -1230,7 +791,7 @@ 11 ] ], - "name" : "044" + "id" : "044" }, { "data" : [ @@ -1247,10 +808,12 @@ 11 ] ], - "id" : "045", - "name" : "045" + "name" : "045", + "id" : "045" }, { + "id" : "046", + "name" : "046", "data" : [ [ "Perl", @@ -1264,13 +827,11 @@ "Blog", 10 ] - ], - "id" : "046", - "name" : "046" + ] }, { - "name" : "047", "id" : "047", + "name" : "047", "data" : [ [ "Perl", @@ -1287,6 +848,7 @@ ] }, { + "id" : "048", "name" : "048", "data" : [ [ @