From b7c6ba230d95ffad246f0f9874e82cbd95e12f56 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Tue, 1 Aug 2023 00:30:26 +0100 Subject: - Added solutions by Niels van Dijke. - Added solutions by Ulrich Rieke. - Added solutions by Robert DiCicco. - Added solutions by Laurent Rosenfeld. - Added solutions by Peter Meszaros. - Added solutions by Mark Anderson. - Added solutions by Lubos Kolouch. - Added solutions by Ali Moradi. - Added solutions by Dave Jacoby. - Added solutions by Peter Campbell Smith. - Added solutions by W. Luis Mochan. - Added solutions by Steven Wilson. - Added solutions by Thomas Kohler. - Added solutions by E. Choroba. - Added solutions by Bob Lied. --- challenge-228/conor-hoekstra/apl/ch-1.apl | 6 + challenge-228/conor-hoekstra/bqn/ch-1.bqn | 6 + challenge-228/conor-hoekstra/ch-01.apl | 6 - challenge-228/conor-hoekstra/ch-01.bqn | 6 - challenge-228/conor-hoekstra/ch-01.py | 7 - challenge-228/conor-hoekstra/ch-01.rs | 14 - challenge-228/conor-hoekstra/python/ch-1.py | 7 + challenge-228/conor-hoekstra/rust/ch-1.rs | 14 + challenge-228/eric-cheung/python/ch-1.py | 8 + challenge-228/eric-cheung/python/ch-2.py | 13 + challenge-228/laurent-rosenfeld/blog.txt | 1 + challenge-228/laurent-rosenfeld/perl/ch-1.pl | 17 + challenge-228/laurent-rosenfeld/raku/ch-1.raku | 10 + challenge-228/perlboy1967/perl/ch-1.pl | 37 + challenge-228/perlboy1967/perl/ch-2.pl | 42 + challenge-228/perlboy1967/perl/ch1.pl | 37 - challenge-228/perlboy1967/perl/ch2.pl | 42 - challenge-228/robert-dicicco/julia/ch-1.jl | 68 + challenge-228/robert-dicicco/perl/ch-1.pl | 62 + challenge-228/robert-dicicco/raku/ch-1.raku | 57 + challenge-228/robert-dicicco/ruby/ch-1.rb | 63 + challenge-228/steven-wilson/perl/ch-01.pl | 24 - challenge-228/steven-wilson/perl/ch-02.pl | 26 - challenge-228/steven-wilson/perl/ch-1.pl | 24 + challenge-228/steven-wilson/perl/ch-2.pl | 26 + challenge-228/ulrich-rieke/cpp/ch-1.cpp | 35 + challenge-228/ulrich-rieke/cpp/ch-2.cpp | 45 + challenge-228/ulrich-rieke/haskell/ch-1.hs | 8 + challenge-228/ulrich-rieke/haskell/ch-2.hs | 21 + challenge-228/ulrich-rieke/perl/ch-1.pl | 23 + challenge-228/ulrich-rieke/perl/ch-2.pl | 34 + challenge-228/ulrich-rieke/raku/ch-1.raku | 10 + challenge-228/ulrich-rieke/raku/ch-2.raku | 27 + challenge-228/ulrich-rieke/rust/ch-1.rs | 23 + challenge-228/ulrich-rieke/rust/ch-2.rs | 23 + stats/pwc-challenge-211.json | 319 +++-- stats/pwc-challenge-227.json | 718 ++++++++++ stats/pwc-current.json | 646 ++------- stats/pwc-language-breakdown-summary.json | 60 +- stats/pwc-language-breakdown.json | 1587 +++++++++++---------- stats/pwc-leaders.json | 836 +++++------ stats/pwc-summary-1-30.json | 128 +- stats/pwc-summary-121-150.json | 132 +- stats/pwc-summary-151-180.json | 122 +- stats/pwc-summary-181-210.json | 108 +- stats/pwc-summary-211-240.json | 112 +- stats/pwc-summary-241-270.json | 42 +- stats/pwc-summary-271-300.json | 44 +- stats/pwc-summary-31-60.json | 104 +- stats/pwc-summary-61-90.json | 130 +- stats/pwc-summary-91-120.json | 26 +- stats/pwc-summary.json | 1818 ++++++++++++------------ 52 files changed, 4361 insertions(+), 3443 deletions(-) create mode 100644 challenge-228/conor-hoekstra/apl/ch-1.apl create mode 100644 challenge-228/conor-hoekstra/bqn/ch-1.bqn delete mode 100644 challenge-228/conor-hoekstra/ch-01.apl delete mode 100644 challenge-228/conor-hoekstra/ch-01.bqn delete mode 100644 challenge-228/conor-hoekstra/ch-01.py delete mode 100644 challenge-228/conor-hoekstra/ch-01.rs create mode 100644 challenge-228/conor-hoekstra/python/ch-1.py create mode 100644 challenge-228/conor-hoekstra/rust/ch-1.rs create mode 100755 challenge-228/eric-cheung/python/ch-1.py create mode 100755 challenge-228/eric-cheung/python/ch-2.py create mode 100644 challenge-228/laurent-rosenfeld/blog.txt create mode 100644 challenge-228/laurent-rosenfeld/perl/ch-1.pl create mode 100644 challenge-228/laurent-rosenfeld/raku/ch-1.raku create mode 100755 challenge-228/perlboy1967/perl/ch-1.pl create mode 100755 challenge-228/perlboy1967/perl/ch-2.pl delete mode 100755 challenge-228/perlboy1967/perl/ch1.pl delete mode 100755 challenge-228/perlboy1967/perl/ch2.pl create mode 100644 challenge-228/robert-dicicco/julia/ch-1.jl create mode 100644 challenge-228/robert-dicicco/perl/ch-1.pl create mode 100644 challenge-228/robert-dicicco/raku/ch-1.raku create mode 100644 challenge-228/robert-dicicco/ruby/ch-1.rb delete mode 100644 challenge-228/steven-wilson/perl/ch-01.pl delete mode 100644 challenge-228/steven-wilson/perl/ch-02.pl create mode 100644 challenge-228/steven-wilson/perl/ch-1.pl create mode 100644 challenge-228/steven-wilson/perl/ch-2.pl create mode 100755 challenge-228/ulrich-rieke/cpp/ch-1.cpp create mode 100755 challenge-228/ulrich-rieke/cpp/ch-2.cpp create mode 100755 challenge-228/ulrich-rieke/haskell/ch-1.hs create mode 100755 challenge-228/ulrich-rieke/haskell/ch-2.hs create mode 100755 challenge-228/ulrich-rieke/perl/ch-1.pl create mode 100755 challenge-228/ulrich-rieke/perl/ch-2.pl create mode 100755 challenge-228/ulrich-rieke/raku/ch-1.raku create mode 100755 challenge-228/ulrich-rieke/raku/ch-2.raku create mode 100755 challenge-228/ulrich-rieke/rust/ch-1.rs create mode 100755 challenge-228/ulrich-rieke/rust/ch-2.rs create mode 100644 stats/pwc-challenge-227.json diff --git a/challenge-228/conor-hoekstra/apl/ch-1.apl b/challenge-228/conor-hoekstra/apl/ch-1.apl new file mode 100644 index 0000000000..ad2c531256 --- /dev/null +++ b/challenge-228/conor-hoekstra/apl/ch-1.apl @@ -0,0 +1,6 @@ +UniqueSum ← +/(∪×1=(+⌿⊢∘.=∪)) + +⍝ Tests +UniqueSum 2 1 3 2 ⍝ 4 +UniqueSum 1 1 1 1 ⍝ 0 +UniqueSum 1 2 3 4 ⍝ 10 diff --git a/challenge-228/conor-hoekstra/bqn/ch-1.bqn b/challenge-228/conor-hoekstra/bqn/ch-1.bqn new file mode 100644 index 0000000000..060ee089ec --- /dev/null +++ b/challenge-228/conor-hoekstra/bqn/ch-1.bqn @@ -0,0 +1,6 @@ +UniqueSum ← +´⍷×1=·+˝=⌜⟜⍷ + +# Tests +UniqueSum 2‿1‿3‿2 # 4 +UniqueSum 1‿1‿1‿1 # 0 +UniqueSum 1‿2‿3‿4 # 10 diff --git a/challenge-228/conor-hoekstra/ch-01.apl b/challenge-228/conor-hoekstra/ch-01.apl deleted file mode 100644 index ad2c531256..0000000000 --- a/challenge-228/conor-hoekstra/ch-01.apl +++ /dev/null @@ -1,6 +0,0 @@ -UniqueSum ← +/(∪×1=(+⌿⊢∘.=∪)) - -⍝ Tests -UniqueSum 2 1 3 2 ⍝ 4 -UniqueSum 1 1 1 1 ⍝ 0 -UniqueSum 1 2 3 4 ⍝ 10 diff --git a/challenge-228/conor-hoekstra/ch-01.bqn b/challenge-228/conor-hoekstra/ch-01.bqn deleted file mode 100644 index 060ee089ec..0000000000 --- a/challenge-228/conor-hoekstra/ch-01.bqn +++ /dev/null @@ -1,6 +0,0 @@ -UniqueSum ← +´⍷×1=·+˝=⌜⟜⍷ - -# Tests -UniqueSum 2‿1‿3‿2 # 4 -UniqueSum 1‿1‿1‿1 # 0 -UniqueSum 1‿2‿3‿4 # 10 diff --git a/challenge-228/conor-hoekstra/ch-01.py b/challenge-228/conor-hoekstra/ch-01.py deleted file mode 100644 index 28b58a09e6..0000000000 --- a/challenge-228/conor-hoekstra/ch-01.py +++ /dev/null @@ -1,7 +0,0 @@ -def unique_sum(nums): - return sum(k for k,v in Counter(nums).items() if v == 1) - -# Tests -unique_sum([2,1,3,2]) # 4 -unique_sum([1,1,1,1]) # 0 -unique_sum([2,1,3,4]) # 10 diff --git a/challenge-228/conor-hoekstra/ch-01.rs b/challenge-228/conor-hoekstra/ch-01.rs deleted file mode 100644 index be2eb5b2c2..0000000000 --- a/challenge-228/conor-hoekstra/ch-01.rs +++ /dev/null @@ -1,14 +0,0 @@ -fn unique_sum(nums: Vec) -> i32 { - nums.iter() - .counts() - .iter() - .map(|(k, v)| if v == &1 { k } else { &0 }) - .sum() -} - -// Tests -fn main() { - println!("{}", unique_sum(vec![2, 1, 3, 2])); // 4 - println!("{}", unique_sum(vec![1, 1, 1, 1])); // 0 - println!("{}", unique_sum(vec![2, 1, 3, 4])); // 10 -} diff --git a/challenge-228/conor-hoekstra/python/ch-1.py b/challenge-228/conor-hoekstra/python/ch-1.py new file mode 100644 index 0000000000..28b58a09e6 --- /dev/null +++ b/challenge-228/conor-hoekstra/python/ch-1.py @@ -0,0 +1,7 @@ +def unique_sum(nums): + return sum(k for k,v in Counter(nums).items() if v == 1) + +# Tests +unique_sum([2,1,3,2]) # 4 +unique_sum([1,1,1,1]) # 0 +unique_sum([2,1,3,4]) # 10 diff --git a/challenge-228/conor-hoekstra/rust/ch-1.rs b/challenge-228/conor-hoekstra/rust/ch-1.rs new file mode 100644 index 0000000000..be2eb5b2c2 --- /dev/null +++ b/challenge-228/conor-hoekstra/rust/ch-1.rs @@ -0,0 +1,14 @@ +fn unique_sum(nums: Vec) -> i32 { + nums.iter() + .counts() + .iter() + .map(|(k, v)| if v == &1 { k } else { &0 }) + .sum() +} + +// Tests +fn main() { + println!("{}", unique_sum(vec![2, 1, 3, 2])); // 4 + println!("{}", unique_sum(vec![1, 1, 1, 1])); // 0 + println!("{}", unique_sum(vec![2, 1, 3, 4])); // 10 +} diff --git a/challenge-228/eric-cheung/python/ch-1.py b/challenge-228/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..ae4d0ec1d9 --- /dev/null +++ b/challenge-228/eric-cheung/python/ch-1.py @@ -0,0 +1,8 @@ + +## arrInt = [2, 1, 3, 2] ## Example 1 +## arrInt = [1, 1, 1, 1] ## Example 2 +arrInt = [2, 1, 3, 4] ## Example 3 + +arrUniqInt = [nLoop for nLoop in list(set(arrInt)) if arrInt.count(nLoop) == 1] + +print (sum(arrUniqInt)) diff --git a/challenge-228/eric-cheung/python/ch-2.py b/challenge-228/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..6f74b418c1 --- /dev/null +++ b/challenge-228/eric-cheung/python/ch-2.py @@ -0,0 +1,13 @@ + +## arrInt = [3, 4, 2] ## Example 1 +arrInt = [1, 2, 3] ## Example 2 + +nCount = 0 + +while len(arrInt) > 0: + if arrInt[0] > min(arrInt): + arrInt.append(arrInt[0]) + del arrInt[0] + nCount = nCount + 1 + +print (nCount) diff --git a/challenge-228/laurent-rosenfeld/blog.txt b/challenge-228/laurent-rosenfeld/blog.txt new file mode 100644 index 0000000000..b441e51a67 --- /dev/null +++ b/challenge-228/laurent-rosenfeld/blog.txt @@ -0,0 +1 @@ +https://blogs.perl.org/users/laurent_r/2023/07/perl-weekly-challenge-228-unique-sum.html diff --git a/challenge-228/laurent-rosenfeld/perl/ch-1.pl b/challenge-228/laurent-rosenfeld/perl/ch-1.pl new file mode 100644 index 0000000000..d146cfeb85 --- /dev/null +++ b/challenge-228/laurent-rosenfeld/perl/ch-1.pl @@ -0,0 +1,17 @@ +use strict; +use warnings; +use feature 'say'; + +sub unique_sum { + my %histo; # histogram + $histo{$_}++ for @_; + my @unique = grep { $histo{$_} == 1 } keys %histo; + my $sum = 0; + $sum += $_ for @unique; + return $sum; +} + +for my $test ([2, 1, 3, 2], [1, 1, 1, 1], [2, 1, 3, 4]) { + printf "%-10s => ", "@$test"; + say unique_sum @$test; +} diff --git a/challenge-228/laurent-rosenfeld/raku/ch-1.raku b/challenge-228/laurent-rosenfeld/raku/ch-1.raku new file mode 100644 index 0000000000..5ed2411537 --- /dev/null +++ b/challenge-228/laurent-rosenfeld/raku/ch-1.raku @@ -0,0 +1,10 @@ +sub unique-sum (@in) { + my $histo = @in.Bag; # histogram + my @unique = grep { $histo{$_} == 1 }, $histo.keys; + return [+] @unique; +} + +for (2, 1, 3, 2), (1, 1, 1, 1), (2, 1, 3, 4) -> @test { + printf "%-10s => ", "@test[]"; + say unique-sum @test; +} diff --git a/challenge-228/perlboy1967/perl/ch-1.pl b/challenge-228/perlboy1967/perl/ch-1.pl new file mode 100755 index 0000000000..371fc09cc2 --- /dev/null +++ b/challenge-228/perlboy1967/perl/ch-1.pl @@ -0,0 +1,37 @@ +#!/bin/perl + +=pod + +The Weekly Challenge - 228 +- https://theweeklychallenge.org/blog/perl-weekly-challenge-228 + +Author: Niels 'PerlBoy' van Dijke + +Task 1: Unique Sum +Submitted by: Mohammad S Anwar + +You are given an array of integers. + +Write a script to find out the sum of unique elements in the given array. + +=cut + +use v5.16; + +use common::sense; + +use Test::More; + +use List::Util qw(sum0); +use List::MoreUtils qw(frequency); + +sub uniqueSum (@) { + my %f = frequency @_; + return sum0 grep { $f{$_} == 1 } keys %f; +} + +is(uniqueSum(2,1,3,2),4); +is(uniqueSum(1,1,1,1),0); +is(uniqueSum(2,1,3,4),10); + +done_testing; diff --git a/challenge-228/perlboy1967/perl/ch-2.pl b/challenge-228/perlboy1967/perl/ch-2.pl new file mode 100755 index 0000000000..0dd250f875 --- /dev/null +++ b/challenge-228/perlboy1967/perl/ch-2.pl @@ -0,0 +1,42 @@ +#!/bin/perl + +=pod + +The Weekly Challenge - 228 +- https://theweeklychallenge.org/blog/perl-weekly-challenge-228 + +Author: Niels 'PerlBoy' van Dijke + +Task 2: Empty Array +Submitted by: Mohammad S Anwar + +You are given an array of integers in which all elements are unique. + +Write a script to perform the following operations until the array is +empty and return the total count of operations. + +=cut + +use v5.16; + +use common::sense; + +use Test::More; + +use List::Util qw(min); + +sub emptyArray (@) { + my $n = 0; + + while (@_) { + my $v = shift @_; push(@_,$v) if (min(@_,$v) != $v); + $n++; + } + + return $n; +} + +is(emptyArray(3,4,2),5); +is(emptyArray(1,2,3),3); + +done_testing; diff --git a/challenge-228/perlboy1967/perl/ch1.pl b/challenge-228/perlboy1967/perl/ch1.pl deleted file mode 100755 index 371fc09cc2..0000000000 --- a/challenge-228/perlboy1967/perl/ch1.pl +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/perl - -=pod - -The Weekly Challenge - 228 -- https://theweeklychallenge.org/blog/perl-weekly-challenge-228 - -Author: Niels 'PerlBoy' van Dijke - -Task 1: Unique Sum -Submitted by: Mohammad S Anwar - -You are given an array of integers. - -Write a script to find out the sum of unique elements in the given array. - -=cut - -use v5.16; - -use common::sense; - -use Test::More; - -use List::Util qw(sum0); -use List::MoreUtils qw(frequency); - -sub uniqueSum (@) { - my %f = frequency @_; - return sum0 grep { $f{$_} == 1 } keys %f; -} - -is(uniqueSum(2,1,3,2),4); -is(uniqueSum(1,1,1,1),0); -is(uniqueSum(2,1,3,4),10); - -done_testing; diff --git a/challenge-228/perlboy1967/perl/ch2.pl b/challenge-228/perlboy1967/perl/ch2.pl deleted file mode 100755 index 0dd250f875..0000000000 --- a/challenge-228/perlboy1967/perl/ch2.pl +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/perl - -=pod - -The Weekly Challenge - 228 -- https://theweeklychallenge.org/blog/perl-weekly-challenge-228 - -Author: Niels 'PerlBoy' van Dijke - -Task 2: Empty Array -Submitted by: Mohammad S Anwar - -You are given an array of integers in which all elements are unique. - -Write a script to perform the following operations until the array is -empty and return the total count of operations. - -=cut - -use v5.16; - -use common::sense; - -use Test::More; - -use List::Util qw(min); - -sub emptyArray (@) { - my $n = 0; - - while (@_) { - my $v = shift @_; push(@_,$v) if (min(@_,$v) != $v); - $n++; - } - - return $n; -} - -is(emptyArray(3,4,2),5); -is(emptyArray(1,2,3),3); - -done_testing; diff --git a/challenge-228/robert-dicicco/julia/ch-1.jl b/challenge-228/robert-dicicco/julia/ch-1.jl new file mode 100644 index 0000000000..9a6e07a338 --- /dev/null +++ b/challenge-228/robert-dicicco/julia/ch-1.jl @@ -0,0 +1,68 @@ +#/usr/bin/env julia +#= +----------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-07-31 +Challenge 228 Task 1 Unique Sum ( Julia ) +----------------------------------------- +=# + +using Printf + +myints = [[2, 1, 3, 2],[1, 1, 1, 1],[2, 1, 3, 4]] + +hash = Dict() + +function CreateHash(h) + ln = length(h) + cnt = 1 + while cnt <= ln + hkey = h[cnt] + hash[hkey] = 0 + cnt += 1 + end + cnt = 1 + while cnt <= ln + hkey = h[cnt] + hash[hkey] += 1 + cnt += 1 + end +end + +function FindUniqueSum() + global hash + flag = 0 + sum = 0 + for (key, value) in hash + if hash[key] == 1 + sum += key + end + end + @printf("Output: %d\n\n",sum) +end + +for h in myints + global hash + @printf("Input: @int = %s\n", h) + CreateHash(h) + FindUniqueSum() + hash = Dict() +end + +#= +----------------------------------------- +SAMPLE OUTPUT +julia .\UniqueSum.jl + +Input: @int = [2, 1, 3, 2] +Output: 4 + +Input: @int = [1, 1, 1, 1] +Output: 0 + +Input: @int = [2, 1, 3, 4] +Output: 10 +----------------------------------------- +=# + + diff --git a/challenge-228/robert-dicicco/perl/ch-1.pl b/challenge-228/robert-dicicco/perl/ch-1.pl new file mode 100644 index 0000000000..a293e5f2a5 --- /dev/null +++ b/challenge-228/robert-dicicco/perl/ch-1.pl @@ -0,0 +1,62 @@ +#!/usr/bin/env perl +=begin commnt +----------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-07-31 +Challenge 228 Task 1 Unique Sum ( Perl ) +----------------------------------------- +=cut +use v5.38; + +my %hash; + +my @ints = ([2, 1, 3, 2],[1, 1, 1, 1],[2, 1, 3, 4]); + +sub CreateHashValues($h) { + %hash = (); + my $ln = scalar(@$h); + my $cnt = 0; + while ($cnt < scalar @$h) { + if(! exists $hash{$h->[$cnt]}) { + $hash{$h->[$cnt]} = 1; + } else { + $hash{$h->[$cnt]}++; + } + $cnt++; + } +} + + +sub FindUniqueSum() { + my $flag = 0; + my $sum = 0; + for my $key (keys %hash) { + $sum += $key if ($hash{$key} == 1); + } + say "Output: ",$sum,"\n"; + %hash = (); +} + +for my $x (@ints) { + say "Input: \@int = [@$x]"; + CreateHashValues(\@$x); + FindUniqueSum; + } + +=begin commnt +----------------------------------------- +SAMPLE OUTPUT +perl .\UniqueSum.pl + +Input: @int = [2 1 3 2] +Output: 4 + +Input: @int = [1 1 1 1] +Output: 0 + +Input: @int = [2 1 3 4] +Output: 10 +----------------------------------------- +=cut + + diff --git a/challenge-228/robert-dicicco/raku/ch-1.raku b/challenge-228/robert-dicicco/raku/ch-1.raku new file mode 100644 index 0000000000..79f4c88bc1 --- /dev/null +++ b/challenge-228/robert-dicicco/raku/ch-1.raku @@ -0,0 +1,57 @@ +#!/usr/bin/env raku +=begin comment +----------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-07-31 +Challenge 228 Task 1 Unique Sum ( Raku ) +----------------------------------------- +=end comment +use v6; + +my %hash; + +my @ints = ([2, 1, 3, 2],[1, 1, 1, 1],[2, 1, 3, 4]); + +sub CreateHashValues(@h) { + %hash = (); + my $ln = @h.elems; + my $cnt = 0; + while $cnt < $ln { + %hash{@h[$cnt]} += 1; + $cnt++; + } +} + +sub FindUniqueSum() { + my $flag = 0; + my $sum = 0; + for (keys %hash) -> $key { + $sum += $key if (%hash{$key} == 1); + } + say "Output: ",$sum,"\n"; + %hash = (); +} + +for (@ints) -> @h { + say "Input: \@int = ",@h; + CreateHashValues(@h); + FindUniqueSum(); +} + +=begin comment +----------------------------------------- +SAMPLE OUTPUT +raku .\UniqueSum.rk + +Input: @int = [2 1 3 2] +Output: 4 + +Input: @int = [1 1 1 1] +Output: 0 + +Input: @int = [2 1 3 4] +Output: 10 +----------------------------------------- +=end comment + + diff --git a/challenge-228/robert-dicicco/ruby/ch-1.rb b/challenge-228/robert-dicicco/ruby/ch-1.rb new file mode 100644 index 0000000000..2dbabf2dcf --- /dev/null +++ b/challenge-228/robert-dicicco/ruby/ch-1.rb @@ -0,0 +1,63 @@ +#!/usr/bin/env ruby +=begin +----------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-07-31 +Challenge 228 Task 1 Unique Sum ( Ruby ) +----------------------------------------- +=end + +myints = [[2, 1, 3, 2],[1, 1, 1, 1],[2, 1, 3, 4]] + +$hash = Hash.new + +def CreateHash(h) + $hash.clear() + ln = h.length() + cnt = 0 + while cnt < ln + hkey = h[cnt] + $hash[hkey] = 0 + cnt += 1 + end + cnt = 0 + while cnt < ln + hkey = h[cnt] + $hash[hkey] += 1 + cnt += 1 + end +end + +def FindUniqueSum() + flag = 0 + sum = 0; + $hash.each do |key,value| + sum += key if $hash[key] == 1 + end + puts("Output: #{sum}\n\n"); +end + + +myints.each do |h| + puts("Input: @int = #{h}") + CreateHash(h) + FindUniqueSum() +end + +=begin +----------------------------------------- +SAMPLE OUTPUT +ruby .\UniqueSum.rb + +Input: @int = [2, 1, 3, 2] +Output: 4 + +Input: @int = [1, 1, 1, 1] +Output: 0 + +Input: @int = [2, 1, 3, 4] +Output: 10 +----------------------------------------- +=end + + diff --git a/challenge-228/steven-wilson/perl/ch-01.pl b/challenge-228/steven-wilson/perl/ch-01.pl deleted file mode 100644 index dae4b4e6ba..0000000000 --- a/challenge-228/steven-wilson/perl/ch-01.pl +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env perl - -use 5.12.0; -use Test::More; - -cmp_ok( sum_unique( ( 2, 1, 3, 2 ) ), '==', 4, "2 unique elements" ); -cmp_ok( sum_unique( ( 1, 1, 1, 1 ) ), '==', 0, "0 unique elements" ); -cmp_ok( sum_unique( ( 2, 1, 3, 4 ) ), '==', 10, "all elements unique" ); -done_testing(); - -sub sum_unique { - my @elements = @_; - my %element_count; - my $sum = 0; - for (@elements) { - $element_count{$_}++; - } - for ( keys %element_count ) { - if ( $element_count{$_} == 1 ) { - $sum += $_; - } - } - return $sum; -} diff --git a/challenge-228/steven-wilson/perl/ch-02.pl b/challenge-228/steven-wilson/perl/ch-02.pl deleted file mode 100644 index 17b0e0689e..0000000000 --- a/challenge-228/steven-wilson/perl/ch-02.pl +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env perl - -use 5.12.0; -use List::Util qw / min /; -use Test::More; - -cmp_ok( empty_array( ( 3, 4, 2 ) ), '==', 5, "array out of order" ); -cmp_ok( empty_array( ( 1, 2, 3 ) ), '==', 3, "array accending order" ); -cmp_ok( empty_array( () ), '==', 0, "array empty" ); -done_testing(); - -sub empty_array { - my @elements = @_; - my $ops = 0; - while (@elements) { - if ( min(@elements) == $elements[0] ) { - shift @elements; - } - else { - my $element = shift @elements; - push @elements, $element; - } - $ops++; - } - return $ops; -} diff --git a/challenge-228/steven-wilson/perl/ch-1.pl b/challenge-228/steven-wilson/perl/ch-1.pl new file mode 100644 index 0000000000..dae4b4e6ba --- /dev/null +++ b/challenge-228/steven-wilson/perl/ch-1.pl @@ -0,0 +1,24 @@ +#!/usr/bin/env perl + +use 5.12.0; +use Test::More; + +cmp_ok( sum_unique( ( 2, 1, 3, 2 ) ), '==', 4, "2 unique elements" ); +cmp_ok( sum_unique( ( 1, 1, 1, 1 ) ), '==', 0, "0 unique elements" ); +cmp_ok( sum_unique( ( 2, 1, 3, 4 ) ), '==', 10, "all elements unique" ); +done_testing(); + +sub sum_unique { + my @elements = @_; + my %element_count; + my $sum = 0; + for (@elements) { + $element_count{$_}++; + } + for ( keys %element_count ) { + if ( $element_count{$_} == 1 ) { + $sum += $_; + } + } + return $sum; +} diff --git a/challenge-228/steven-wilson/perl/ch-2.pl b/challenge-228/steven-wilson/perl/ch-2.pl new file mode 100644 index 0000000000..17b0e0689e --- /dev/null +++ b/challenge-228/steven-wilson/perl/ch-2.pl @@ -0,0 +1,26 @@ +#!/usr/bin/env perl + +use 5.12.0; +use List::Util qw / min /; +use Test::More; + +cmp_ok( empty_array( ( 3, 4, 2 ) ), '==', 5, "array out of order" ); +cmp_ok( empty_array( ( 1, 2, 3 ) ), '==', 3, "array accending order" ); +cmp_ok( empty_array( () ), '==', 0, "array empty" ); +done_testing(); + +sub empty_array { + my @elements = @_; + my $ops = 0; + while (@elements) { + if ( min(@elements) == $elements[0] ) { + shift @elements; + } + else { + my $element = shift @elements; + push @elements, $element; + } + $ops++; + } + return $ops; +} diff --git a/challenge-228/ulrich-rieke/cpp/ch-1.cpp b/challenge-228/ulrich-rieke/cpp/ch-1.cpp new file mode 100755 index 0000000000..106d4ee20f --- /dev/null +++ b/challenge-228/ulrich-rieke/cpp/ch-1.cpp @@ -0,0 +1,35 @@ +#include +#include +#include +#include +#include + +std::vector split( const std::string & startline , + const std::string & sep ) { + std::vector separated ; + std::string::size_type start { 0 } ; + std::string::size_type pos ; + do { + pos = startline.find_first_of( sep , start ) ; + separated.push_back( startline.substr(start , pos - start )) ; + start = pos + 1 ; + } while ( pos != std::string::npos ) ; + return separated ; +} + +int main( ) { + std::cout << "Enter some integers, separated by blanks!\n" ; + std::string line ; + std::getline( std::cin , line ) ; + std::vector numberstrings ( split( line , " " ) ) ; + std::vector numbers ; + for ( auto s : numberstrings ) + numbers.push_back( std::stoi( s ) ) ; + std::vector uniques ; + for ( int i : numbers ) { + if ( std::count( numbers.begin( ) , numbers.end( ) , i ) == 1 ) + uniques.push_back( i ) ; + } + std::cout << std::accumulate( uniques.begin( ) , uniques.end( ) , 0 ) << std::endl ; + return 0 ; +} diff --git a/challenge-228/ulrich-rieke/cpp/ch-2.cpp b/challenge-228/ulrich-rieke/cpp/ch-2.cpp new file mode 100755 index 0000000000..8b228dff22 --- /dev/null +++ b/challenge-228/ulrich-rieke/cpp/ch-2.cpp @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include + +std::vector split( const std::string & startline , + const std::string & sep ) { + std::vector separated ; + std::string::size_type start { 0 } ; + std::string::size_type pos ; + do { + pos = startline.find_first_of( sep , start ) ; + separated.push_back( startline.substr(start , pos - start )) ; + start = pos + 1 ; + } while ( pos != std::string::npos ) ; + return separated ; +} + +int main( ) { + std::cout << "Enter some unique integers, separated by blanks!\n" ; + std::string line ; + std::getline( std::cin , line ) ; + std::vector numberstrings ( split ( line , " " ) ) ; + std::list numbers ; + for ( auto s : numberstrings ) + numbers.push_back( std::stoi( s ) ) ; + int rounds = 0 ; + while ( numbers.size( ) > 0 ) { + //look for the smallest element + int mini = *std::min_element( numbers.begin( ) , numbers.end( ) ) ; + auto pos = std::find( numbers.begin( ) , numbers.end( ) , mini ) ; + if ( pos == numbers.begin( ) ) //if the smallest element is at the start + //of list numbers + numbers.remove( mini ) ; //remove it + else { + int first = *numbers.begin( ) ; //save the first element + numbers.pop_front( ) ; + numbers.push_back( first ) ; //and push it at the end of the vector + } + rounds++ ; + } + std::cout << rounds << std::endl ; + return 0 ; +} diff --git a/challenge-228/ulrich-rieke/haskell/ch-1.hs b/challenge-228/ulrich-rieke/haskell/ch-1.hs new file mode 100755 index 0000000000..9acf9b4a89 --- /dev/null +++ b/challenge-228/ulrich-rieke/haskell/ch-1.hs @@ -0,0 +1,8 @@ +module Challenge228 + where + +count :: Eq a => [a] -> a -> Int +count list element = length $ filter ( == element ) list + +solution :: [Int] -> Int +solution list = sum $ filter ( (== 1 ) . count list ) list diff --git a/challenge-228/ulrich-rieke/haskell/ch-2.hs b/challenge-228/ulrich-rieke/haskell/ch-2.hs new file mode 100755 index 0000000000..df2f53c9a1 --- /dev/null +++ b/challenge-228/ulrich-rieke/haskell/ch-2.hs @@ -0,0 +1,21 @@ +module Challenge228_2 + where +import Data.List ( findIndex ) + +solution :: [Int] -> Int +solution list = fst $ until ( null . snd ) step (0 , list) + where + step :: (Int , [Int]) -> (Int , [Int] ) + step ( aNum , aList ) = (aNum + 1 , if (findIndex ( == mini ) aList ) == Just 0 + then tail aList else tail aList ++ [head aList] ) + where + mini :: Int + mini = minimum aList + +main :: IO ( ) +main = do + putStrLn "Enter some unique integers, separated by blanks!" + numberstrings <- getLine + let numbers = map read $ words numberstrings + print $ solution numbers + diff --git a/challenge-228/ulrich-rieke/perl/ch-1.pl b/challenge-228/ulrich-rieke/perl/ch-1.pl new file mode 100755 index 0000000000..ece4f0898e --- /dev/null +++ b/challenge-228/ulrich-rieke/perl/ch-1.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; +use List::Util qw ( sum ) ; + +sub count { + my $haystack = shift ; + my $needle = shift ; + return scalar( grep { $_ == $needle } @$haystack ) ; +} + +say "Enter some integers, separated by blanks!" ; +my $line = ; +chomp $line ; +my @numbers = split( /\s/ , $line ) ; +my @selected = grep { count( \@numbers , $_ ) == 1 } @numbers ; +if ( @selected ) { + say sum( @selected ) ; +} +else { + say 0 ; +} diff --git a/challenge-228/ulrich-rieke/perl/ch-2.pl b/challenge-228/ulrich-rieke/perl/ch-2.pl new file mode 100755 index 0000000000..2851712f59 --- /dev/null +++ b/challenge-228/ulrich-rieke/perl/ch-2.pl @@ -0,0 +1,34 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; +use List::Util qw ( min ) ; + +sub findIndex { + my $array = shift ; + my $needle = shift ; + my $pos = 0 ; + while ( $array->[$pos] != $needle ) { + $pos++ ; + } + return $pos ; +} + +say "Enter some unique integers, separated by blanks!" ; +my $line = ; +chomp $line ; +my @numbers = split( /\s/ , $line ) ; +my $rounds = 0 ; +while ( scalar( @numbers ) > 0 ) { + my $mini = min( @numbers ) ; + my $pos = findIndex( \@numbers , $mini ) ; + my $num = shift @numbers ; + if ( $pos == 0 ) { + } + else { + push @numbers , $num ; + } + $rounds++ ; +} +say $rounds ; + diff --git a/challenge-228/ulrich-rieke/raku/ch-1.raku b/challenge-228/ulrich-rieke/raku/ch-1.raku new file mode 100755 index 0000000000..4e9720bb55 --- /dev/null +++ b/challenge-228/ulrich-rieke/raku/ch-1.raku @@ -0,0 +1,10 @@ +use v6 ; + +sub count( @haystack , $needle ) { + return @haystack.grep( { $_ == $needle} ).elems ; +} + +say "Enter some integers, separated by blanks!" ; +my $line = $*IN.get ; +my @numbers = $line.words.map( {.Int} ) ; +say @numbers.grep( { count( @numbers , $_ ) == 1 } ).sum ; diff --git a/challenge-228/ulrich-rieke/raku/ch-2.raku b/challenge-228/ulrich-rieke/raku/ch-2.raku new file mode 100755 index 0000000000..9a850028c0 --- /dev/null +++ b/challenge-228/ulrich-rieke/raku/ch-2.raku @@ -0,0 +1,27 @@ +use v6 ; + +sub findIndex( @array , $needle ) { + my $pos = 0 ; + while ( @array[ $pos ] != $needle ) { + $pos++ ; + } + return $pos ; +} + +say "Enter some unique integers, separated by blanks!" ; +my $line = $*IN.get ; +my @numbers = $line.words.map( {.Int} ) ; +my $rounds = 0 ; +while ( @numbers.elems > 0 ) { + my $mini = @numbers.min( ) ; + my $pos = findIndex( @numbers , $mini ) ; + my $num = @numbers.shift ; + if ( $pos == 0 ) { + } + else { + @numbers.push( $num ) ; + } + $rounds++ ; +} +say $rounds ; + diff --git a/challenge-228/ulrich-rieke/rust/ch-1.rs b/challenge-228/ulrich-rieke/rust/ch-1.rs new file mode 100755 index 0000000000..defc88b5bf --- /dev/null +++ b/challenge-228/ulrich-rieke/rust/ch-1.rs @@ -0,0 +1,23 @@ +use std::io ; + +fn main() { + println!("Enter some unique integers, separated by blanks!"); + let mut inline : String = String::new( ) ; + io::stdin( ).read_line( &mut inline ).unwrap( ) ; + let entered_line : &str = &*inline ; + let mut numbers : Vec = entered_line.split_whitespace( ).map( | s | + s.trim( ).parse::( ).unwrap( ) ).collect( ) ; + let mut rounds : usize = 0 ; + while numbers.len( ) > 0 { + let mini : i32 = *numbers.iter( ).min( ).unwrap( ) ; + let pos : usize = numbers.iter( ).position( | d | *d == mini ).unwrap( ) ; + let i : i32 = numbers.remove( 0 ) ; + if pos == 0 { + } + else { + numbers.push( i ) ; + } + rounds += 1 ; + } + println!("{}" , rounds ) ; +} diff --git a/challenge-228/ulrich-rieke/rust/ch-2.rs b/challenge-228/ulrich-rieke/rust/ch-2.rs new file mode 100755 index 0000000000..defc88b5bf --- /dev/null +++ b/challenge-228/ulrich-rieke/rust/ch-2.rs @@ -0,0 +1,23 @@ +use std::io ; + +fn main() { + println!("Enter some unique integers, separated by blanks!"); + let mut inline : String = String::new( ) ; + io::stdin( ).read_line( &mut inline ).unwrap( ) ; + let entered_line : &str = &*inline ; + let mut numbers : Vec = entered_line.split_whitespace( ).map( | s | + s.trim( ).parse::( ).unwrap( ) ).collect( ) ; + let mut rounds : usize = 0 ; + while numbers.len( ) > 0 { + let mini : i32 = *numbers.iter( ).min( ).unwrap( ) ; + let pos : usize = numbers.iter( ).position( | d | *d == mini ).unwrap( ) ; + let i : i32 = numbers.remove( 0 ) ; + if pos == 0 { + } + else { + numbers.push( i ) ; + } + rounds += 1 ; + } + println!("{}" , rounds ) ; +} diff --git a/stats/pwc-challenge-211.json b/stats/pwc-challenge-211.json index f4596b5134..b76b68d8a8 100644 --- a/stats/pwc-challenge-211.json +++ b/stats/pwc-challenge-211.json @@ -1,45 +1,56 @@ { - "subtitle" : { - "text" : "[Champions: 38] Last updated at 2023-05-04 08:21:29 GMT" + "xAxis" : { + "type" : "category" }, - "chart" : { - "type" : "column" + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } }, - "title" : { - "text" : "The Weekly Challenge - 211" + "subtitle" : { + "text" : "[Champions: 39] Last updated at 2023-07-31 23:22:30 GMT" + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 + } }, "series" : [ { "data" : [ { "name" : "Arne Sommer", - "drilldown" : "Arne Sommer", - "y" : 3 + "y" : 3, + "drilldown" : "Arne Sommer" }, { + "name" : "Athanasius", "y" : 4, - "drilldown" : "Athanasius", - "name" : "Athanasius" + "drilldown" : "Athanasius" }, { - "y" : 3, + "name" : "Avery Adams", "drilldown" : "Avery Adams", - "name" : "Avery Adams" + "y" : 3 }, { "y" : 2, - "name" : "BarrOff", - "drilldown" : "BarrOff" + "drilldown" : "BarrOff", + "name" : "BarrOff" }, { - "y" : 3, "name" : "Bob Lied", + "y" : 3, "drilldown" : "Bob Lied" }, { - "name" : "Bruce Gray", "drilldown" : "Bruce Gray", - "y" : 2 + "y" : 2, + "name" : "Bruce Gray" }, { "y" : 2, @@ -47,9 +58,14 @@ "name" : "Carlos Oliveira" }, { + "y" : 2, "drilldown" : "Cheok-Yin Fung", - "name" : "Cheok-Yin Fung", - "y" : 2 + "name" : "Cheok-Yin Fung" + }, + { + "y" : 2, + "drilldown" : "Dave Jacoby", + "name" : "Dave Jacoby" }, { "y" : 2, @@ -57,14 +73,14 @@ "name" : "David Ferrone" }, { - "y" : 2, + "name" : "Duncan C. White", "drilldown" : "Duncan C. White", - "name" : "Duncan C. White" + "y" : 2 }, { + "drilldown" : "E. Choroba", "y" : 2, - "name" : "E. Choroba", - "drilldown" : "E. Choroba" + "name" : "E. Choroba" }, { "name" : "Feng Chang", @@ -72,33 +88,33 @@ "y" : 2 }, { + "drilldown" : "Flavio Poletti", "y" : 6, - "name" : "Flavio Poletti", - "drilldown" : "Flavio Poletti" + "name" : "Flavio Poletti" }, { - "drilldown" : "Jaldhar H. Vyas", "name" : "Jaldhar H. Vyas", + "drilldown" : "Jaldhar H. Vyas", "y" : 5 }, { "y" : 3, - "name" : "James Smith", - "drilldown" : "James Smith" + "drilldown" : "James Smith", + "name" : "James Smith" }, { - "y" : 2, "drilldown" : "Jan Krnavek", + "y" : 2, "name" : "Jan Krnavek" }, { + "name" : "Jorg Sommrey", "y" : 2, - "drilldown" : "Jorg Sommrey", - "name" : "Jorg Sommrey" + "drilldown" : "Jorg Sommrey" }, { - "y" : 5, "drilldown" : "Laurent Rosenfeld", + "y" : 5, "name" : "Laurent Rosenfeld" }, { @@ -107,63 +123,63 @@ "name" : "Leo Manfredi" }, { - "drilldown" : "Lubos Kolouch", "name" : "Lubos Kolouch", - "y" : 2 + "y" : 2, + "drilldown" : "Lubos Kolouch" }, { "y" : 8, - "name" : "Luca Ferrari", - "drilldown" : "Luca Ferrari" + "drilldown" : "Luca Ferrari", + "name" : "Luca Ferrari" }, { "drilldown" : "Mariano Spadaccini", - "name" : "Mariano Spadaccini", - "y" : 1 + "y" : 1, + "name" : "Mariano Spadaccini" }, { + "name" : "Mark Anderson", "y" : 2, - "drilldown" : "Mark Anderson", - "name" : "Mark Anderson" + "drilldown" : "Mark Anderson" }, { - "y" : 1, "drilldown" : "Matthew Neleigh", + "y" : 1, "name" : "Matthew Neleigh" }, { - "drilldown" : "Matthias Muth", "name" : "Matthias Muth", - "y" : 2 + "y" : 2, + "drilldown" : "Matthias Muth" }, { - "y" : 2, "name" : "Paulo Custodio", - "drilldown" : "Paulo Custodio" + "drilldown" : "Paulo Custodio", + "y" : 2 }, { "y" : 3, - "name" : "Peter Campbell Smith", - "drilldown" : "Peter Campbell Smith" + "drilldown" : "Peter Campbell Smith", + "name" : "Peter Campbell Smith" }, { - "y" : 2, "drilldown" : "Peter Meszaros", + "y" : 2, "name" : "Peter Meszaros" }, { - "y" : 4, "drilldown" : "Pip Stuart", + "y" : 4, "name" : "Pip Stuart" }, { - "y" : 3, "name" : "Robbie Hatley", - "drilldown" : "Robbie Hatley" + "drilldown" : "Robbie Hatley", + "y" : 3 }, { - "y" : 4, "name" : "Robert DiCicco", + "y" : 4, "drilldown" : "Robert DiCicco" }, { @@ -177,63 +193,51 @@ "y" : 5 }, { - "name" : "Simon Green", + "y" : 3, "drilldown" : "Simon Green", - "y" : 3 + "name" : "Simon Green" }, { - "y" : 2, + "name" : "Solathian", "drilldown" : "Solathian", - "name" : "Solathian" + "y" : 2 }, { + "drilldown" : "Thomas Kohler", "y" : 4, - "name" : "Thomas Kohler", - "drilldown" : "Thomas Kohler" + "name" : "Thomas Kohler" }, { - "drilldown" : "Ulrich Rieke", "name" : "Ulrich Rieke", - "y" : 3 + "y" : 3, + "drilldown" : "Ulrich Rieke" }, { + "drilldown" : "W. Luis Mochan", "y" : 3, - "name" : "W. Luis Mochan", - "drilldown" : "W. Luis Mochan" + "name" : "W. Luis Mochan" } ], - "colorByPoint" : 1, - "name" : "The Weekly Challenge - 211" + "name" : "The Weekly Challenge - 211", + "colorByPoint" : 1 } ], - "legend" : { - "enabled" : 0 - }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - }, - "borderWidth" : 0 - } + "chart" : { + "type" : "column" }, "tooltip" : { - "headerFormat" : "{series.name}
", + "pointFormat" : "{point.name}: {point.y:f}
", "followPointer" : 1, - "pointFormat" : "{point.name}: {point.y:f}
" - }, - "xAxis" : { - "type" : "category" + "headerFormat" : "{series.name}
" }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } + "title" : { + "text" : "The Weekly Challenge - 211" }, "drilldown" : { "series" : [ { + "id" : "Arne Sommer", + "name" : "Arne Sommer", "data" : [ [ "Raku", @@ -243,12 +247,9 @@ "Blog", 1 ] - ], - "name" : "Arne Sommer", - "id" : "Arne Sommer" + ] }, { - "id" : "Athanasius", "name" : "Athanasius", "data" : [ [ @@ -259,7 +260,8 @@ "Raku", 2 ] - ] + ], + "id" : "Athanasius" }, { "id" : "Avery Adams", @@ -276,16 +278,17 @@ ] }, { - "name" : "BarrOff", - "id" : "BarrOff", "data" : [ [ "Raku", 2 ] - ] + ], + "name" : "BarrOff", + "id" : "BarrOff" }, { + "name" : "Bob Lied", "data" : [ [ "Perl", @@ -296,12 +299,11 @@ 1 ] ], - "id" : "Bob Lied", - "name" : "Bob Lied" + "id" : "Bob Lied" }, { - "name" : "Bruce Gray", "id" : "Bruce Gray", + "name" : "Bruce Gray", "data" : [ [ "Raku", @@ -310,34 +312,34 @@ ] }, { + "id" : "Carlos Oliveira", "data" : [ [ "Perl", 2 ] ], - "name" : "Carlos Oliveira", - "id" : "Carlos Oliveira" + "name" : "Carlos Oliveira" }, { - "id" : "Cheok-Yin Fung", "name" : "Cheok-Yin Fung", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Cheok-Yin Fung" }, { - "name" : "David Ferrone", - "id" : "David Ferrone", + "id" : "Dave Jacoby", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Dave Jacoby" }, { "data" : [ @@ -346,22 +348,32 @@ 2 ] ], + "name" : "David Ferrone", + "id" : "David Ferrone" + }, + { + "id" : "Duncan C. White", "name" : "Duncan C. White", - "id" : "Duncan C. White" + "data" : [ + [ + "Perl", + 2 + ] + ] }, { + "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] ], - "id" : "E. Choroba", "name" : "E. Choroba" }, { - "name" : "Feng Chang", "id" : "Feng Chang", + "name" : "Feng Chang", "data" : [ [ "Raku", @@ -370,7 +382,6 @@ ] }, { - "name" : "Flavio Poletti", "id" : "Flavio Poletti", "data" : [ [ @@ -385,11 +396,10 @@ "Blog", 2 ] - ] + ], + "name" : "Flavio Poletti" }, { - "id" : "Jaldhar H. Vyas", - "name" : "Jaldhar H. Vyas", "data" : [ [ "Perl", @@ -403,11 +413,11 @@ "Blog", 1 ] - ] + ], + "name" : "Jaldhar H. Vyas", + "id" : "Jaldhar H. Vyas" }, { - "name" : "James Smith", - "id" : "James Smith", "data" : [ [ "Perl", @@ -417,17 +427,19 @@ "Blog", 1 ] - ] + ], + "name" : "James Smith", + "id" : "James Smith" }, { - "name" : "Jan Krnavek", "id" : "Jan Krnavek", "data" : [ [ "Raku", 2 ] - ] + ], + "name" : "Jan Krnavek" }, { "data" : [ @@ -440,8 +452,8 @@ "id" : "Jorg Sommrey" }, { - "name" : "Laurent Rosenfeld", "id" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -458,26 +470,27 @@ ] }, { - "id" : "Leo Manfredi", "name" : "Leo Manfredi", "data" : [ [ "Perl", 1 ] - ] + ], + "id" : "Leo Manfredi" }, { + "id" : "Lubos Kolouch", "data" : [ [ "Perl", 2 ] ], - "name" : "Lubos Kolouch", - "id" : "Lubos Kolouch" + "name" : "Lubos Kolouch" }, { + "id" : "Luca Ferrari", "data" : [ [ "Raku", @@ -488,62 +501,59 @@ 6 ] ], - "name" : "Luca Ferrari", - "id" : "Luca Ferrari" + "name" : "Luca Ferrari" }, { + "name" : "Mariano Spadaccini", "data" : [ [ "Perl", 1 ] ], - "name" : "Mariano Spadaccini", "id" : "Mariano Spadaccini" }, { + "id" : "Mark Anderson", "data" : [ [ "Raku", 2 ] ], - "id" : "Mark Anderson", "name" : "Mark Anderson" }, { - "id" : "Matthew Neleigh", - "name" : "Matthew Neleigh", "data" : [ [ "Perl", 1 ] - ] + ], + "name" : "Matthew Neleigh", + "id" : "Matthew Neleigh" }, { "id" : "Matthias Muth", - "name" : "Matthias Muth", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Matthias Muth" }, { - "name" : "Paulo Custodio", "id" : "Paulo Custodio", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Paulo Custodio" }, { - "name" : "Peter Campbell Smith", - "id" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -553,7 +563,9 @@ "Blog", 1 ] - ] + ], + "name" : "Peter Campbell Smith", + "id" : "Peter Campbell Smith" }, { "data" : [ @@ -566,7 +578,6 @@ "id" : "Peter Meszaros" }, { - "name" : "Pip Stuart", "id" : "Pip Stuart", "data" : [ [ @@ -577,10 +588,10 @@ "Raku", 2 ] - ] + ], + "name" : "Pip Stuart" }, { - "id" : "Robbie Hatley", "name" : "Robbie Hatley", "data" : [ [ @@ -591,7 +602,8 @@ "Blog", 1 ] - ] + ], + "id" : "Robbie Hatley" }, { "data" : [ @@ -604,18 +616,18 @@ 2 ] ], - "id" : "Robert DiCicco", - "name" : "Robert DiCicco" + "name" : "Robert DiCicco", + "id" : "Robert DiCicco" }, { + "name" : "Robert Ransbottom", "data" : [ [ "Raku", 2 ] ], - "id" : "Robert Ransbottom", - "name" : "Robert Ransbottom" + "id" : "Robert Ransbottom" }, { "id" : "Roger Bell_West", @@ -636,8 +648,6 @@ ] }, { - "name" : "Simon Green", - "id" : "Simon Green", "data" : [ [ "Perl", @@ -647,19 +657,22 @@ "Blog", 1 ] - ] + ], + "name" : "Simon Green", + "id" : "Simon Green" }, { + "name" : "Solathian", "data" : [ [ "Perl", 2 ] ], - "name" : "Solathian", "id" : "Solathian" }, { + "id" : "Thomas Kohler", "data" : [ [ "Perl", @@ -670,10 +683,11 @@ 2 ] ], - "id" : "Thomas Kohler", "name" : "Thomas Kohler" }, { + "id" : "Ulrich Rieke", + "name" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -683,12 +697,9 @@ "Raku", 1 ] - ], - "name" : "Ulrich Rieke", - "id" : "Ulrich Rieke" + ] }, { - "name" : "W. Luis Mochan", "id" : "W. Luis Mochan", "data" : [ [ @@ -699,8 +710,12 @@ "Blog", 1 ] - ] + ], + "name" : "W. Luis Mochan" } ] + }, + "legend" : { + "enabled" : 0 } } diff --git a/stats/pwc-challenge-227.json b/stats/pwc-challenge-227.json new file mode 100644 index 0000000000..b5ce5528e9 --- /dev/null +++ b/stats/pwc-challenge-227.json @@ -0,0 +1,718 @@ +{ + "legend" : { + "enabled" : 0 + }, + "tooltip" : { + "headerFormat" : "{series.name}
", + "followPointer" : 1, + "pointFormat" : "{point.name}: {point.y:f}
" + }, + "drilldown" : { + "series" : [ + { + "name" : "Ali Moradi", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Ali Moradi" + }, + { + "id" : "Andreas Voegele", + "name" : "Andreas Voegele", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "id" : "Andrew Shitov", + "name" : "Andrew Shitov", + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ] + }, + { + "id" : "Arne Sommer", + "name" : "Arne Sommer", + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "name" : "Athanasius", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "id" : "Athanasius" + }, + { + "name" : "Avery Adams", + "data" : [ + [ + "Perl", + 1 + ] + ], + "id" : "Avery Adams" + }, + { + "id" : "BarrOff", + "name" : "BarrOff", + "data" : [ + [ + "Raku", + 1 + ] + ] + }, + { + "id" : "Bruce Gray", + "name" : "Bruce Gray", + "data" : [ + [ + "Raku", + 2 + ] + ] + }, + { + "name" : "Cheok-Yin Fung", + "data" : [ + [ + "Perl", + 1 + ] + ], + "id" : "Cheok-Yin Fung" + }, + { + "id" : "Dave Jacoby", + "name" : "Dave Jacoby", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "id" : "David Ferrone", + "name" : "David Ferrone", + "data" : [ + [ + "Perl", + 1 + ] + ] + }, + { + "id" : "E. Choroba", + "name" : "E. Choroba", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "id" : "Flavio Poletti", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ], + "name" : "Flavio Poletti" + }, + { + "id" : "Jaldhar H. Vyas", + "name" : "Jaldhar H. Vyas", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "data" : [ + [ + "Raku", + 1 + ] + ], + "name" : "Jan Krnavek", + "id" : "Jan Krnavek" + }, + { + "id" : "Jorg Sommrey", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Jorg Sommrey" + }, + { + "id" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ] + }, + { + "id" : "Lubos Kolouch", + "name" : "Lubos Kolouch", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "id" : "Luca Ferrari", + "name" : "Luca Ferrari", + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 6 + ] + ] + }, + { + "id" : "Mark Anderson", + "name" : "Mark Anderson", + "data" : [ + [ + "Raku", + 2 + ] + ] + }, + { + "id" : "Matthew Neleigh", + "name" : "Matthew Neleigh", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "id" : "Matthias Muth", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Matthias Muth" + }, + { + "id" : "Niels van Dijke", + "name" : "Niels van Dijke", + "data" : [ + [ + "Perl", + 1 + ] + ] + }, + { + "name" : "Packy Anderson", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Packy Anderson" + }, + { + "name" : "Peter Campbell Smith", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Peter Campbell Smith" + }, + { + "id" : "Peter Meszaros", + "name" : "Peter Meszaros", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "id" : "Robbie Hatley", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Robbie Hatley" + }, + { + "name" : "Robert DiCicco", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "id" : "Robert DiCicco" + }, + { + "name" : "Robert Ransbottom", + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Robert Ransbottom" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Roger Bell_West", + "id" : "Roger Bell_West" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Simon Green", + "id" : "Simon Green" + }, + { + "data" : [ + [ + "Raku", + 1 + ] + ], + "name" : "Simon Proctor", + "id" : "Simon Proctor" + }, + { + "id" : "Solathian", + "name" : "Solathian", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Stephen G. Lynn", + "id" : "Stephen G. Lynn" + }, + { + "data" : [ + [ + "Perl", + 1 + ] + ], + "name" : "Steven Wilson", + "id" : "Steven Wilson" + }, + { + "id" : "Thomas Kohler", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 2 + ] + ], + "name" : "Thomas Kohler" + }, + { + "id" : "Ulrich Rieke", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 1 + ] + ], + "name" : "Ulrich Rieke" + }, + { + "name" : "W. Luis Mochan", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "W. Luis Mochan" + } + ] + }, + "title" : { + "text" : "The Weekly Challenge - 227" + }, + "series" : [ + { + "name" : "The Weekly Challenge - 227", + "colorByPoint" : 1, + "data" : [ + { + "name" : "Ali Moradi", + "y" : 3, +