From a88b97a7e70760872d0e619613600da8b6e52486 Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 8 Nov 2021 11:54:56 +0100 Subject: PWC 136 in PostgreSQL --- challenge-136/luca-ferrari/postgresql/ch-1.sql | 16 ++++++++++++++ challenge-136/luca-ferrari/postgresql/ch-2.sql | 29 ++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 challenge-136/luca-ferrari/postgresql/ch-1.sql create mode 100644 challenge-136/luca-ferrari/postgresql/ch-2.sql diff --git a/challenge-136/luca-ferrari/postgresql/ch-1.sql b/challenge-136/luca-ferrari/postgresql/ch-1.sql new file mode 100644 index 0000000000..ebf5d2becb --- /dev/null +++ b/challenge-136/luca-ferrari/postgresql/ch-1.sql @@ -0,0 +1,16 @@ +CREATE OR REPLACE FUNCTION task1( a int, b int ) + RETURNS int +AS $CODE$ + SELECT gcd( a, b ) % 2; + $CODE$ + LANGUAGE SQL; + +/* + Example of invocation: + + testdb=> SELECT task1( 8, 24 ) as a8_24, task1( 26, 39 ) as a26_39, task1( 4, 10 ) as a4_10; + -[ RECORD 1 ] + a8_24 | 0 + a26_39 | 1 + a4_10 | 0 +*/ diff --git a/challenge-136/luca-ferrari/postgresql/ch-2.sql b/challenge-136/luca-ferrari/postgresql/ch-2.sql new file mode 100644 index 0000000000..5436ec8456 --- /dev/null +++ b/challenge-136/luca-ferrari/postgresql/ch-2.sql @@ -0,0 +1,29 @@ + +CREATE OR REPLACE FUNCTION task2( l int default 16) + RETURNS SETOF text + AS $CODE$ + +WITH RECURSIVE + fib( p, n ) AS ( + SELECT 1 as p, 1 as n + UNION + SELECT n, p + n FROM fib WHERE n < l + ) + , permutations AS ( + SELECT n::text as perm_n, n as perm_sum, array[ 1 ] as pivot + FROM fib + UNION ALL + SELECT permutations.perm_n || ',' || fib.n, perm_sum + fib.n, array_append( pivot, fib.n ) + FROM permutations, fib + WHERE fib.n < l + AND position( fib.n::text in perm_n ) = 0 + + ) + , results as ( + SELECT array( SELECT perm_n FROM permutations ) + ) + SELECT * + FROM results; + + $CODE$ + LANGUAGE sql; -- cgit From ac973dc68c0da20cb14fc884e49244788584fae0 Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 8 Nov 2021 12:17:31 +0100 Subject: Task 1 done --- challenge-138/luca-ferrari/raku/ch-1.p6 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 challenge-138/luca-ferrari/raku/ch-1.p6 diff --git a/challenge-138/luca-ferrari/raku/ch-1.p6 b/challenge-138/luca-ferrari/raku/ch-1.p6 new file mode 100644 index 0000000000..b238c21ff5 --- /dev/null +++ b/challenge-138/luca-ferrari/raku/ch-1.p6 @@ -0,0 +1,15 @@ +#!raku + +sub MAIN( Int $year where { $year ~~ / \d ** 4 / } && $year > 1900, + Bool :$verbose = False ) { + my Date $date .= new: year => $year, day => 1, month => 1; + my Date $stop .= new: year => $year, day => 31, month => 12; + my $work-days = 0; + while ( $date <= $stop ) { + $work-days += 1 if $date.day-of-week != any( 6, 7 ); + $date = $date + 1; + } + + "$year has $work-days work days".say if $verbose; + $work-days.say if ! $verbose; +} -- cgit From 95903b6b139186fe0a85fc52df1ce886f04f3e52 Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 8 Nov 2021 12:25:03 +0100 Subject: Task 1 done in PostgreSQL --- challenge-138/luca-ferrari/postgresql/ch-1.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 challenge-138/luca-ferrari/postgresql/ch-1.sql diff --git a/challenge-138/luca-ferrari/postgresql/ch-1.sql b/challenge-138/luca-ferrari/postgresql/ch-1.sql new file mode 100644 index 0000000000..53956e64cb --- /dev/null +++ b/challenge-138/luca-ferrari/postgresql/ch-1.sql @@ -0,0 +1,12 @@ +CREATE OR REPLACE FUNCTION + f_working_days_per_year( yy int default extract( year from current_date ) ) + RETURNS int +AS $CODE$ + SELECT count( v ) + FROM generate_series( make_date( yy, 01, 01 ), + make_date( yy, 12, 31 ), + '1 days' ) v + WHERE + extract( dow from v ) NOT IN ( 0, 6 ); + $CODE$ + LANGUAGE sql; -- cgit From daf57f04732fc4bfbcab413729f348334a6338b6 Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 8 Nov 2021 12:44:46 +0100 Subject: Task 2 done. --- challenge-138/luca-ferrari/raku/ch-2.p6 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 challenge-138/luca-ferrari/raku/ch-2.p6 diff --git a/challenge-138/luca-ferrari/raku/ch-2.p6 b/challenge-138/luca-ferrari/raku/ch-2.p6 new file mode 100644 index 0000000000..72e7295a70 --- /dev/null +++ b/challenge-138/luca-ferrari/raku/ch-2.p6 @@ -0,0 +1,16 @@ +#!raku + +sub MAIN( Int:D $n where { $n > 0 } ) { + my $qrt = $n.sqrt; + my @digits = $n.split( '', :skip-empty ); + + # short circuit: esay case + 1.say and exit if @digits.sum == $qrt; + + # try to aggregate from left to right + for 1 ..^ @digits.elems { + last if @digits[ 0 .. $_ ].join.Int > $qrt; + '1'.say and exit if @digits[ 0 .. $_ ].join + @digits[ $_ + 1 .. * - 1 ].sum == $qrt; + } + +} -- cgit From 3ee103c948388738696b2ac4efcb038b80d8d2d9 Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 8 Nov 2021 13:25:32 +0100 Subject: Task 2 PostgreSQL done --- challenge-138/luca-ferrari/postgresql/ch-2.sql | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 challenge-138/luca-ferrari/postgresql/ch-2.sql diff --git a/challenge-138/luca-ferrari/postgresql/ch-2.sql b/challenge-138/luca-ferrari/postgresql/ch-2.sql new file mode 100644 index 0000000000..6b6c49cc89 --- /dev/null +++ b/challenge-138/luca-ferrari/postgresql/ch-2.sql @@ -0,0 +1,34 @@ +CREATE OR REPLACE FUNCTION + f_split_numbers( n int default 9801 ) + RETURNS int +AS $CODE$ + DECLARE + sqrt int := sqrt( n ); + digits int[] := regexp_split_to_array( n::text, '' ); + aggregation int := 0; + sum_left int := 0; + sum_right int := 0; +BEGIN + RAISE DEBUG 'Operating for % (sqrt = %)', n, sqrt; + + FOR aggregation IN 1 .. length( n::text ) LOOP + RAISE DEBUG 'Aggregation index %', aggregation; + + SELECT array_to_string( digits[1:aggregation], '' )::int + , sum( r ) + FROM ( SELECT unnest( digits[ aggregation + 1: length( n::text ) ] ) AS r ) rr + INTO sum_left, sum_right; + + RAISE DEBUG '% + %', sum_left, sum_right; + + IF ( sum_left + sum_right ) = sqrt THEN + RETURN 1; + END IF; + END LOOP; + + RETURN 0; +END + $CODE$ + LANGUAGE plpgsql; + + -- cgit From 3884d453ec25a1a5a269d9d63bbac4772caa4786 Mon Sep 17 00:00:00 2001 From: Mark <53903062+andemark@users.noreply.github.com> Date: Mon, 8 Nov 2021 13:09:51 +0000 Subject: initial --- challenge-138/mark-anderson/raku/ch-1.raku | 17 +++++++++++++++++ challenge-138/mark-anderson/raku/ch-2.raku | 24 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 challenge-138/mark-anderson/raku/ch-1.raku create mode 100644 challenge-138/mark-anderson/raku/ch-2.raku diff --git a/challenge-138/mark-anderson/raku/ch-1.raku b/challenge-138/mark-anderson/raku/ch-1.raku new file mode 100644 index 0000000000..2580a09cdd --- /dev/null +++ b/challenge-138/mark-anderson/raku/ch-1.raku @@ -0,0 +1,17 @@ +#!/usr/bin/env raku + +say workdays(2021); +say workdays(2020); + +sub workdays($year) +{ + my $dt = Date.new($year, 1, 1); + my $days = $dt.is-leap-year ?? 366 !! 365; + + for 1..$days + { + state $bd++ if $dt.day-of-week ~~ 1..5; + $dt .= later(:1days); + LAST { return $bd } + } +} diff --git a/challenge-138/mark-anderson/raku/ch-2.raku b/challenge-138/mark-anderson/raku/ch-2.raku new file mode 100644 index 0000000000..0eced882d6 --- /dev/null +++ b/challenge-138/mark-anderson/raku/ch-2.raku @@ -0,0 +1,24 @@ +#!/usr/bin/env raku + +say split-number(81); +say split-number(9801); +say split-number(36); + +sub split-number($n) +{ + for terms($n.chars) + { + my @a = $n.comb.rotor($_); + next if first { .elems > 1 and .head == 0 }, @a; + return 1 if @a>>.join.sum == $n.sqrt; + } + + return 0; +} + +sub terms($u) +{ + map { + ((.fmt: '%0' ~ $u ~ 'b') ~~ m:g/(.)[$0+]?/).map(*.chars) + }, 1..2**($u-1)-1; +} -- cgit From 10e6a7aa2ac5c135eb1c6abb9c4409a9dc842b24 Mon Sep 17 00:00:00 2001 From: Mark <53903062+andemark@users.noreply.github.com> Date: Mon, 8 Nov 2021 13:15:30 +0000 Subject: initial --- challenge-138/mark-anderson/raku/ch-1.raku | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/challenge-138/mark-anderson/raku/ch-1.raku b/challenge-138/mark-anderson/raku/ch-1.raku index 2580a09cdd..192b2e7822 100644 --- a/challenge-138/mark-anderson/raku/ch-1.raku +++ b/challenge-138/mark-anderson/raku/ch-1.raku @@ -10,8 +10,8 @@ sub workdays($year) for 1..$days { - state $bd++ if $dt.day-of-week ~~ 1..5; + state $wd++ if $dt.day-of-week ~~ 1..5; $dt .= later(:1days); - LAST { return $bd } + LAST { return $wd } } } -- cgit From 98833b4aa8ad2809378bda50bc62d1736c19f196 Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 8 Nov 2021 14:39:46 +0100 Subject: Blog references --- challenge-138/luca-ferrari/blog-1.txt | 1 + challenge-138/luca-ferrari/blog-2.txt | 1 + challenge-138/luca-ferrari/blog-3.txt | 1 + challenge-138/luca-ferrari/blog-4.txt | 1 + 4 files changed, 4 insertions(+) create mode 100644 challenge-138/luca-ferrari/blog-1.txt create mode 100644 challenge-138/luca-ferrari/blog-2.txt create mode 100644 challenge-138/luca-ferrari/blog-3.txt create mode 100644 challenge-138/luca-ferrari/blog-4.txt diff --git a/challenge-138/luca-ferrari/blog-1.txt b/challenge-138/luca-ferrari/blog-1.txt new file mode 100644 index 0000000000..01ce5c7e32 --- /dev/null +++ b/challenge-138/luca-ferrari/blog-1.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2021/11/08/PerlWeeklyChallenge138.html#task1 diff --git a/challenge-138/luca-ferrari/blog-2.txt b/challenge-138/luca-ferrari/blog-2.txt new file mode 100644 index 0000000000..b4547b6091 --- /dev/null +++ b/challenge-138/luca-ferrari/blog-2.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2021/11/08/PerlWeeklyChallenge138.html#task2 diff --git a/challenge-138/luca-ferrari/blog-3.txt b/challenge-138/luca-ferrari/blog-3.txt new file mode 100644 index 0000000000..fb6f0f0202 --- /dev/null +++ b/challenge-138/luca-ferrari/blog-3.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2021/11/08/PerlWeeklyChallenge138.html#task1pg diff --git a/challenge-138/luca-ferrari/blog-4.txt b/challenge-138/luca-ferrari/blog-4.txt new file mode 100644 index 0000000000..a0c37f0c45 --- /dev/null +++ b/challenge-138/luca-ferrari/blog-4.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2021/11/08/PerlWeeklyChallenge138.html#task2pg -- cgit From 43a8879240a187a1ab1c90688463afff9ad33f36 Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 8 Nov 2021 14:41:50 +0100 Subject: PWC 136 merge fix --- challenge-136/luca-ferrari/postgresql/ch-1.sql | 20 +--------------- challenge-136/luca-ferrari/postgresql/ch-2.sql | 33 +------------------------- 2 files changed, 2 insertions(+), 51 deletions(-) diff --git a/challenge-136/luca-ferrari/postgresql/ch-1.sql b/challenge-136/luca-ferrari/postgresql/ch-1.sql index 6dd5215177..6dbee2b0af 100644 --- a/challenge-136/luca-ferrari/postgresql/ch-1.sql +++ b/challenge-136/luca-ferrari/postgresql/ch-1.sql @@ -1,21 +1,3 @@ -<<<<<<< HEAD -CREATE OR REPLACE FUNCTION task1( a int, b int ) - RETURNS int -AS $CODE$ - SELECT gcd( a, b ) % 2; - $CODE$ - LANGUAGE SQL; - -/* - Example of invocation: - - testdb=> SELECT task1( 8, 24 ) as a8_24, task1( 26, 39 ) as a26_39, task1( 4, 10 ) as a4_10; - -[ RECORD 1 ] - a8_24 | 0 - a26_39 | 1 - a4_10 | 0 -*/ -======= /* testdb=> SELECT FRIENDLY( 26, 39 ); friendly @@ -40,4 +22,4 @@ AS $CODE$ END; $CODE$ LANGUAGE SQL; ->>>>>>> dfcf558b2190d45a5ebf3c486a7c316dbc3e197e + diff --git a/challenge-136/luca-ferrari/postgresql/ch-2.sql b/challenge-136/luca-ferrari/postgresql/ch-2.sql index eede27f347..f7d9e52fd0 100644 --- a/challenge-136/luca-ferrari/postgresql/ch-2.sql +++ b/challenge-136/luca-ferrari/postgresql/ch-2.sql @@ -1,34 +1,3 @@ -<<<<<<< HEAD - -CREATE OR REPLACE FUNCTION task2( l int default 16) - RETURNS SETOF text - AS $CODE$ - -WITH RECURSIVE - fib( p, n ) AS ( - SELECT 1 as p, 1 as n - UNION - SELECT n, p + n FROM fib WHERE n < l - ) - , permutations AS ( - SELECT n::text as perm_n, n as perm_sum, array[ 1 ] as pivot - FROM fib - UNION ALL - SELECT permutations.perm_n || ',' || fib.n, perm_sum + fib.n, array_append( pivot, fib.n ) - FROM permutations, fib - WHERE fib.n < l - AND position( fib.n::text in perm_n ) = 0 - - ) - , results as ( - SELECT array( SELECT perm_n FROM permutations ) - ) - SELECT * - FROM results; - - $CODE$ - LANGUAGE sql; -======= CREATE OR REPLACE FUNCTION fibonacci_sum( l int DEFAULT 16 ) RETURNS bigint AS $CODE$ @@ -62,4 +31,4 @@ WHERE total_sum = l $CODE$ LANGUAGE SQL; ->>>>>>> dfcf558b2190d45a5ebf3c486a7c316dbc3e197e + -- cgit From 8bd24256e3366742e4c62c6353ad72b678c0f1aa Mon Sep 17 00:00:00 2001 From: Roger Bell_West Date: Mon, 8 Nov 2021 17:50:19 +0000 Subject: Solutions for challenge #138 --- challenge-138/roger-bell-west/perl/ch-1.pl | 28 +++++++++++++ challenge-138/roger-bell-west/perl/ch-2.pl | 36 +++++++++++++++++ challenge-138/roger-bell-west/postscript/ch-1.ps | 37 +++++++++++++++++ challenge-138/roger-bell-west/postscript/ch-2.ps | 51 ++++++++++++++++++++++++ challenge-138/roger-bell-west/python/ch-1.py | 25 ++++++++++++ challenge-138/roger-bell-west/python/ch-2.py | 37 +++++++++++++++++ challenge-138/roger-bell-west/raku/ch-1.p6 | 24 +++++++++++ challenge-138/roger-bell-west/raku/ch-2.p6 | 34 ++++++++++++++++ challenge-138/roger-bell-west/ruby/ch-1.rb | 31 ++++++++++++++ challenge-138/roger-bell-west/ruby/ch-2.rb | 45 +++++++++++++++++++++ challenge-138/roger-bell-west/rust/ch-1.rs | 28 +++++++++++++ challenge-138/roger-bell-west/rust/ch-2.rs | 43 ++++++++++++++++++++ 12 files changed, 419 insertions(+) create mode 100755 challenge-138/roger-bell-west/perl/ch-1.pl create mode 100755 challenge-138/roger-bell-west/perl/ch-2.pl create mode 100644 challenge-138/roger-bell-west/postscript/ch-1.ps create mode 100644 challenge-138/roger-bell-west/postscript/ch-2.ps create mode 100755 challenge-138/roger-bell-west/python/ch-1.py create mode 100755 challenge-138/roger-bell-west/python/ch-2.py create mode 100755 challenge-138/roger-bell-west/raku/ch-1.p6 create mode 100755 challenge-138/roger-bell-west/raku/ch-2.p6 create mode 100755 challenge-138/roger-bell-west/ruby/ch-1.rb create mode 100755 challenge-138/roger-bell-west/ruby/ch-2.rb create mode 100755 challenge-138/roger-bell-west/rust/ch-1.rs create mode 100755 challenge-138/roger-bell-west/rust/ch-2.rs diff --git a/challenge-138/roger-bell-west/perl/ch-1.pl b/challenge-138/roger-bell-west/perl/ch-1.pl new file mode 100755 index 0000000000..54379c17d9 --- /dev/null +++ b/challenge-138/roger-bell-west/perl/ch-1.pl @@ -0,0 +1,28 @@ +#! /usr/bin/perl + +use strict; +use warnings; + +use Test::More tests => 2; + +is(workdays(2021),260,'example 1'); +is(workdays(2020),262,'example 2'); + +sub p { + my $y=shift; + return ($y+int($y/4)-int($y/100)+int($y/400))%7; +} + +sub leapyear { + my $y=shift; + return ($y%4==0 && ($y%100 !=0 || $y%400==0)); +} + +sub workdays { + my $y=shift; + my $i=p($y); + if (leapyear($y)) { + $i+=7; + } + return 260+[0,1,1,1,1,0,0,1,2,2,2,2,1]->[$i]; +} diff --git a/challenge-138/roger-bell-west/perl/ch-2.pl b/challenge-138/roger-bell-west/perl/ch-2.pl new file mode 100755 index 0000000000..cbd6b73f7d --- /dev/null +++ b/challenge-138/roger-bell-west/perl/ch-2.pl @@ -0,0 +1,36 @@ +#! /usr/bin/perl + +use strict; +use warnings; + +use Test::More tests => 3; + +is(splnum(81),1,'example 1'); +is(splnum(9801),1,'example 2'); +is(splnum(36),0,'example 3'); + +sub splnum { + my $n=shift; + my $k=int(sqrt($n)); + if ($k*$k != $n) { + return 0; + } + my @d=split('',$n); + foreach my $s (1..(1<<($#d))-1) { + my @s=(0); + foreach my $i (0..$#d-1) { + if ($s & 1<<$i) { + push @s,$i+1; + } + } + push @s,$#d+1; + my $c=0; + foreach my $j (0..$#s-1) { + $c+=join('',@d[$s[$j]..$s[$j+1]-1]); + } + if ($c == $k) { + return 1; + } + } + return 0; +} diff --git a/challenge-138/roger-bell-west/postscript/ch-1.ps b/challenge-138/roger-bell-west/postscript/ch-1.ps new file mode 100644 index 0000000000..cc37431fa7 --- /dev/null +++ b/challenge-138/roger-bell-west/postscript/ch-1.ps @@ -0,0 +1,37 @@ +%!PS + +/p { + dup dup dup + 4 idiv 4 1 roll + 100 idiv neg 4 1 roll + 400 idiv + add add add + 7 mod +} bind def + +/leapyear { + dup dup + 4 mod 0 eq { + 100 mod 0 ne exch + 400 mod 0 eq or + { + true + } { + false + } ifelse + } { + pop pop false + } ifelse +} bind def + +/workdays { + dup + p exch + leapyear { + 7 add + } if + [ 0 1 1 1 1 0 0 1 2 2 2 2 1 ] exch get 260 add +} bind def + +2021 workdays 260 eq { (Pass) } { (FAIL) } ifelse print ( ) print +2020 workdays 262 eq { (Pass) } { (FAIL) } ifelse = diff --git a/challenge-138/roger-bell-west/postscript/ch-2.ps b/challenge-138/roger-bell-west/postscript/ch-2.ps new file mode 100644 index 0000000000..56f4a27967 --- /dev/null +++ b/challenge-138/roger-bell-west/postscript/ch-2.ps @@ -0,0 +1,51 @@ +%!PS + +/apush { % [a b] c -> [a b c] + /t exch def + [ exch aload pop t ] +} bind def + +/i2s { + dup log cvi 1 add string cvs +} bind def + +/splnum { + /n exch def + /ret 0 def + n sqrt cvi /k exch def + k k mul n ne { + 0 exit + } if + /d n i2s def + /dl d length 1 sub def + 1 1 1 dl bitshift 1 sub { + /sa [ 0 ] def + /s exch def + 0 1 dl 1 sub { + /i exch def + s 1 i bitshift and 0 gt { + /sa sa i 1 add apush def + } if + } for + /sa sa dl 1 add apush def + /c 0 def + 0 1 sa length 2 sub { + /j exch def + d + sa j get + sa j 1 add get sa j get sub + getinterval cvi + c add /c exch def + } for + c k eq { + /ret 1 def + exit + } if + } for + ret +} bind def + +81 splnum 1 eq { (Pass) } { (FAIL) } ifelse print ( ) print +9801 splnum 1 eq { (Pass) } { (FAIL) } ifelse print ( ) print +36 splnum 0 eq { (Pass) } { (FAIL) } +ifelse = diff --git a/challenge-138/roger-bell-west/python/ch-1.py b/challenge-138/roger-bell-west/python/ch-1.py new file mode 100755 index 0000000000..a952b5741a --- /dev/null +++ b/challenge-138/roger-bell-west/python/ch-1.py @@ -0,0 +1,25 @@ +#! /usr/bin/python3 + +import unittest + +def p(y): + return (y+int(y/4)-int(y/100)+int(y/400)) % 7 + +def leapyear(y): + return y%4==0 and (y%100!=0 or y%400==0) + +def workdays(y): + i=p(y) + if leapyear(y): + i+=7 + return 260+[0,1,1,1,1,0,0,1,2,2,2,2,1][i] + +class TestWorkdays(unittest.TestCase): + + def test_ex1(self): + self.assertEqual(workdays(2021),260,'example 1') + + def test_ex2(self): + self.assertEqual(workdays(2020),262,'example 2') + +unittest.main() diff --git a/challenge-138/roger-bell-west/python/ch-2.py b/challenge-138/roger-bell-west/python/ch-2.py new file mode 100755 index 0000000000..1f143c7abc --- /dev/null +++ b/challenge-138/roger-bell-west/python/ch-2.py @@ -0,0 +1,37 @@ +#! /usr/bin/python3 + +import unittest + +from math import sqrt + +def splnum(n): + k=int(sqrt(n)) + if k*k != n: + return 0 + d=str(n) + dl=len(d)-1 + for s in range(1,(1< $s { + my @s=(0); + for (0..@d.end-1) -> $i { + if ($s +& (1 +< $i)) { + push @s,$i+1; + } + } + push @s,@d.end+1; + my $c=0; + for (0..@s.end-1) -> $j { + $c+=join('',@d[@s[$j]..@s[$j+1]-1]); + } + if ($c == $k) { + return 1; + } + } + return 0; +} diff --git a/challenge-138/roger-bell-west/ruby/ch-1.rb b/challenge-138/roger-bell-west/ruby/ch-1.rb new file mode 100755 index 0000000000..eb91003f89 --- /dev/null +++ b/challenge-138/roger-bell-west/ruby/ch-1.rb @@ -0,0 +1,31 @@ +#! /usr/bin/ruby + +def p(y) + return (y+y.div(4)-y.div(100)+y.div(400)) % 7 +end + +def leapyear(y) + return y%4==0 && (y%100!=0 || y%400==0) +end + +def workdays(y) + i=p(y) + if leapyear(y) then + i+=7 + end + return 260+[0,1,1,1,1,0,0,1,2,2,2,2,1][i] +end + +require 'test/unit' + +class TestWorkdays < Test::Unit::TestCase + + def test_ex1 + assert_equal(260,workdays(2021)) + end + + def test_ex2 + assert_equal(262,workdays(2020)) + end + +end diff --git a/challenge-138/roger-bell-west/ruby/ch-2.rb b/challenge-138/roger-bell-west/ruby/ch-2.rb new file mode 100755 index 0000000000..bb13f91e00 --- /dev/null +++ b/challenge-138/roger-bell-west/ruby/ch-2.rb @@ -0,0 +1,45 @@ +#! /usr/bin/ruby + +def splnum(n) + k=Integer.sqrt(n) + if k*k!=n then + return 0 + end + d=n.to_s.split("") + dl=d.length-1 + 1.upto((1< 0 then + sa.push(i+1) + end + end + sa.push(dl+1) + c=0 + 0.upto(sa.length()-2) do |j| + c+=d.slice(sa[j],sa[j+1]-sa[j]).join("").to_i + end + if c==k then + return 1 + end + end + return 0 +end + +require 'test/unit' + +class TestSplnum < Test::Unit::TestCase + + def test_ex1 + assert_equal(1,splnum(81)) + end + + def test_ex2 + assert_equal(1,splnum(9801)) + end + + def test_ex3 + assert_equal(0,splnum(36)) + end + +end diff --git a/challenge-138/roger-bell-west/rust/ch-1.rs b/challenge-138/roger-bell-west/rust/ch-1.rs new file mode 100755 index 0000000000..54cbbb5a0c --- /dev/null +++ b/challenge-138/roger-bell-west/rust/ch-1.rs @@ -0,0 +1,28 @@ +#! /bin/sh +//usr/bin/env rustc --test $0 -o ${0}x && ./${0}x; rm -f ${0}x ; exit + +#[test] +fn test_ex1() { + assert_eq!(workdays(2021),260); +} + +#[test] +fn test_ex2() { + assert_eq!(workdays(2020),262); +} + +fn p(y: i32) -> i32 { + (y+y/4-y/100+y/400) % 7 +} + +fn leapyear(y: i32) -> bool { + y%4==0 && (y%100!=0 || y%400==0) +} + +fn workdays(y: i32) -> i32 { + let mut i=p(y); + if leapyear(y) { + i+=7; + } + 260+vec![0,1,1,1,1,0,0,1,2,2,2,2,1][i as usize] +} diff --git a/challenge-138/roger-bell-west/rust/ch-2.rs b/challenge-138/roger-bell-west/rust/ch-2.rs new file mode 100755 index 0000000000..2e60acb97f --- /dev/null +++ b/challenge-138/roger-bell-west/rust/ch-2.rs @@ -0,0 +1,43 @@ +#! /bin/sh +//usr/bin/env rustc --test $0 -o ${0}x && ./${0}x; rm -f ${0}x ; exit + +#[test] +fn test_ex1() { + assert_eq!(splnum(81),1); +} + +#[test] +fn test_ex2() { + assert_eq!(splnum(9801),1); +} + +#[test] +fn test_ex3() { + assert_eq!(splnum(36),0); +} + +fn splnum(n: u32) -> u8 { + let k=(n as f64).sqrt() as u32; + if k*k != n { + return 0 + } + let d=n.to_string(); + let dl=d.len()-1; + for s in 1..1<
0 { + sa.push(i+1); + } + } + sa.push(dl+1); + let mut c=0; + for j in 0..sa.len()-1 { + c+=d[sa[j]..sa[j+1]].to_string().parse::().unwrap(); + } + if c==k { + return 1; + } + } + 0 +} -- cgit From 75d7dc93b1629888da13f19e1b58657d407f1c13 Mon Sep 17 00:00:00 2001 From: Paulo Custodio Date: Mon, 8 Nov 2021 18:07:00 +0000 Subject: Add Perl solution to challenge 138 --- challenge-138/paulo-custodio/perl/ch-1.pl | 34 ++++++++++++++++ challenge-138/paulo-custodio/perl/ch-2.pl | 62 ++++++++++++++++++++++++++++++ challenge-138/paulo-custodio/t/test-1.yaml | 10 +++++ challenge-138/paulo-custodio/t/test-2.yaml | 15 ++++++++ 4 files changed, 121 insertions(+) create mode 100644 challenge-138/paulo-custodio/perl/ch-1.pl create mode 100644 challenge-138/paulo-custodio/perl/ch-2.pl create mode 100644 challenge-138/paulo-custodio/t/test-1.yaml create mode 100644 challenge-138/paulo-custodio/t/test-2.yaml diff --git a/challenge-138/paulo-custodio/perl/ch-1.pl b/challenge-138/paulo-custodio/perl/ch-1.pl new file mode 100644 index 0000000000..37eb05d527 --- /dev/null +++ b/challenge-138/paulo-custodio/perl/ch-1.pl @@ -0,0 +1,34 @@ +#!/usr/bin/env perl + +# TASK #1 > Workdays +# Submitted by: Mohammad S Anwar +# You are given a year, $year in 4-digits form. +# +# Write a script to calculate the total number of workdays in the given year. +# +# For the task, we consider, Monday - Friday as workdays. +# +# Example 1 +# Input: $year = 2021 +# Output: 261 +# Example 2 +# Input: $year = 2020 +# Output: 262 + +use Modern::Perl; +use DateTime; + +my $year = shift||DateTime->today()->year(); +say count_work_days($year); + +sub count_work_days { + my($year) = @_; + my $count = 0; + my $date = DateTime->new(year=>$year, month=>1, day=>1); + while ($date->year == $year) { + my $dow = $date->dow; # 1-monday..7-sunday + $count++ if $dow<6; + $date->add(days=>1); + } + return $count; +} diff --git a/challenge-138/paulo-custodio/perl/ch-2.pl b/challenge-138/paulo-custodio/perl/ch-2.pl new file mode 100644 index 0000000000..c64a445618 --- /dev/null +++ b/challenge-138/paulo-custodio/perl/ch-2.pl @@ -0,0 +1,62 @@ +#!/usr/bin/env perl + +# TASK #2 > Split Number +# Submitted by: Mohammad S Anwar +# You are given a perfect square. +# +# Write a script to figure out if the square root the given number is same as +# sum of 2 or more splits of the given number. +# +# Example 1 +# Input: $n = 81 +# Output: 1 +# +# Since, sqrt(81) = 8 + 1 +# Example 2 +# Input: $n = 9801 +# Output: 1 +# +# Since, sqrt(9801) = 98 + 0 + 1 +# Example 3 +# Input: $n = 36 +# Output: 0 +# +# Since, sqrt(36) != 3 + 6 + +use Modern::Perl; +use List::Util 'sum'; + +my $n = shift||1; +say sqroot_is_sum_splits($n); + +sub num_splits { + my($n) = @_; + my @splits; + add_splits(\@splits, [], $n); + return @splits; +} + +sub add_splits { + my($splits, $path, $rest) = @_; + if ($rest eq '') { + push @$splits, [@$path]; + } + else { + for my $i (1..length($rest)) { + my $a = substr($rest, 0, $i); + my $b = substr($rest, $i); + add_splits($splits, [@$path, $a], $b); + } + } +} + +sub sqroot_is_sum_splits { + my($n) = @_; + my $sq = sqrt($n); + return 0 if int($sq) != $sq; # not pefect square + for (num_splits($n)) { + my @split = @$_; + return 1 if sum(@split) == $sq; + } + return 0; +} diff --git a/challenge-138/paulo-custodio/t/test-1.yaml b/challenge-138/paulo-custodio/t/test-1.yaml new file mode 100644 index 0000000000..db0b174101 --- /dev/null +++ b/challenge-138/paulo-custodio/t/test-1.yaml @@ -0,0 +1,10 @@ +- setup: + cleanup: + args: 2020 + input: + output: 262 +- setup: + cleanup: + args: 2021 + input: + output: 261 diff --git a/challenge-138/paulo-custodio/t/test-2.yaml b/challenge-138/paulo-custodio/t/test-2.yaml new file mode 100644 index 0000000000..1af15c8d6a --- /dev/null +++ b/challenge-138/paulo-custodio/t/test-2.yaml @@ -0,0 +1,15 @@ +- setup: + cleanup: + args: 81 + input: + output: 1 +- setup: + cleanup: + args: 9801 + input: + output: 1 +- setup: + cleanup: + args: 36 + input: + output: 0 -- cgit From 3ccc2eebc05174df0d4f7f80a9e0d17370d9cdc7 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 8 Nov 2021 18:21:53 +0000 Subject: - Added solutions by Mark Anderson. --- stats/pwc-current.json | 93 +- stats/pwc-language-breakdown-summary.json | 56 +- stats/pwc-language-breakdown.json | 1882 ++++++++++++++--------------- stats/pwc-leaders.json | 382 +++--- stats/pwc-summary-1-30.json | 104 +- stats/pwc-summary-121-150.json | 104 +- stats/pwc-summary-151-180.json | 40 +- stats/pwc-summary-181-210.json | 46 +- stats/pwc-summary-211-240.json | 38 +- stats/pwc-summary-241-270.json | 46 +- stats/pwc-summary-31-60.json | 106 +- stats/pwc-summary-61-90.json | 96 +- stats/pwc-summary-91-120.json | 96 +- stats/pwc-summary.json | 532 ++++---- 14 files changed, 1818 insertions(+), 1803 deletions(-) diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 2ee199720f..6d37eebb98 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,63 +1,78 @@ { + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + }, + "subtitle" : { + "text" : "[Champions: 2] Last updated at 2021-11-08 18:20:29 GMT" + }, "xAxis" : { "type" : "category" }, - "chart" : { - "type" : "column" + "tooltip" : { + "headerFormat" : "{series.name}
", + "pointFormat" : "{point.name}: {point.y:f}
", + "followPointer" : 1 + }, + "title" : { + "text" : "The Weekly Challenge - 138" + }, + "legend" : { + "enabled" : 0 }, - "series" : [ - { - "data" : [ - { - "drilldown" : "Andrew Shitov", - "y" : 1, - "name" : "Andrew Shitov" - } - ], - "name" : "The Weekly Challenge - 138", - "colorByPoint" : 1 - } - ], "drilldown" : { "series" : [ { - "name" : "Andrew Shitov", "data" : [ [ "Raku", 1 ] ], + "name" : "Andrew Shitov", "id" : "Andrew Shitov" + }, + { + "id" : "Mark Anderson", + "data" : [ + [ + "Raku", + 2 + ] + ], + "name" : "Mark Anderson" } ] }, + "series" : [ + { + "name" : "The Weekly Challenge - 138", + "data" : [ + { + "y" : 1, + "name" : "Andrew Shitov", + "drilldown" : "Andrew Shitov" + }, + { + "name" : "Mark Anderson", + "drilldown" : "Mark Anderson", + "y" : 2 + } + ], + "colorByPoint" : 1 + } + ], + "chart" : { + "type" : "column" + }, "yAxis" : { "title" : { "text" : "Total Solutions" } - }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - }, - "borderWidth" : 0 - } - }, - "legend" : { - "enabled" : 0 - }, - "subtitle" : { - "text" : "[Champions: 1] Last updated at 2021-11-08 09:11:48 GMT" - }, - "tooltip" : { - "followPointer" : 1, - "pointFormat" : "{point.name}: {point.y:f}
", - "headerFormat" : "{series.name}
" - }, - "title" : { - "text" : "The Weekly Challenge - 138" } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 1bd5e8f74d..5183ad4e09 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,31 +1,39 @@ { + "subtitle" : { + "text" : "Last updated at 2021-11-08 18:20:29 GMT" + }, "xAxis" : { - "type" : "category", "labels" : { "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" } - } + }, + "type" : "category" }, - "chart" : { - "type" : "column" + "tooltip" : { + "pointFormat" : "{point.y:.0f}" + }, + "title" : { + "text" : "The Weekly Challenge Contributions [2019 - 2021]" + }, + "legend" : { + "enabled" : "false" }, "series" : [ { "dataLabels" : { "format" : "{point.y:.0f}", - "rotation" : -90, + "color" : "#FFFFFF", "enabled" : "true", "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" }, - "y" : 10, + "rotation" : -90, "align" : "right", - "color" : "#FFFFFF" + "y" : 10 }, - "name" : "Contributions", "data" : [ [ "Blog", @@ -37,27 +45,19 @@ ], [ "Raku", - 3995 + 3997 ] - ] + ], + "name" : "Contributions" } ], + "chart" : { + "type" : "column" + }, "yAxis" : { + "min" : 0, "title" : { "text" : null - }, - "min" : 0 - }, - "legend" : { - "enabled" : "false" - }, - "tooltip" : { - "pointFormat" : "{point.y:.0f}" - }, - "title" : { - "text" : "The Weekly Challenge Contributions [2019 - 2021]" - }, - "subtitle" : { - "text" : "Last updated at 2021-11-08 09:11:48 GMT" + } } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 2948743762..8a3d740c23 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,722 +1,12 @@ { - "chart" : { - "type" : "column" - }, - "series" : [ - { - "colorByPoint" : "true", - "data" : [ - { - "drilldown" : "001", - "name" : "#001", - "y" : 161 - }, - { - "y" : 125, - "name" : "#002", - "drilldown" : "002" - }, - { - "drilldown" : "003", - "y" : 81, - "name" : "#003" - }, - { - "drilldown" : "004", - "y" : 99, - "name" : "#004" - }, - { - "name" : "#005", - "y" : 78, - "drilldown" : "005" - }, - { - "drilldown" : "006", - "y" : 58, - "name" : "#006" - }, - { - "drilldown" : "007", - "y" : 64, - "name" : "#007" - }, - { - "name" : "#008", - "y" : 78, - "drilldown" : "008" - }, - { - "y" : 76, - "name" : "#009", - "drilldown" : "009" - }, - { - "drilldown" : "010", - "name" : "#010", - "y" : 65 - }, - { - "y" : 85, - "name" : "#011", - "drilldown" : "011" - }, - { - "drilldown" : "012", - "y" : 89, - "name" : "#012" - }, - { - "drilldown" : "013", - "y" : 85, - "name" : "#013" - }, - { - "drilldown" : "014", - "name" : "#014", - "y" : 101 - }, - { - "drilldown" : "015", - "y" : 99, - "name" : "#015" - }, - { - "y" : 71, - "name" : "#016", - "drilldown" : "016" - }, - { - "name" : "#017", - "y" : 84, - "drilldown" : "017" - }, - { - "drilldown" : "018", - "name" : "#018", - "y" : 81 - }, - { - "drilldown" : "019", - "y" : 103, - "name" : "#019" - }, - { - "drilldown" : "020", - "name" : "#020", - "y" : 101 - }, - { - "drilldown" : "021", - "y" : 72, - "name" : "#021" - }, - { - "drilldown" : "022", - "y" : 68, - "name" : "#022" - }, - { - "name" : "#023", - "y" : 97, - "drilldown" : "023" - }, - { - "name" : "#024", - "y" : 75, - "drilldown" : "024" - }, - { - "name" : "#025", - "y" : 59, - "drilldown" : "025" - }, - { - "drilldown" : "026", - "name" : "#026", - "y" : 74 - }, - { - "y" : 60, - "name" : "#027", - "drilldown" : "027" - }, - { - "y" : 80, - "name" : "#028", - "drilldown" : "028" - }, - { - "name" : "#029", - "y" : 79, - "drilldown" : "029" - }, - { - "y" : 117, - "name" : "#030", - "drilldown" : "030" - }, - { - "drilldown" : "031", - "name" : "#031", - "y" : 89 - }, - { - "drilldown" : "032", - "y" : 94, - "name" : "#032" - }, - { - "drilldown" : "033", - "name" : "#033", - "y" : 110 - }, - { - "y" : 64, - "name" : "#034", - "drilldown" : "034" - }, - { - "drilldown" : "035", - "y" : 64, - "name" : "#035" - }, - { - "drilldown" : "036", - "y" : 68, - "name" : "#036" - }, - { - "name" : "#037", - "y" : 67, - "drilldown" : "037" - }, - { - "drilldown" : "038", - "y" : 68, - "name" : "#038" - }, - { - "drilldown" : "039", - "y" : 62, - "name" : "#039" - }, - { - "drilldown" : "040", - "name" : "#040", - "y" : 73 - }, - { - "y" : 76, - "name" : "#041", - "drilldown" : "041" - }, - { - "drilldown" : "042", - "name" : "#042", - "y" : 92 - }, - { - "y" : 68, - "name" : "#043", - "drilldown" : "043" - }, - { - "y" : 85, - "name" : "#044", - "drilldown" : "044" - }, - { - "drilldown" : "045", - "y" : 96, - "name" : "#045" - }, - { - "name" : "#046", - "y" : 87, - "drilldown" : "046" - }, - { - "y" : 84, - "name" : "#047", - "drilldown" : "047" - }, - { - "drilldown" : "048", - "y" : 108, - "name" : "#048" - }, - { - "name" : "#049", - "y" : 89, - "drilldown" : "049" - }, - { - "name" : "#050", - "y" : 98, - "drilldown" : "050" - }, - { - "drilldown" : "051", - "y" : 89, - "name" : "#051" - }, - { - "name" : "#052", - "y" : 91, - "drilldown" : "052" - }, - { - "drilldown" : "053", - "y" : 101, - "name" : "#053" - }, - { - "y" : 103, - "name" : "#054", - "drilldown" : "054" - }, - { - "name" : "#055", - "y" : 88, - "drilldown" : "055" - }, - { - "name" : "#056", - "y" : 95, - "drilldown" : "056" - }, - { - "name" : "#057", - "y" : 80, - "drilldown" : "057" - }, - { - "drilldown" : "058", - "name" : "#058", - "y" : 69 - }, - { - "y" : 89, - "name" : "#059", - "drilldown" : "059" - }, - { - "y" : 85, - "name" : "#060", - "drilldown" : "060" - }, - { - "drilldown" : "061", - "name" : "#061", - "y" : 81 - }, - { - "drilldown" : "062", - "y" : 58, - "name" : "#062" - }, - { - "name" : "#063", - "y" : 89, - "drilldown" : "063" - }, - { - "drilldown" : "064", - "y" : 80, - "name" : "#064" - }, - { - "name" : "#065", - "y" : 73, - "drilldown" : "065" - }, - { - "drilldown" : "066", - "y" : 84, - "name" : "#066" - }, - { - "y" : 90, - "name" : "#067", - "drilldown" : "067" - }, - { - "drilldown" : "068", - "y" : 75, - "name" : "#068" - }, - { - "name" : "#069", - "y" : 83, - "drilldown" : "069" - }, - { - "y" : 93, - "name" : "#070", - "drilldown" : "070" - }, - { - "drilldown" : "071", - "y" : 78, - "name" : "#071" - }, - { - "drilldown" : "072", - "name" : "#072", - "y" : 112 - }, - { - "drilldown" : "073", - "y" : 110, - "name" : "#073" - }, - { - "drilldown" : "074", - "name" : "#074", - "y" : 115 - }, - { - "y" : 115, - "name" : "#075", - "drilldown" : "075" - }, - { - "drilldown" : "076", - "y" : 99, - "name" : "#076" - }, - { - "drilldown" : "077", - "y" : 98, - "name" : "#077" - }, - { - "drilldown" : "078", - "name" : "#078", - "y" : 127 - }, - { - "y" : 122, - "name" : "#079", - "drilldown" : "079" - }, - { - "drilldown" : "080", - "y" : 127, - "name" : "#080" - }, - { - "name" : "#081", - "y" : 114, - "drilldown" : "081" - }, - { - "drilldown" : "082", - "name" : "#082", - "y" : 114 - }, - { - "y" : 127, - "name" : "#083", - "drilldown" : "083" - }, - { - "drilldown" : "084", - "name" : "#084", - "y" : 119 - }, - { - "y" : 114, - "name" : "#085", - "drilldown" : "085" - }, - { - "y" : 104, - "name" : "#086", - "drilldown" : "086" - }, - { - "name" : "#087", - "y" : 101, - "drilldown" : "087" - }, - { - "name" : "#088", - "y" : 121, - "drilldown" : "088" - }, - { - "drilldown" : "089", - "name" : "#089", - "y" : 113 - }, - { - "name" : "#090", - "y" : 113, - "drilldown" : "090" - }, - { - "y" : 108, - "name" : "#091", - "drilldown" : "091" - }, - { - "y" : 98, - "name" : "#092", - "drilldown" : "092" - }, - { - "drilldown" : "093", - "name" : "#093", - "y" : 87 - }, - { - "drilldown" : "094", - "y" : 87, - "name" : "#094" - }, - { - "drilldown" : "095", - "name" : "#095", - "y" : 108 - }, - { - "y" : 108, - "name" : "#096", - "drilldown" : "096" - }, - { - "name" : "#097", - "y" : 111, - "drilldown" : "097" - }, - { - "drilldown" : "098", - "y" : 108, - "name" : "#098" - }, - { - "y" : 97, - "name" : "#099", - "drilldown" : "099" - }, - { - "y" : 120, - "name" : "#100", - "drilldown" : "100" - }, - { - "drilldown" : "101", - "name" : "#101", - "y" : 83 - }, - { - "drilldown" : "102", - "y" : 90, - "name" : "#102" - }, - { - "drilldown" : "103", - "y" : 79, - "name" : "#103" - }, - { - "name" : "#104", - "y" : 85, - "drilldown" : "104" - }, - { - "y" : 75, - "name" : "#105", - "drilldown" : "105" - }, - { - "drilldown" : "106", - "name" : "#106", - "y" : 97 - }, - { - "y" : 90, - "name" : "#107", - "drilldown" : "107" - }, - { - "drilldown" : "108", - "y" : 94, - "name" : "#108" - }, - { - "y" : 107, - "name" : "#109", - "drilldown" : "109" - }, - { - "name" : "#110", - "y" : 108, - "drilldown" : "110" - }, - { - "y" : 91, - "name" : "#111", - "drilldown" : "111" - }, - { - "drilldown" : "112", - "y" : 92, - "name" : "#112" - }, - { - "name" : "#113", - "y" : 92, - "drilldown" : "113" - }, - { - "drilldown" : "114", - "name" : "#114", - "y" : 108 - }, - { - "y" : 96, - "name" : "#115", - "drilldown" : "115" - }, - { - "name" : "#116", - "y" : 95, - "drilldown" : "116" - }, - { - "y" : 97, - "name" : "#117", - "drilldown" : "117" - }, - { - "y" : 81, - "name" : "#118", - "drilldown" : "118" - }, - { - "drilldown" : "119", - "name" : "#119", - "y" : 123 - }, - { - "drilldown" : "120", - "name" : "#120", - "y" : 114 - }, - { - "name" : "#121", - "y" : 90, - "drilldown" : "121" - }, - { - "name" : "#122", - "y" : 108, - "drilldown" : "122" - }, - { - "y" : 103, - "name" : "#123", - "drilldown" : "123" - }, - { - "y" : 83, - "name" : "#124", - "drilldown" : "124" - }, - { - "name" : "#125", - "y" : 63, - "drilldown" : "125" - }, - { - "drilldown" : "126", - "y" : 106, - "name" : "#126" - }, - { - "name" : "#127", - "y" : 110, - "drilldown" : "127" - }, - { - "drilldown" : "128", - "y" : 69, - "name" : "#128" - }, - { - "name" : "#129", - "y" : 50, - "drilldown" : "129" - }, - { - "y" : 73, - "name" : "#130", - "drilldown" : "130" - }, - { - "y" : 91, - "name" : "#131", - "drilldown" : "131" - }, - { - "y" : 77, - "name" : "#132", - "drilldown" : "132" - }, - { - "drilldown" : "133", - "name" : "#133", - "y" : 93 - }, - { - "drilldown" : "134", - "y" : 92, - "name" : "#134" - }, - { - "drilldown" : "135", - "y" : 102, - "name" : "#135" - }, - { - "drilldown" : "136", - "name" : "#136", - "y" : 93 - }, - { - "drilldown" : "137", - "y" : 93, - "name" : "#137" - }, - { - "name" : "#138", - "y" : 1, - "drilldown" : "138" - } - ], - "name" : "The Weekly Challenge Languages" - } - ], - "xAxis" : { - "type" : "category" - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } - } + "legend" : { + "enabled" : "false" }, "drilldown" : { "series" : [ { - "name" : "001", "id" : "001", + "name" : "001", "data" : [ [ "Perl", @@ -733,7 +23,6 @@ ] }, { - "name" : "002", "data" : [ [ "Perl", @@ -748,10 +37,11 @@ 10 ] ], + "name" : "002", "id" : "002" }, { - "name" : "003", + "id" : "003", "data" : [ [ "Perl", @@ -766,10 +56,9 @@ 9 ] ], - "id" : "003" + "name" : "003" }, { - "id" : "004", "data" : [ [ "Perl", @@ -784,9 +73,11 @@ 10 ] ], - "name" : "004" + "name" : "004", + "id" : "004" }, { + "id" : "005", "name" : "005", "data" : [ [ @@ -801,10 +92,10 @@ "Blog", 12 ] - ], - "id" : "005" + ] }, { + "id" : "006", "name" : "006", "data" : [ [ @@ -819,11 +110,10 @@ "Blog", 7 ] - ], - "id" : "006" + ] }, { - "id" : "007", + "name" : "007", "data" : [ [ "Perl", @@ -838,7 +128,7 @@ 10 ] ], - "name" : "007" + "id" : "007" }, { "data" : [ @@ -855,11 +145,11 @@ 12 ] ], - "id" : "008", - "name" : "008" + "name" : "008", + "id" : "008" }, { - "name" : "009", + "id" : "009", "data" : [ [ "Perl", @@ -874,10 +164,9 @@ 13 ] ], - "id" : "009" + "name" : "009" }, { - "name" : "010", "data" : [ [ "Perl", @@ -892,6 +181,7 @@ 11 ] ], + "name" : "010", "id" : "010" }, { @@ -914,7 +204,6 @@ }, { "name" : "012", - "id" : "012", "data" : [ [ "Perl", @@ -928,10 +217,12 @@ "Blog", 11 ] - ] + ], + "id" : "012" }, { "id" : "013", + "name" : "013", "data" : [ [ "Perl", @@ -945,8 +236,7 @@ "Blog", 13 ] - ], - "name" : "013" + ] }, { "name" : "014", @@ -967,6 +257,7 @@ "id" : "014" }, { + "name" : "015", "data" : [ [ "Perl", @@ -981,10 +272,10 @@ 15 ] ], - "id" : "015", - "name" : "015" + "id" : "015" }, { + "id" : "016", "name" : "016", "data" : [ [ @@ -999,8 +290,7 @@ "Blog", 12 ] - ], - "id" : "016" + ] }, { "name" : "017", @@ -1021,7 +311,7 @@ "id" : "017" }, { - "name" : "018", + "id" : "018", "data" : [ [ "Perl", @@ -1036,11 +326,11 @@ 14 ] ], - "id" : "018" + "name" : "018" }, { - "name" : "019", "id" : "019", + "name" : "019", "data" : [ [ "Perl", @@ -1057,8 +347,6 @@ ] }, { - "name" : "020", - "id" : "020", "data" : [ [ "Perl", @@ -1072,9 +360,12 @@ "Blog", 13 ] - ] + ], + "name" : "020", + "id" : "020" }, { + "id" : "021", "name" : "021", "data" : [ [ @@ -1089,10 +380,10 @@ "Blog", 10 ] - ], - "id" : "021" + ] }, { + "id" : "022", "name" : "022", "data" : [ [ @@ -1107,11 +398,11 @@ "Blog", 10 ] - ], - "id" : "022" + ] }, { "id" : "023", + "name" : "023", "data" : [ [ "Perl", @@ -1125,12 +416,10 @@ "Blog", 12 ] - ], - "name" : "023" + ] }, { "name" : "024", - "id" : "024", "data" : [ [ "Perl", @@ -1144,7 +433,8 @@ "Blog", 11 ] - ] + ], + "id" : "024" }, { "id" : "025", @@ -1202,6 +492,7 @@ }, { "id" : "028", + "name" : "028", "data" : [ [ "Perl", @@ -1215,11 +506,9 @@ "Blog", 9 ] - ], - "name" : "028" + ] }, { - "id" : "029", "data" : [ [ "Perl", @@ -1234,10 +523,11 @@ 12 ] ], - "name" : "029" + "name" : "029", + "id" : "029" }, { - "id" : "030", + "name" : "030", "data" : [ [ "Perl", @@ -1252,10 +542,9 @@ 10 ] ], - "name" : "030" + "id" : "030" }, { - "name" : "031", "data" : [ [ "Perl", @@ -1270,11 +559,11 @@ 9 ] ], + "name" : "031", "id" : "031" }, { "name" : "032", - "id" : "032", "data" : [ [ "Perl", @@ -1288,11 +577,10 @@ "Blog", 10 ] - ] + ], + "id" : "032" }, { - "name" : "033", - "id" : "033", "data" : [ [ "Perl", @@ -1306,9 +594,12 @@ "Blog", 10 ] - ] + ], + "name" : "033", + "id" : "033" }, { + "id" : "034", "name" : "034", "data" : [ [ @@ -1323,10 +614,10 @@ "Blog", 11 ] - ], - "id" : "034" + ] }, { + "id" : "035", "data" : [ [ "Perl", @@ -1341,12 +632,10 @@ 9 ] ], - "id" : "035", "name" : "035" }, { "name" : "036", - "id" : "036", "data" : [ [ "Perl", @@ -1360,10 +649,11 @@ "Blog", 11 ] - ] + ], + "id" : "036" }, { - "name" : "037", + "id" : "037", "data" : [ [ "Perl", @@ -1378,7 +668,7 @@ 9 ] ], - "id" : "037" + "name" : "037" }, { "data" : [ @@ -1395,12 +685,11 @@ 12 ] ], - "id" : "038", - "name" : "038" + "name" : "038", + "id" : "038" }, { "name" : "039", - "id" : "039", "data" : [ [ "Perl", @@ -1414,9 +703,11 @@ "Blog", 12 ] - ] + ], + "id" : "039" }, { + "id" : "040", "data" : [ [ "Perl", @@ -1431,11 +722,10 @@ 10 ] ], - "id" : "040", "name" : "040" }, { - "name" : "041", + "id" : "041", "data" : [ [ "Perl", @@ -1450,9 +740,10 @@ 9 ] ], - "id" : "041" + "name" : "041" }, { + "name" : "042", "data" : [ [ "Perl", @@ -1467,11 +758,10 @@ 11 ] ], - "id" : "042", - "name" : "042" + "id" : "042" }, { - "name" : "043", + "id" : "043", "data" : [ [ "Perl", @@ -1486,11 +776,10 @@ 11 ] ], - "id" : "043" + "name" : "043" }, { "name" : "044", - "id" : "044", "data" : [ [ "Perl", @@ -1504,11 +793,11 @@ "Blog", 11 ] - ] + ], + "id" : "044" }, { "name" : "045", - "id" : "045", "data" : [ [ "Perl", @@ -1522,7 +811,8 @@ "Blog", 11 ] - ] + ], + "id" : "045" }, { "data" : [ @@ -1539,11 +829,10 @@ 10