From 0e149357fcf2b47b6a98987e703691b3db57c3e9 Mon Sep 17 00:00:00 2001 From: Luis Mochan Date: Sun, 3 Dec 2023 23:05:00 -0600 Subject: Solve PWC246 --- challenge-246/wlmb/blog.txt | 1 + challenge-246/wlmb/perl/ch-1.pl | 9 +++++++++ challenge-246/wlmb/perl/ch-2.pl | 23 +++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 challenge-246/wlmb/blog.txt create mode 100755 challenge-246/wlmb/perl/ch-1.pl create mode 100755 challenge-246/wlmb/perl/ch-2.pl diff --git a/challenge-246/wlmb/blog.txt b/challenge-246/wlmb/blog.txt new file mode 100644 index 0000000000..76a7ba2f74 --- /dev/null +++ b/challenge-246/wlmb/blog.txt @@ -0,0 +1 @@ +https://wlmb.github.io/2023/12/03/PWC246/ diff --git a/challenge-246/wlmb/perl/ch-1.pl b/challenge-246/wlmb/perl/ch-1.pl new file mode 100755 index 0000000000..dc73524925 --- /dev/null +++ b/challenge-246/wlmb/perl/ch-1.pl @@ -0,0 +1,9 @@ +#!/usr/bin/env perl +# Perl weekly challenge 246 +# Task 1: 6 out of 49 +# +# See https://wlmb.github.io/2023/12/03/PWC246/#task-1-6-out-of-49 +use v5.36; +my %n=map{$_=>1} 1..49; +my @n=keys %n; +say join " ", @n[0..5]; diff --git a/challenge-246/wlmb/perl/ch-2.pl b/challenge-246/wlmb/perl/ch-2.pl new file mode 100755 index 0000000000..025a9d98b3 --- /dev/null +++ b/challenge-246/wlmb/perl/ch-2.pl @@ -0,0 +1,23 @@ +#!/usr/bin/env perl +# Perl weekly challenge 246 +# Task 2: Linear Recurrence of Second Order +# +# See https://wlmb.github.io/2023/12/03/PWC246/#task-2-linear-recurrence-of-second-order +use v5.36; +use List::Util qw(all); +die <<~"FIN" unless @ARGV>=4; + Usage: $0 N0 N1 N2 N3 [N4...] + to check if the sequence of integers Ni obeys a linear second order recurrence with + integer coefficients + FIN +die "Arguments must be integer" unless all {/^[+-]?\d+$/} @ARGV; +my @x =@ARGV; +my $num_p = $x[2]**2-$x[3]*$x[1]; +my $num_q = $x[0]*$x[3]-$x[1]*$x[2]; +my $den = $x[0]*$x[2]-$x[1]**2; +my $result = $num_p%$den==0 && $num_q%$den==0; # coefficients are integer +my $p=$num_p/$den; +my $q=$num_q/$den; +$result &&= $x[$_]==$p*$x[$_-2]+$q*$x[$_-1] for (4..@x-1); +$result = $result?"True":"False"; +say "@x => $result" -- cgit From 1a2bb6c4ac4690b77ae34ef2bb29818268b3164b Mon Sep 17 00:00:00 2001 From: David Ferrone Date: Mon, 4 Dec 2023 00:48:13 -0500 Subject: Week 246 --- challenge-246/zapwai/perl/ch-1.pl | 9 ++++++ challenge-246/zapwai/perl/ch-2.pl | 67 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 challenge-246/zapwai/perl/ch-1.pl create mode 100644 challenge-246/zapwai/perl/ch-2.pl diff --git a/challenge-246/zapwai/perl/ch-1.pl b/challenge-246/zapwai/perl/ch-1.pl new file mode 100644 index 0000000000..64d322645d --- /dev/null +++ b/challenge-246/zapwai/perl/ch-1.pl @@ -0,0 +1,9 @@ +use v5.30; +my @nums; +do { + my $x = 1 + int rand 49; + unless ( grep(/$x/, @nums) ) { + push @nums, $x; + } +} while (@nums != 6); +say join(", ", sort {$a <=> $b} @nums); diff --git a/challenge-246/zapwai/perl/ch-2.pl b/challenge-246/zapwai/perl/ch-2.pl new file mode 100644 index 0000000000..3d08d5008e --- /dev/null +++ b/challenge-246/zapwai/perl/ch-2.pl @@ -0,0 +1,67 @@ +use v5.30; +my @a = (1,1,2,3,5); +#@a = (4,2,4,5,7); +#@a = (4,1,2,-3,8); +#@a = (-4, 2, -2, 0, -2); +my $p = myp(@a); +my $q = myq($p,@a); +say "Input: \@a = @a"; +print "Output: "; +if ( ($p !~ /^-?\d+$/) || ($q !~ /^-?\d+$/) ) { + say "False"; +} elsif (check($p, $q, @a)) { + say "True \t(p = $p, q = $q)"; +} + +sub myp { + my @a = @_; + my $p = ($a[3]*$a[3] - $a[2]*$a[4]) / ($a[3]*$a[1] - $a[2]*$a[2]); + return $p; +} +sub myq { + my ($p,@a) = @_; + my $q; + if ($a[3] != 0) { + $q = ($a[4] - $p*$a[2]) / $a[3]; + } else { + $q = ($a[2] - $p*$a[0]) / $a[1]; + } + return $q; +} +sub check { + # check the first eqn, unused in the above formulas. + # pa0 + qa1 = a2 + my ($p, $q, @a) = @_; + if ($a[3] != 0) { + return 1 if ($p * $a[0] + $q * $a[1] == $a[2]); + } else { + return 1 if ($p * $a[2] + $q * $a[3] == $a[4]); + } + 0 +} + +# (a3a1 - a2^2) * p = a3^2 - a2a4 ; +# q = (a4 - p*a2) / a3 ; +# q = (a3 - pa1) / a2 ; +# a2 and a3 cannot both be zero. + +### a[n] = p * a[n-2] + q * a[n-1] with n > 1 (p,q ints) + +# pa0 + qa1 = a2 +# pa1 + qa2 = a3 +# pa2 + qa3 = a4 + +# (in general) +# p(pa0 + qa1) + q(pa1 + qpa0 + qqa1) = a4 +# ppa0 + pqa1 + qpa1 + qqpa0 + qqqa1 = a4 +# a0(p^2 + q^2p) + a1(2pq + q^3) = a4 + +# Using third eqn specifically: +# q = (a4 - p*a2) / a3 ; +# (We can use first eqn instead, if a3 = 0.) +# p = (a3 - q*a2) / a1 ; +# = (a3 - (a4 - p*a2)*a2/a3) / a1 ; +# = (a3 - a2a4/a3 + p*a2^2/a3) / a1 ; +# = a3/a1 - a2a4/a3a1 + p*a2^2/a3a1 ; + +# (a3a1 - a2^2) * p = a3^2 - a2a4 ; -- cgit From 6049e266c441dbc2de27cffc7d96fb0758e24580 Mon Sep 17 00:00:00 2001 From: Jan Krňávek Date: Mon, 4 Dec 2023 07:38:01 +0100 Subject: solutions week 245-1 --- challenge-245/wambash/raku/ch-1.raku | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 challenge-245/wambash/raku/ch-1.raku diff --git a/challenge-245/wambash/raku/ch-1.raku b/challenge-245/wambash/raku/ch-1.raku new file mode 100644 index 0000000000..01f30341c8 --- /dev/null +++ b/challenge-245/wambash/raku/ch-1.raku @@ -0,0 +1,19 @@ +#!/usr/bin/env raku + +sub sort-language (:@lang,:@popularity) { + @popularity Z=> @lang + andthen .sort + andthen .map: *.value +} + +multi MAIN (Bool :test($)!) { + use Test; + is sort-language(:lang,:popularity(2,1,3)), ; + is sort-language(:lang,:popularity(1,3,2)), ; + is sort-language(:lang,:popularity(2,3,1)), ; + done-testing; +} + +multi MAIN (:@lang,:@popularity) { + put sort-language :@lang,:@popularity +} -- cgit From 82cc2a66e5d066cdded6a7f4dbed7fccd23c2c11 Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 4 Dec 2023 09:25:28 +0100 Subject: PWC 246 Task 1 Raku done Task 2 Raku done Task 1 PL/Perl done Task 2 PL/Perl done Task 1 PL/PgSQL done Task 2 PL/PgSQL done Task 1 Python done Task 2 Pythomn done --- challenge-246/luca-ferrari/blog-1.txt | 1 + challenge-246/luca-ferrari/blog-2.txt | 1 + challenge-246/luca-ferrari/blog-3.txt | 1 + challenge-246/luca-ferrari/blog-4.txt | 1 + challenge-246/luca-ferrari/blog-5.txt | 1 + challenge-246/luca-ferrari/blog-6.txt | 1 + challenge-246/luca-ferrari/blog-7.txt | 1 + challenge-246/luca-ferrari/blog-8.txt | 1 + challenge-246/luca-ferrari/postgresql/ch-1.plperl | 25 ++++++++++++ challenge-246/luca-ferrari/postgresql/ch-1.sql | 42 +++++++++++++++++++ challenge-246/luca-ferrari/postgresql/ch-2.plperl | 39 ++++++++++++++++++ challenge-246/luca-ferrari/postgresql/ch-2.sql | 49 +++++++++++++++++++++++ challenge-246/luca-ferrari/python/ch-1.py | 28 +++++++++++++ challenge-246/luca-ferrari/python/ch-2.py | 43 ++++++++++++++++++++ challenge-246/luca-ferrari/raku/ch-1.p6 | 18 +++++++++ challenge-246/luca-ferrari/raku/ch-2.p6 | 35 ++++++++++++++++ 16 files changed, 287 insertions(+) create mode 100644 challenge-246/luca-ferrari/blog-1.txt create mode 100644 challenge-246/luca-ferrari/blog-2.txt create mode 100644 challenge-246/luca-ferrari/blog-3.txt create mode 100644 challenge-246/luca-ferrari/blog-4.txt create mode 100644 challenge-246/luca-ferrari/blog-5.txt create mode 100644 challenge-246/luca-ferrari/blog-6.txt create mode 100644 challenge-246/luca-ferrari/blog-7.txt create mode 100644 challenge-246/luca-ferrari/blog-8.txt create mode 100644 challenge-246/luca-ferrari/postgresql/ch-1.plperl create mode 100644 challenge-246/luca-ferrari/postgresql/ch-1.sql create mode 100644 challenge-246/luca-ferrari/postgresql/ch-2.plperl create mode 100644 challenge-246/luca-ferrari/postgresql/ch-2.sql create mode 100644 challenge-246/luca-ferrari/python/ch-1.py create mode 100644 challenge-246/luca-ferrari/python/ch-2.py create mode 100644 challenge-246/luca-ferrari/raku/ch-1.p6 create mode 100644 challenge-246/luca-ferrari/raku/ch-2.p6 diff --git a/challenge-246/luca-ferrari/blog-1.txt b/challenge-246/luca-ferrari/blog-1.txt new file mode 100644 index 0000000000..3a5f348032 --- /dev/null +++ b/challenge-246/luca-ferrari/blog-1.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2023/12/04/PerlWeeklyChallenge246.html#task1 diff --git a/challenge-246/luca-ferrari/blog-2.txt b/challenge-246/luca-ferrari/blog-2.txt new file mode 100644 index 0000000000..340eea71f4 --- /dev/null +++ b/challenge-246/luca-ferrari/blog-2.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2023/12/04/PerlWeeklyChallenge246.html#task2 diff --git a/challenge-246/luca-ferrari/blog-3.txt b/challenge-246/luca-ferrari/blog-3.txt new file mode 100644 index 0000000000..4910540ed3 --- /dev/null +++ b/challenge-246/luca-ferrari/blog-3.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2023/12/04/PerlWeeklyChallenge246.html#task1plperl diff --git a/challenge-246/luca-ferrari/blog-4.txt b/challenge-246/luca-ferrari/blog-4.txt new file mode 100644 index 0000000000..36ff6aaa4b --- /dev/null +++ b/challenge-246/luca-ferrari/blog-4.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2023/12/04/PerlWeeklyChallenge246.html#task2plperl diff --git a/challenge-246/luca-ferrari/blog-5.txt b/challenge-246/luca-ferrari/blog-5.txt new file mode 100644 index 0000000000..8240159cf8 --- /dev/null +++ b/challenge-246/luca-ferrari/blog-5.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2023/12/04/PerlWeeklyChallenge246.html#task1plpgsql diff --git a/challenge-246/luca-ferrari/blog-6.txt b/challenge-246/luca-ferrari/blog-6.txt new file mode 100644 index 0000000000..6fe895e7cd --- /dev/null +++ b/challenge-246/luca-ferrari/blog-6.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2023/12/04/PerlWeeklyChallenge246.html#task2plpgsql diff --git a/challenge-246/luca-ferrari/blog-7.txt b/challenge-246/luca-ferrari/blog-7.txt new file mode 100644 index 0000000000..42768777f8 --- /dev/null +++ b/challenge-246/luca-ferrari/blog-7.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2023/12/04/PerlWeeklyChallenge246.html#task1python diff --git a/challenge-246/luca-ferrari/blog-8.txt b/challenge-246/luca-ferrari/blog-8.txt new file mode 100644 index 0000000000..a4be490f17 --- /dev/null +++ b/challenge-246/luca-ferrari/blog-8.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2023/12/04/PerlWeeklyChallenge246.html#task2python diff --git a/challenge-246/luca-ferrari/postgresql/ch-1.plperl b/challenge-246/luca-ferrari/postgresql/ch-1.plperl new file mode 100644 index 0000000000..4b63049238 --- /dev/null +++ b/challenge-246/luca-ferrari/postgresql/ch-1.plperl @@ -0,0 +1,25 @@ +-- +-- Perl Weekly Challenge 246 +-- Task 1 +-- See +-- + +CREATE SCHEMA IF NOT EXISTS pwc246; + +CREATE OR REPLACE FUNCTION +pwc246.task1_plperl() +RETURNS SETOF int +AS $CODE$ + my @lottery; + + while ( @lottery < 6 ) { + my $value = int ( rand( 49 ) ); + if ( ! grep( { $_ == $value } @lottery ) ) { + push @lottery, $value; + return_next( $value ); + } + } + + return undef; +$CODE$ +LANGUAGE plperl; diff --git a/challenge-246/luca-ferrari/postgresql/ch-1.sql b/challenge-246/luca-ferrari/postgresql/ch-1.sql new file mode 100644 index 0000000000..18b201248f --- /dev/null +++ b/challenge-246/luca-ferrari/postgresql/ch-1.sql @@ -0,0 +1,42 @@ +-- +-- Perl Weekly Challenge 246 +-- Task 1 +-- +-- See +-- + +CREATE SCHEMA IF NOT EXISTS pwc246; + +CREATE OR REPLACE FUNCTION +pwc246.task1_plpgsql() +RETURNS SETOF INT +AS $CODE$ +DECLARE + counting int; + current_value int; +BEGIN + CREATE TEMPORARY TABLE IF NOT EXISTS lottery( v int, CHECK( v <= 49 ), PRIMARY KEY( v ) ); + TRUNCATE lottery; + + counting := 0; + WHILE counting < 6 LOOP + current_value := ( random() * 100 )::int; + + IF current_value <= 49 THEN + INSERT INTO lottery( v ) + VALUES( current_value ) + ON CONFLICT ( v ) DO NOTHING; + END IF; + + + SELECT count(*) + INTO counting + FROM lottery; + + END LOOP; + + RETURN QUERY + SELECT * FROM lottery; +END +$CODE$ +LANGUAGE plpgsql; diff --git a/challenge-246/luca-ferrari/postgresql/ch-2.plperl b/challenge-246/luca-ferrari/postgresql/ch-2.plperl new file mode 100644 index 0000000000..620df1d4e9 --- /dev/null +++ b/challenge-246/luca-ferrari/postgresql/ch-2.plperl @@ -0,0 +1,39 @@ +-- +-- Perl Weekly Challenge 246 +-- Task 2 +-- See +-- + +CREATE SCHEMA IF NOT EXISTS pwc246; + +CREATE OR REPLACE FUNCTION +pwc246.task2_plperl( int[] ) +RETURNS bool +AS $CODE$ + my ( $nums ) = @_; + + die "Need 5 numbers" if ( $nums->@* != 5 ); + my $ok = 0; + my $ko = $nums->@* - 2; + + for ( 2 .. $nums->@* - 1 ) { + for ( my $p = 1; ; $p++ ) { + for ( my $q = 1; ; $q++ ) { + if ( $nums->@[ $_ ] == ( $p * $nums->[ $_ - 2 ] + $q * $nums->[ $_ - 1 ] ) + || $nums->@[ $_ ] == ( $p * -1 * $nums->[ $_ - 2 ] + $q * $nums->[ $_ - 1 ] ) + || $nums->@[ $_ ] == ( $p * -1 * $nums->[ $_ - 2 ] + $q * -1 * $nums->[ $_ - 1 ] ) + || $nums->@[ $_ ] == ( $p * $nums->[ $_ - 2 ] + $q * -1 * $nums->[ $_ - 1 ] ) ) { + + $ok = 1; + $ko--; + last; + } + } + + last if $ok; + } + } + + return ( $ko == 0 ); +$CODE$ +LANGUAGE plperl; diff --git a/challenge-246/luca-ferrari/postgresql/ch-2.sql b/challenge-246/luca-ferrari/postgresql/ch-2.sql new file mode 100644 index 0000000000..245db32687 --- /dev/null +++ b/challenge-246/luca-ferrari/postgresql/ch-2.sql @@ -0,0 +1,49 @@ +-- +-- Perl Weekly Challenge 246 +-- Task 2 +-- +-- See +-- + +CREATE SCHEMA IF NOT EXISTS pwc246; + +CREATE OR REPLACE FUNCTION +pwc246.task2_plpgsql( nums int[] ) +RETURNS bool +AS $CODE$ +DECLARE + current_index int; + p int; + q int; + ok bool := false; + ko int; +BEGIN + + ko := array_length( nums, 1 ) - 3 + 1; + + FOR current_index IN 3 .. array_length( nums, 1 ) LOOP + ok := false; + + FOR p IN 1 .. 99999 LOOP + FOR q IN 1 .. 9999 LOOP + IF nums[ current_index ] = ( p * nums[ current_index - 2 ] + q * nums[ current_index - 1 ] ) + OR nums[ current_index ] = ( p * -1 * nums[ current_index - 2 ] + q * nums[ current_index - 1 ] ) + OR nums[ current_index ] = ( p * -1 * nums[ current_index - 2 ] + q * -1 *nums[ current_index - 1 ] ) + OR nums[ current_index ] = ( p * nums[ current_index - 2 ] + q * -1 * nums[ current_index - 1 ] ) THEN + ok := true; + ko := ko - 1; + EXIT; + END IF; + END LOOP; + + IF ok THEN + EXIT; + END IF; + + END LOOP; + END LOOP; + + RETURN ko = 0; +END +$CODE$ +LANGUAGE plpgsql; diff --git a/challenge-246/luca-ferrari/python/ch-1.py b/challenge-246/luca-ferrari/python/ch-1.py new file mode 100644 index 0000000000..98b32d6125 --- /dev/null +++ b/challenge-246/luca-ferrari/python/ch-1.py @@ -0,0 +1,28 @@ +#!python + +# +# Perl Weekly Challenge 246 +# Task 1 +# +# See +# + +import sys +import random + +# task implementation +def main( argv ): + values = [] + while len( values ) < 6: + current_value = random.randint( 1, 49 ) + if not current_value in values: + values.append( current_value ) + + print( "\n".join( map( str, values ) ) ) + + +# invoke the main without the command itself +if __name__ == '__main__': + main( sys.argv[ 1: ] ) + + diff --git a/challenge-246/luca-ferrari/python/ch-2.py b/challenge-246/luca-ferrari/python/ch-2.py new file mode 100644 index 0000000000..dbd0395ca7 --- /dev/null +++ b/challenge-246/luca-ferrari/python/ch-2.py @@ -0,0 +1,43 @@ +#!python + +# +# Perl Weekly Challenge 246 +# Task 2 +# +# See +# + +import sys +from itertools import count + +# task implementation +def main( argv ): + nums = list( map( int, argv ) ) + ko = len( nums ) - 2 + + for current_index in range( 2, len( nums ) ): + for p in count( start = 1 ): + for q in count( start = 1 ): + if nums[ current_index ] == ( p * nums[ current_index - 2 ] + q * nums[ current_index - 1 ] ) \ + or nums[ current_index ] == ( p * -1 * nums[ current_index - 2 ] + q * nums[ current_index - 1 ] ) \ + or nums[ current_index ] == ( p * -1 * nums[ current_index - 2 ] + q * -1 * nums[ current_index - 1 ] ) \ + or nums[ current_index ] == ( p * nums[ current_index - 2 ] + q * -1 * nums[ current_index - 1 ] ): + ok = True + ko = ko - 1 + break + + if ok: + break + + if ko == 0: + print( 'True' ) + else: + print( 'False' ) + + + +# invoke the main without the command itself +if __name__ == '__main__': + main( sys.argv[ 1: ] ) + + diff --git a/challenge-246/luca-ferrari/raku/ch-1.p6 b/challenge-246/luca-ferrari/raku/ch-1.p6 new file mode 100644 index 0000000000..59c15b6561 --- /dev/null +++ b/challenge-246/luca-ferrari/raku/ch-1.p6 @@ -0,0 +1,18 @@ +#!raku + +# +# Perl Weekly Challenge 246 +# Task 1 +# +# See +# + +sub MAIN() { + + my @lottery; + while ( @lottery.elems < 6 ) { + @lottery.push: $_ if ( ! @lottery.grep( $_ ) ) given ( 49.rand.Int ); + } + + @lottery.join( "\n" ).say; +} diff --git a/challenge-246/luca-ferrari/raku/ch-2.p6 b/challenge-246/luca-ferrari/raku/ch-2.p6 new file mode 100644 index 0000000000..86b550e9f6 --- /dev/null +++ b/challenge-246/luca-ferrari/raku/ch-2.p6 @@ -0,0 +1,35 @@ +#!raku + +# +# Perl Weekly Challenge 246 +# Task 2 +# +# See +# + +sub MAIN( *@nums where { @nums.elems == 5 && @nums.grep( * ~~ Int ).elems == @nums.elems } ) { + + for 2 ..^ @nums.elems { + # a[n] = p * a[n-2] + q * a[n-1] with n > 1 + + my $ok = False; + for 1 .. Inf -> $p { + for 1 .. Inf -> $q { + if ( @nums[ $_ ] == ( $p * @nums[ $_ - 2 ] + $q * @nums[ $_ - 1 ] ) + || @nums[ $_ ] == ( $p * -1 * @nums[ $_ - 2 ] + $q * @nums[ $_ - 1 ] ) + || @nums[ $_ ] == ( $p * -1 * @nums[ $_ - 2 ] + $q * -1 * @nums[ $_ - 1 ] ) + || @nums[ $_ ] == ( $p * @nums[ $_ - 2 ] + $q * -1 * @nums[ $_ - 1 ] ) ) { + $ok = True; + last; + } + } + + last if $ok; + } + + + 'False'.say and exit if ! $ok; + } + + 'True'.say; +} -- cgit From a5142150602b78793af374bf2e1e4c6f2644cca9 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 4 Dec 2023 11:10:17 +0000 Subject: - Added solutions by Jan Krnavek. - Added solutions by W. Luis Mochan. - Added solutions by David Ferrone. - Added solutions by Luca Ferrari. --- challenge-246/eric-cheung/python/ch-1.py | 17 + challenge-246/eric-cheung/python/ch-2.py | 71 ++ stats/pwc-challenge-245.json | 646 +++++++++++ stats/pwc-current.json | 610 +---------- stats/pwc-language-breakdown-summary.json | 70 +- stats/pwc-language-breakdown.json | 1653 +++++++++++++++-------------- stats/pwc-leaders.json | 726 ++++++------- stats/pwc-summary-1-30.json | 40 +- stats/pwc-summary-121-150.json | 28 +- stats/pwc-summary-151-180.json | 48 +- stats/pwc-summary-181-210.json | 100 +- stats/pwc-summary-211-240.json | 126 +-- stats/pwc-summary-241-270.json | 34 +- stats/pwc-summary-271-300.json | 34 +- stats/pwc-summary-301-330.json | 54 +- stats/pwc-summary-31-60.json | 52 +- stats/pwc-summary-61-90.json | 116 +- stats/pwc-summary-91-120.json | 102 +- stats/pwc-summary.json | 660 ++++++------ 19 files changed, 2707 insertions(+), 2480 deletions(-) create mode 100755 challenge-246/eric-cheung/python/ch-1.py create mode 100755 challenge-246/eric-cheung/python/ch-2.py create mode 100644 stats/pwc-challenge-245.json diff --git a/challenge-246/eric-cheung/python/ch-1.py b/challenge-246/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..5ad578ad8b --- /dev/null +++ b/challenge-246/eric-cheung/python/ch-1.py @@ -0,0 +1,17 @@ + +from random import randint + +nMaxNum = 49 +nNumChosen = 6 + +arrInput = list(range(1, nMaxNum + 1)) +arrOuput = [] + +for nLoop in range(nNumChosen): + nIndx = randint(0, nMaxNum - nLoop) + arrOuput.append(arrInput[nIndx]) + del arrInput[nIndx] + +arrOuput.sort() + +print (arrOuput) diff --git a/challenge-246/eric-cheung/python/ch-2.py b/challenge-246/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..efbbb54bbb --- /dev/null +++ b/challenge-246/eric-cheung/python/ch-2.py @@ -0,0 +1,71 @@ + +## Ref. +## https://math.libretexts.org/Courses/Mount_Royal_University/MATH_2150%3A_Higher_Arithmetic/5%3A_Diophantine_Equations/5.1%3A_Linear_Diophantine_Equations#:~:text=A%20Linear%20Diophantine%20equation%20(LDE,and%20y%20are%20unknown%20variables. +## https://stackoverflow.com/questions/59168914/finding-solutions-to-diophantine + +from math import gcd +import sys + + +def IsConsecutiveEven (arrNum): + for nIndx in range(0, len(arrNum) - 1): + if arrNum[nIndx] % 2 == 0 and arrNum[nIndx + 1] % 2 == 0: + return nIndx + return -1 + + +def DotProduct (arrNum_01, arrNum_02): + return sum(arrLoop[0] * arrLoop[1] for arrLoop in zip(arrNum_01, arrNum_02)) + + +def ModifiedGCD (arrNum, arrParam): + if arrNum[1] == 0: + return [arrNum[0], 1, 0] + + nX = 0 + nY = 0 + + nDiv, nX, nY = ModifiedGCD([arrNum[1], arrNum[0] % arrNum[1]], [nX, nY]) + return [nDiv, nY, nX - nY * (arrNum[0] // arrNum[1])] + +arrInput = [1, 1, 2, 3, 5] ## Example 1 +## arrInput = [4, 2, 4, 5, 7] ## Example 2 +## arrInput = [4, 1, 2, -3, 8] ## Example 3 + + +## print (ModifiedGCD(arrInput[0:2], [0, 0])) +## print (ModifiedGCD([47, 30], [0, 0])) + +nConsecutiveEvenIndx = IsConsecutiveEven (arrInput) +if nConsecutiveEvenIndx > -1: + arrContainOdd = [nIndx for nIndx in range(nConsecutiveEvenIndx + 2, len(arrInput)) if arrInput[nIndx] % 2 == 1] + if len(arrContainOdd) > 0: + print (False) + sys.exit() + +nGCD = gcd (arrInput[0], arrInput[1]) +if arrInput[2] % nGCD != 0: + print (False) + sys.exit() + +arrParam = [] + +## ==== To Be Further Fine Tune ==== +if arrInput[2] == arrInput[0] + arrInput[1]: + arrParam.append(1) + arrParam.append(1) +elif arrInput[2] == arrInput[0] - 2 * arrInput[1]: + arrParam.append(1) + arrParam.append(-2) +## ==== To Be Further Fine Tune ==== + +if len(arrParam) == 0: + print (False) + sys.exit() + +for nIndx in range(3, 5): + if arrInput[nIndx] != DotProduct(arrParam, arrInput[nIndx - 2 : nIndx]): + print (False) + sys.exit() + +print (True) diff --git a/stats/pwc-challenge-245.json b/stats/pwc-challenge-245.json new file mode 100644 index 0000000000..c9edc75c61 --- /dev/null +++ b/stats/pwc-challenge-245.json @@ -0,0 +1,646 @@ +{ + "title" : { + "text" : "The Weekly Challenge - 245" + }, + "xAxis" : { + "type" : "category" + }, + "legend" : { + "enabled" : 0 + }, + "drilldown" : { + "series" : [ + { + "id" : "Adam Russell", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 2 + ] + ], + "name" : "Adam Russell" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Ali Moradi", + "name" : "Ali Moradi" + }, + { + "name" : "Arne Sommer", + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Arne Sommer" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "id" : "Athanasius", + "name" : "Athanasius" + }, + { + "name" : "BarrOff", + "data" : [ + [ + "Perl", + 1 + ], + [ + "Raku", + 1 + ] + ], + "id" : "BarrOff" + }, + { + "name" : "Bob Lied", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Bob Lied" + }, + { + "name" : "Bruce Gray", + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Bruce Gray" + }, + { + "id" : "Cheok-Yin Fung", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Cheok-Yin Fung" + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Clifton Wood", + "name" : "Clifton Wood" + }, + { + "id" : "Dave Jacoby", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Dave Jacoby" + }, + { + "name" : "David Ferrone", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "David Ferrone" + }, + { + "id" : "E. Choroba", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "E. Choroba" + }, + { + "name" : "Humberto Massa", + "id" : "Humberto Massa", + "data" : [ + [ + "Raku", + 2 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Ian Rifkin", + "name" : "Ian Rifkin" + }, + { + "name" : "Jan Krnavek", + "id" : "Jan Krnavek", + "data" : [ + [ + "Raku", + 1 + ] + ] + }, + { + "name" : "Jorg Sommrey", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Jorg Sommrey" + }, + { + "name" : "Laurent Rosenfeld", + "data" : [ + [ + "Perl", + 1 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ], + "id" : "Laurent Rosenfeld" + }, + { + "name" : "Lubos Kolouch", + "id" : "Lubos Kolouch", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "name" : "Luca Ferrari", + "id" : "Luca Ferrari", + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 9 + ] + ] + }, + { + "name" : "Mariano Spadaccini", + "id" : "Mariano Spadaccini", + "data" : [ + [ + "Perl", + 1 + ] + ] + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Mark Anderson", + "name" : "Mark Anderson" + }, + { + "name" : "Matthew Neleigh", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Matthew Neleigh" + }, + { + "name" : "Nelo Tovar", + "id" : "Nelo Tovar", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "name" : "Niels van Dijke", + "id" : "Niels van Dijke", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "name" : "Packy Anderson", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Packy Anderson" + }, + { + "id" : "Paulo Custodio", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Paulo Custodio" + }, + { + "name" : "Peter Campbell Smith", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Peter Campbell Smith" + }, + { + "name" : "Peter Meszaros", + "id" : "Peter Meszaros", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "name" : "Robbie Hatley", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Robbie Hatley" + }, + { + "name" : "Robert Ransbottom", + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Robert Ransbottom" + }, + { + "name" : "Roger Bell_West", + "id" : "Roger Bell_West", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "id" : "Thomas Kohler", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 2 + ] + ], + "name" : "Thomas Kohler" + }, + { + "name" : "Ulrich Rieke", + "id" : "Ulrich Rieke", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "W. Luis Mochan", + "name" : "W. Luis Mochan" + } + ] + }, + "series" : [ + { + "data" : [ + { + "y" : 4, + "drilldown" : "Adam Russell", + "name" : "Adam Russell" + }, + { + "drilldown" : "Ali Moradi", + "y" : 3, + "name" : "Ali Moradi" + }, + { + "name" : "Arne Sommer", + "y" : 3, + "drilldown" : "Arne Sommer" + }, + { + "name" : "Athanasius", + "drilldown" : "Athanasius", + "y" : 4 + }, + { + "y" : 2, + "drilldown" : "BarrOff", + "name" : "BarrOff" + }, + { + "name" : "Bob Lied", + "drilldown" : "Bob Lied", + "y" : 2 + }, + { + "drilldown" : "Bruce Gray", + "y" : 2, + "name" : "Bruce Gray" + }, + { + "drilldown" : "Cheok-Yin Fung", + "y" : 2, + "name" : "Cheok-Yin Fung" + }, + { + "drilldown" : "Clifton Wood", + "y" : 2, + "name" : "Clifton Wood" + }, + { + "drilldown" : "Dave Jacoby", + "y" : 3, + "name" : "Dave Jacoby" + }, + { + "y" : 2, + "drilldown" : "David Ferrone", + "name" : "David Ferrone" + }, + { + "y" : 2, + "drilldown" : "E. Choroba", + "name" : "E. Choroba" + }, + { + "name" : "Humberto Massa", + "drilldown" : "Humberto Massa", + "y" : 2 + }, + { + "name" : "Ian Rifkin", + "y" : 3, + "drilldown" : "Ian Rifkin" + }, + { + "name" : "Jan Krnavek", + "y" : 1, + "drilldown" : "Jan Krnavek" + }, + { + "y" : 3, + "drilldown" : "Jorg Sommrey", + "name" : "Jorg Sommrey" + }, + { + "drilldown" : "Laurent Rosenfeld", + "y" : 5, + "name" : "Laurent Rosenfeld" + }, + { + "name" : "Lubos Kolouch", + "drilldown" : "Lubos Kolouch", + "y" : 5 + }, + { + "name" : "Luca Ferrari", + "y" : 11, + "drilldown" : "Luca Ferrari" + }, + { + "y" : 1, + "drilldown" : "Mariano Spadaccini", + "name" : "Mariano Spadaccini" + }, + { + "name" : "Mark Anderson", + "y" : 2, + "drilldown" : "Mark Anderson" + }, + { + "name" : "Matthew Neleigh", + "drilldown" : "Matthew Neleigh", + "y" : 2 + }, + { + "name" : "Nelo Tovar", + "y" : 2, + "drilldown" : "Nelo Tovar" + }, + { + "y" : 2, + "drilldown" : "Niels van Dijke", + "name" : "Niels van Dijke" + }, + { + "y" : 5, + "drilldown" : "Packy Anderson", + "name" : "Packy Anderson" + }, + { + "name" : "Paulo Custodio", + "drilldown" : "Paulo Custodio", + "y" : 2 + }, + { + "name" : "Peter Campbell Smith", + "y" : 3, + "drilldown" : "Peter Campbell Smith" + }, + { + "drilldown" : "Peter Meszaros", + "y" : 2, + "name" : "Peter Meszaros" + }, + { + "drilldown" : "Robbie Hatley", + "y" : 3, + "name" : "Robbie Hatley" + }, + { + "drilldown" : "Robert Ransbottom", + "y" : 2, + "name" : "Robert Ransbottom" + }, + { + "drilldown" : "Roger Bell_West", + "y" : 5, + "name" : "Roger Bell_West" + }, + { + "drilldown" : "Thomas Kohler", + "y" : 4, + "name" : "Thomas Kohler" + }, + { + "name" : "Ulrich Rieke", + "drilldown" : "Ulrich Rieke", + "y" : 4 + }, + { + "name" : "W. Luis Mochan", + "y" : 3, + "drilldown" : "W. Luis Mochan" + } + ], + "name" : "The Weekly Challenge - 245", + "colorByPoint" : 1 + } + ], + "subtitle" : { + "text" : "[Champions: 34] Last updated at 2023-12-04 11:03:32 GMT" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "chart" : { + "type" : "column" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + }, + "tooltip" : { + "headerFormat" : "{series.name}
", + "followPointer" : 1, + "pointFormat" : "{point.name}: {point.y:f}
" + } +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index ab08990493..b518c2501e 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,147 +1,32 @@ { - "tooltip" : { - "followPointer" : 1, - "pointFormat" : "{point.name}: {point.y:f}
", - "headerFormat" : "{series.name}
" - }, "plotOptions" : { "series" : { - "borderWidth" : 0, "dataLabels" : { "enabled" : 1, "format" : "{point.y}" - } + }, + "borderWidth" : 0 } }, + "xAxis" : { + "type" : "category" + }, + "title" : { + "text" : "The Weekly Challenge - 246" + }, + "legend" : { + "enabled" : 0 + }, + "tooltip" : { + "headerFormat" : "{series.name}
", + "followPointer" : 1, + "pointFormat" : "{point.name}: {point.y:f}
" + }, "drilldown" : { "series" : [ { - "id" : "Adam Russell", - "name" : "Adam Russell", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 2 - ] - ] - }, - { - "id" : "Ali Moradi", - "name" : "Ali Moradi", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "data" : [ - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "name" : "Arne Sommer", - "id" : "Arne Sommer" - }, - { - "name" : "Athanasius", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ], - "id" : "Athanasius" - }, - { - "id" : "BarrOff", - "data" : [ - [ - "Perl", - 1 - ], - [ - "Raku", - 1 - ] - ], - "name" : "BarrOff" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Bob Lied", - "id" : "Bob Lied" - }, - { - "id" : "Bruce Gray", - "data" : [ - [ - "Raku", - 2 - ] - ], - "name" : "Bruce Gray" - }, - { - "name" : "Cheok-Yin Fung", - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Cheok-Yin Fung" - }, - { - "data" : [ - [ - "Raku", - 2 - ] - ], - "name" : "Clifton Wood", - "id" : "Clifton Wood" - }, - { - "id" : "Dave Jacoby", - "name" : "Dave Jacoby", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "id" : "David Ferrone", "name" : "David Ferrone", + "id" : "David Ferrone", "data" : [ [ "Perl", @@ -149,278 +34,23 @@ ] ] }, - { - "id" : "E. Choroba", - "name" : "E. Choroba", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "id" : "Humberto Massa", - "data" : [ - [ - "Raku", - 2 - ] - ], - "name" : "Humberto Massa" - }, - { - "id" : "Ian Rifkin", - "name" : "Ian Rifkin", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "name" : "Jorg Sommrey", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Jorg Sommrey" - }, - { - "data" : [ - [ - "Perl", - 1 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 2 - ] - ], - "name" : "Laurent Rosenfeld", - "id" : "Laurent Rosenfeld" - }, - { - "id" : "Lubos Kolouch", - "name" : "Lubos Kolouch", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, { "id" : "Luca Ferrari", - "name" : "Luca Ferrari", - "data" : [ - [ - "Raku", - 2 - ], - [ - "Blog", - 9 - ] - ] - }, - { - "name" : "Mariano Spadaccini", - "data" : [ - [ - "Perl", - 1 - ] - ], - "id" : "Mariano Spadaccini" - }, - { - "data" : [ - [ - "Raku", - 2 - ] - ], - "name" : "Mark Anderson", - "id" : "Mark Anderson" - }, - { - "id" : "Matthew Neleigh", "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Matthew Neleigh" - }, - { - "id" : "Nelo Tovar", - "name" : "Nelo Tovar", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "id" : "Niels van Dijke", - "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Niels van Dijke" - }, - { - "data" : [ - [ - "Perl", - 2 - ], [ "Raku", 2 ], [ "Blog", - 1 - ] - ], - "name" : "Packy Anderson", - "id" : "Packy Anderson" - }, - { - "name" : "Paulo Custodio", - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Paulo Custodio" - }, - { - "name" : "Peter Campbell Smith", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 + 8 ] ], - "id" : "Peter Campbell Smith" - }, - { - "id" : "Peter Meszaros", - "name" : "Peter Meszaros", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "id" : "Robbie Hatley", - "name" : "Robbie Hatley", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "id" : "Robert Ransbottom", - "name" : "Robert Ransbottom", - "data" : [ - [ - "Raku", - 2 - ] - ] - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "name" : "Roger Bell_West", - "id" : "Roger Bell_West" - }, - { - "id" : "Thomas Kohler", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 2 - ] - ], - "name" : "Thomas Kohler" - }, - { - "id" : "Ulrich Rieke", - "name" : "Ulrich Rieke", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ] + "name" : "Luca Ferrari" }, { "name" : "W. Luis Mochan", + "id" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -430,202 +60,42 @@ "Blog", 1 ] - ], - "id" : "W. Luis Mochan" + ] } ] }, - "title" : { - "text" : "The Weekly Challenge - 245" - }, - "subtitle" : { - "text" : "[Champions: 33] Last updated at 2023-12-04 02:12:32 GMT" - }, - "chart" : { - "type" : "column" - }, - "legend" : { - "enabled" : 0 - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "xAxis" : { - "type" : "category" - }, "series" : [ { - "colorByPoint" : 1, "data" : [ { - "drilldown" : "Adam Russell", - "name" : "Adam Russell", - "y" : 4 - }, - { - "y" : 3, - "name" : "Ali Moradi", - "drilldown" : "Ali Moradi" - }, - { - "name" : "Arne Sommer", - "y" : 3, - "drilldown" : "Arne Sommer" - }, - { - "name" : "Athanasius", - "y" : 4, - "drilldown" : "Athanasius" - }, - { - "name" : "BarrOff", "y" : 2, - "drilldown" : "BarrOff" - }, - { - "y" : 2, - "name" : "Bob Lied", - "drilldown" : "Bob Lied" - }, - { - "y" : 2, - "name" : "Bruce Gray", - "drilldown" : "Bruce Gray" - }, - { - "drilldown" : "Cheok-Yin Fung", - "name" : "Cheok-Yin Fung", - "y" : 2 - }, - { - "drilldown" : "Clifton Wood", - "name" : "Clifton Wood", - "y" : 2 - }, - { - "name" : "Dave Jacoby", - "y" : 3, - "drilldown" : "Dave Jacoby" - }, - { "drilldown" : "David Ferrone", - "name" : "David Ferrone", - "y" : 2 - }, - { - "drilldown" : "E. Choroba", - "name" : "E. Choroba", - "y" : 2 - }, - { - "name" : "Humberto Massa", - "y" : 2, - "drilldown" : "Humberto Massa" + "name" : "David Ferrone" }, { - "y" : 3, - "name" : "Ian Rifkin", - "drilldown" : "Ian Rifkin" + "y" : 10, + "drilldown" : "Luca Ferrari", + "name" : "Luca Ferrari" }, { - "name" : "Jorg Sommrey", "y" : 3, - "drilldown" : "Jorg Sommrey" - }, - { - "drilldown" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld", - "y" : 5 - }, - { - "drilldown" : "Lubos Kolouch", - "y" : 5, - "name" : "Lubos Kolouch" - }, - { - "y" : 11, - "name" : "Luca Ferrari", - "drilldown" : "Luca Ferrari" - }, - { - "drilldown" : "Mariano Spadaccini", - "name" : "Mariano Spadaccini", - "y" : 1 - }, - { - "y" : 2, - "name" : "Mark Anderson", - "drilldown" : "Mark Anderson" - }, - { - "drilldown" : "Matthew Neleigh", - "name" : "Matthew Neleigh", - "y" : 2 - }, - { - "drilldown" : "Nelo Tovar", - "y" : 2, - "name" : "Nelo Tovar" - }, - { - "drilldown" : "Niels van Dijke", - "name" : "Niels van Dijke", - "y" : 2 - }, - { - "name" : "Packy Anderson", - "y" : 5, - "drilldown" : "Packy Anderson" - }, - { - "y" : 2, - "name" : "Paulo Custodio", - "drilldown" : "Paulo Custodio" - }, - { - "drilldown" : "Peter Campbell Smith", - "name" : "Peter Campbell Smith", - "y" : 3 - }, - { - "y" : 2, - "name" : "Peter Meszaros", - "drilldown" : "Peter Meszaros" - }, - { - "y" : 3, - "name" : "Robbie Hatley", - "drilldown" : "Robbie Hatley" - }, - { - "name" : "Robert Ransbottom", - "y" : 2, - "drilldown" : "Robert Ransbottom" - }, - { - "drilldown" : "Roger Bell_West", - "name" : "Roger Bell_West", - "y" : 5 - }, - { - "y" : 4, - "name" : "Thomas Kohler", - "drilldown" : "Thomas Kohler" - }, - { - "y" : 4, - "name" : "Ulrich Rieke", - "drilldown" : "Ulrich Rieke" - }, - { "drilldown" : "W. Luis Mochan", - "name" : "W. Luis Mochan", - "y" : 3 + "name" : "W. Luis Mochan" } ], - "name" : "The Weekly Challenge - 245" + "colorByPoint" : 1, + "name" : "The Weekly Challenge - 246" } - ] + ], + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "subtitle" : { + "text" : "[Champions: 3] Last updated at 2023-12-04 11:07:42 GMT" + }, + "chart" : { + "type" : "column" + } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 5a03fb3005..6b38f33c09 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,25 +1,7 @@ { - "tooltip" : { - "pointFormat" : "{point.y:.0f}" - }, "title" : { "text" : "The Weekly Challenge Contributions [2019 - 2023]" }, - "subtitle" : { - "text" : "Last updated at 2023-12-04 02:12:32 GMT" - }, - "chart" : { - "type" : "column" - }, - "legend" : { - "enabled" : "false" - }, - "yAxis" : { - "min" : 0, - "title" : { - "text" : null - } - }, "xAxis" : { "type" : "category", "labels" : { @@ -29,35 +11,53 @@ } } }, + "subtitle" : { + "text" : "Last updated at 2023-12-04 11:07:42 GMT" + }, + "yAxis" : { + "min" : 0, + "title" : { + "text" : null + } + }, "series" : [ { + "dataLabels" : { + "align" : "right", + "enabled" : "true", + "rotation" : -90, + "color" : "#FFFFFF", + "format" : "{point.y:.0f}", + "y" : 10, + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + } + }, "data" : [ [ "Blog", - 4261 + 4270 ], [ "Perl", - 12669 + 12673 ], [ "Raku", - 7308 + 7311 ] ], - "name" : "Contributions", - "dataLabels" : { - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - }, - "y" : 10, - "color" : "#FFFFFF", - "format" : "{point.y:.0f}", - "enabled" : "true", - "rotation" : -90, - "align" : "right" - } + "name" : "Contributions" } - ] + ], + "chart" : { + "type" : "column" + }, + "tooltip" : { + "pointFormat" : "{point.y:.0f}" + }, + "legend" : { + "enabled" : "false" + } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index a1826e064d..a951c9338f 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,14 +1,22 @@ { - "tooltip" : { - "pointFormat" : "Challenge {point.name}: {point.y:f}
", - "headerFormat" : "", - "followPointer" : "true" + "xAxis" : { + "type" : "category" + }, + "title" : { + "text" : "The Weekly Challenge Language" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } }, "drilldown" : { "series" : [ { - "id" : "001", - "name" : "001", "data" : [ [ "Perl", @@ -22,9 +30,12 @@ "Blog", 12 ] - ] + ], + "id" : "001", + "name" : "001" }, { + "id" : "002", "data" : [ [ "Perl", @@ -39,8 +50,7 @@ 10 ] ], - "name" : "002", - "id" : "002" + "name" : "002" }, { "data" : [ @@ -57,12 +67,12 @@ 9 ] ], - "name" : "003", - "id" : "003" + "id" : "003", + "name" : "003" }, { - "id" : "004", "name" : "004", + "id" : "004", "data" : [ [ "Perl", @@ -79,6 +89,7 @@ ] }, { + "id" : "005", "data" : [ [ "Perl", @@ -93,11 +104,9 @@ 12 ] ], - "name" : "005", - "id" : "005" + "name" : "005" }, { - "name" : "006", "data" : [ [ "Perl", @@ -112,11 +121,11 @@ 7 ] ], - "id" : "006" + "id" : "006", + "name" : "006" }, { "id" : "007", - "name" : "007", "data" : [ [ "Perl", @@ -130,11 +139,12 @@ "Blog", 10 ] - ] + ], + "name" : "007" }, { - "id" : "008", "name" : "008", + "id" : "008", "data" : [ [ "Perl", @@ -151,7 +161,6 @@ ] }, { - "id" : "009", "data" : [ [ "Perl", @@ -166,6 +175,7 @@ 13 ] ], + "id" : "009", "name" : "009" }, { @@ -183,12 +193,12 @@ 11 ] ], - "name" : "010", - "id" : "010" + "id" : "010", + "name" : "010" }, { - "id" : "011", "name" : "011", + "id" : "011", "data" : [ [ "Perl", @@ -206,7 +216,6 @@ }, { "id" : "012", - "name" : "012", "data" : [ [ "Perl", @@ -220,10 +229,10 @@ "Blog", 11 ] - ] + ], + "name" : "012" }, { - "name" : "013", "data" : [ [ "Perl", @@ -238,10 +247,12 @@ 13 ] ], - "id" : "013" + "id" : "013", + "name" : "013" }, { "name" : "014", + "id" : "014", "data" : [ [ "Perl", @@ -255,8 +266,7 @@ "Blog", 15 ] - ], - "id" : "014" + ] }, { "id" : "015", @@ -277,6 +287,8 @@ "name" : "015" }, { + "name" : "016", + "id" : "016", "data" : [ [ "Perl", @@ -290,12 +302,9 @@ "Blog", 13 ] - ], - "name" : "016", - "id" : "016" + ] }, { - "name" : "017", "data" : [ [ "Perl", @@ -310,7 +319,8 @@ 12 ] ], - "id" : "017" + "id" : "017", + "name" : "017" }, { "name" : "018", @@ -331,6 +341,8 @@ "id" : "018" }, { + "name" : "019", + "id" : "019", "data" : [ [ "Perl", @@ -344,11 +356,10 @@ "Blog", 13 ] - ], - "name" : "019", - "id" : "019" + ] }, { + "id" : "020", "data" : [ [ "Perl", @@ -363,12 +374,10 @@ 13 ] ], - "name" : "020", - "id" : "020" + "name" : "020" }, { "id" : "021", - "name" : "021", "data" : [ [ "Perl", @@ -382,7 +391,8 @@ "Blog", 10 ] - ] + ], + "name" : "021" }, { "data" : [ @@ -399,11 +409,10 @@ 10 ] ], - "name" : "022", - "id" : "022" + "id" : "022", + "name" : "022" }, { - "name" : "023", "data" : [ [ "Perl", @@ -418,11 +427,11 @@ 12 ] ], - "id" : "023" + "id" : "023", + "name" : "023" }, { "id" : "024", - "name" : "024", "data" : [ [ "Perl", @@ -436,10 +445,11 @@ "Blog", 11 ] - ] + ], + "name" : "024" }, { - "id" : "025", + "name" : "025", "data" : [ [ "Perl", @@ -454,11 +464,10 @@ 12 ] ], - "name" : "025" + "id" : "025" }, { "id" : "026", - "name" : "026", "data" : [ [ "Perl", @@ -472,11 +481,10 @@ "Blog", 10 ] -