From feb941721732ebbad6afeddc133b25ea762d9854 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Sat, 17 Jun 2023 09:08:23 +0100 Subject: - Added solutions by Matthias Muth. - Added solutions by Simon Proctor. - Added solutions by Laurent Rosenfeld. - Added solutions by Robert DiCicco. - Added solutions by Ulrich Rieke. - Added solutions by Thomas Kohler. - Added solutions by Mark Anderson. - Added solutions by E. Choroba. - Added solutions by David Ferrone. - Added solutions by W. Luis Mochan. - Added solutions by Bob Lied. - Added solutions by Peter Campbell Smith. - Added solutions by Ali Muradi. - Added solutions by Robbie Hatley. - Added solutions by Jorg Sommrey. - Added solutions by Lubos Kolouch. - Added solutions by Niels van Dijke. - Added solutions by Roger Bell_West. - Added solutions by Arne Sommer. - Added solutions by Robert Ransbottom. - Added solutions by Andreas Vogele. --- challenge-221/blog.txt | 1 - challenge-221/bob-lied/blog.txt | 1 + challenge-221/bob-lied/perl/ch-1.pl | 22 + challenge-221/bob-lied/perl/ch-2.pl | 27 + challenge-221/eric-cheung/python/ch-1.py | 38 + challenge-221/eric-cheung/python/ch-2.py | 47 + challenge-221/laurent-rosenfeld/blog.txt | 1 + challenge-221/laurent-rosenfeld/blog1.txt | 1 + challenge-221/laurent-rosenfeld/perl/ch-1.pl | 28 + challenge-221/laurent-rosenfeld/perl/ch-2.pl | 25 + challenge-221/laurent-rosenfeld/raku/ch-1.raku | 14 + challenge-221/laurent-rosenfeld/raku/ch-2.raku | 11 + challenge-221/perl/ch-1.pl | 22 - challenge-221/perl/ch-2.pl | 27 - challenge-221/perlboy1967/perl/ch-1.pl | 47 + challenge-221/perlboy1967/perl/ch1.pl | 47 - challenge-221/robert-dicicco/julia/ch-1.jl | 63 + challenge-221/robert-dicicco/perl/ch-1.pl | 60 + challenge-221/robert-dicicco/python/ch-1.py | 51 + challenge-221/robert-dicicco/raku/ch-1.raku | 58 + challenge-221/robert-dicicco/ruby/ch-1.rb | 62 + challenge-221/ulrich-rieke/cpp/ch-1.cpp | 64 + challenge-221/ulrich-rieke/cpp/ch-2.cpp | 87 ++ challenge-221/ulrich-rieke/haskell/ch-1.hs | 30 + challenge-221/ulrich-rieke/haskell/ch-2.hs | 21 + challenge-221/ulrich-rieke/perl/ch-1.pl | 41 + challenge-221/ulrich-rieke/perl/ch-2.pl | 36 + challenge-221/ulrich-rieke/raku/ch-1.raku | 38 + challenge-221/ulrich-rieke/raku/ch-2.raku | 87 ++ challenge-221/ulrich-rieke/rust/ch-1.rs | 42 + challenge-221/ulrich-rieke/rust/ch-2.rs | 42 + members.json | 1 + stats/pwc-challenge-218.json | 499 ++++---- stats/pwc-challenge-220.json | 620 ++++++++++ stats/pwc-current.json | 413 ++----- stats/pwc-language-breakdown-summary.json | 66 +- stats/pwc-language-breakdown.json | 1571 ++++++++++++------------ stats/pwc-leaders.json | 802 ++++++------ stats/pwc-summary-1-30.json | 60 +- stats/pwc-summary-121-150.json | 116 +- stats/pwc-summary-151-180.json | 50 +- stats/pwc-summary-181-210.json | 122 +- stats/pwc-summary-211-240.json | 128 +- stats/pwc-summary-241-270.json | 128 +- stats/pwc-summary-271-300.json | 48 +- stats/pwc-summary-31-60.json | 44 +- stats/pwc-summary-61-90.json | 122 +- stats/pwc-summary-91-120.json | 46 +- stats/pwc-summary.json | 674 +++++----- 49 files changed, 4011 insertions(+), 2640 deletions(-) delete mode 100644 challenge-221/blog.txt create mode 100644 challenge-221/bob-lied/blog.txt create mode 100755 challenge-221/bob-lied/perl/ch-1.pl create mode 100755 challenge-221/bob-lied/perl/ch-2.pl create mode 100755 challenge-221/eric-cheung/python/ch-1.py create mode 100755 challenge-221/eric-cheung/python/ch-2.py create mode 100644 challenge-221/laurent-rosenfeld/blog.txt create mode 100644 challenge-221/laurent-rosenfeld/blog1.txt create mode 100644 challenge-221/laurent-rosenfeld/perl/ch-1.pl create mode 100644 challenge-221/laurent-rosenfeld/perl/ch-2.pl create mode 100644 challenge-221/laurent-rosenfeld/raku/ch-1.raku create mode 100644 challenge-221/laurent-rosenfeld/raku/ch-2.raku delete mode 100755 challenge-221/perl/ch-1.pl delete mode 100755 challenge-221/perl/ch-2.pl create mode 100755 challenge-221/perlboy1967/perl/ch-1.pl delete mode 100755 challenge-221/perlboy1967/perl/ch1.pl create mode 100644 challenge-221/robert-dicicco/julia/ch-1.jl create mode 100644 challenge-221/robert-dicicco/perl/ch-1.pl create mode 100644 challenge-221/robert-dicicco/python/ch-1.py create mode 100644 challenge-221/robert-dicicco/raku/ch-1.raku create mode 100644 challenge-221/robert-dicicco/ruby/ch-1.rb create mode 100644 challenge-221/ulrich-rieke/cpp/ch-1.cpp create mode 100644 challenge-221/ulrich-rieke/cpp/ch-2.cpp create mode 100644 challenge-221/ulrich-rieke/haskell/ch-1.hs create mode 100644 challenge-221/ulrich-rieke/haskell/ch-2.hs create mode 100644 challenge-221/ulrich-rieke/perl/ch-1.pl create mode 100644 challenge-221/ulrich-rieke/perl/ch-2.pl create mode 100644 challenge-221/ulrich-rieke/raku/ch-1.raku create mode 100644 challenge-221/ulrich-rieke/raku/ch-2.raku create mode 100644 challenge-221/ulrich-rieke/rust/ch-1.rs create mode 100644 challenge-221/ulrich-rieke/rust/ch-2.rs create mode 100644 stats/pwc-challenge-220.json diff --git a/challenge-221/blog.txt b/challenge-221/blog.txt deleted file mode 100644 index 5b69803d6a..0000000000 --- a/challenge-221/blog.txt +++ /dev/null @@ -1 +0,0 @@ -https://wlmb.github.io/2023/06/12/PWC221/ diff --git a/challenge-221/bob-lied/blog.txt b/challenge-221/bob-lied/blog.txt new file mode 100644 index 0000000000..5b69803d6a --- /dev/null +++ b/challenge-221/bob-lied/blog.txt @@ -0,0 +1 @@ +https://wlmb.github.io/2023/06/12/PWC221/ diff --git a/challenge-221/bob-lied/perl/ch-1.pl b/challenge-221/bob-lied/perl/ch-1.pl new file mode 100755 index 0000000000..1978b64c5a --- /dev/null +++ b/challenge-221/bob-lied/perl/ch-1.pl @@ -0,0 +1,22 @@ +#!/usr/bin/env perl +# Perl weekly challenge 221 +# Task 1: Good Strings +# +# See https://wlmb.github.io/2023/06/12/PWC221/#task-1-good-strings +use v5.36; +use List::Util qw(all); +die <<~"FIN" unless @ARGV; + Usage: $0 C W1 [W2...] + to find the total length of the set of words {Wn} than are formed by + the characters in C + FIN +my ($chars, @words)=@ARGV; +my %char_count; +$char_count{$_}++ for split "", $chars; +my @results=grep { + my %word_char_count; + $word_char_count{$_}++ for split "", $_; + all {$word_char_count{$_}<=$char_count {$_}} keys %word_char_count +} @words; +say("chars: $chars, words: @words -> good strings: @results -> length: ", + length join "", @results) diff --git a/challenge-221/bob-lied/perl/ch-2.pl b/challenge-221/bob-lied/perl/ch-2.pl new file mode 100755 index 0000000000..f9de84d188 --- /dev/null +++ b/challenge-221/bob-lied/perl/ch-2.pl @@ -0,0 +1,27 @@ +#!/usr/bin/env perl +# Perl weekly challenge 221 +# Task 2: Arithmetic Subsequence +# +# See https://wlmb.github.io/2023/06/12/PWC221/#task-2-arithmetic-subsequence +use v5.36; +use List::Util qw(max first); +die <<~"FIN" unless @ARGV; + Usage: $0 N1 [N2...] + to find the longest arithmetic subsequence of the integers N1 N2... + FIN +my @set=@ARGV; +# Search longest subsequence, remove leading element and repeat. Keep max. +say "@set -> ", max map {test(@set[$_..@set-1])} 0..@set-1; + +sub test(@subset){ + return 0+@subset unless @subset>1; # 0 or 1 for empty or one element subsets + return 1+max map {rest($subset[$_]-$subset[0], @subset[$_..@subset-1])} 1..@subset-1; +} + +sub rest($val, @subset){ + # find index of next (the second) element of arithmetic subsequence + # starting at the first element $subset[0] and separated by value $val + my $i=first {$subset[$_]==$subset[0]+$val} 1..@subset-1; + return 1 unless defined $i; # none found? Only the first element is in sequence + return 1+rest($val, @subset[$i..@subset-1]); # recurse starting from found value +} diff --git a/challenge-221/eric-cheung/python/ch-1.py b/challenge-221/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..5e47922272 --- /dev/null +++ b/challenge-221/eric-cheung/python/ch-1.py @@ -0,0 +1,38 @@ + +## Example 1 +## arrInputWords = ["cat", "bt", "hat", "tree"] +## strChars = "atach" + +## Example 2 +arrInputWords = ["hello", "world", "challenge"] +strChars = "welldonehopper" + +arrUniqChar = list(set(strChars)) +arrUniqCharCount = [strChars.count(charLoop) for charLoop in arrUniqChar] + +arrOutputWords = [] +nSumCharLength = 0 + +for strLoop in arrInputWords: + arrCharCount = arrUniqCharCount[:] + bIsFound = True + + for charLoop in strLoop: + if not charLoop in arrUniqChar: + bIsFound = False + break + + nIndx = arrUniqChar.index(charLoop) + + if arrCharCount[nIndx] == 0: + bIsFound = False + break + + arrCharCount[nIndx] = arrCharCount[nIndx] - 1 + + if bIsFound: + arrOutputWords.append(strLoop) + nSumCharLength = nSumCharLength + len(strLoop) + +## print (arrOutputWords) +print (nSumCharLength) diff --git a/challenge-221/eric-cheung/python/ch-2.py b/challenge-221/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..0288a402e5 --- /dev/null +++ b/challenge-221/eric-cheung/python/ch-2.py @@ -0,0 +1,47 @@ + +## Remarks +## https://www.geeksforgeeks.org/generating-all-possible-subsequences-using-recursion/ + +## Python3 code to print all possible subsequences for given array using recursion +## Recursive function to print all possible subsequences for given array + +nMaxArrLen = 0 + +def IsArithmetic (arrListCheck): + + nDiff = arrListCheck[1] - arrListCheck[0] + for nIndxLoop in range(2, len(arrListCheck)): + if arrListCheck[nIndxLoop] - arrListCheck[nIndxLoop - 1] != nDiff: + return False + + return True + +def GenSubseqArr (arrFunc, nIndx, subArrFunc): + + global nMaxArrLen + + ## Print the subsequence when reach the leaf of recursion tree + if nIndx == len(arrFunc): + ## Condition to avoid printing empty subsequence + ## if len(subArrFunc) > 0: + if len(subArrFunc) > 2 and IsArithmetic(subArrFunc): + ## print (subArrFunc) + if len(subArrFunc) > nMaxArrLen: + nMaxArrLen = len(subArrFunc) + + else: + ## Subsequence without including the element at current nIndx + GenSubseqArr(arrFunc, nIndx + 1, subArrFunc) + + ## Subsequence including the element at current nIndx + GenSubseqArr(arrFunc, nIndx + 1, subArrFunc + [arrFunc[nIndx]]) + + return + +arrGivenMain = [9, 4, 7, 2, 10] ## Example 1 +## arrGivenMain = [3, 6, 9, 12] ## Example 2 +## arrGivenMain = [20, 1, 15, 3, 10, 5, 8] ## Example 3 + +GenSubseqArr(arrGivenMain, 0, []) + +print (nMaxArrLen) diff --git a/challenge-221/laurent-rosenfeld/blog.txt b/challenge-221/laurent-rosenfeld/blog.txt new file mode 100644 index 0000000000..76372000c8 --- /dev/null +++ b/challenge-221/laurent-rosenfeld/blog.txt @@ -0,0 +1 @@ +https://blogs.perl.org/users/laurent_r/2023/06/perl-weekly-challenge-221-good-strings.html diff --git a/challenge-221/laurent-rosenfeld/blog1.txt b/challenge-221/laurent-rosenfeld/blog1.txt new file mode 100644 index 0000000000..d1008ecc08 --- /dev/null +++ b/challenge-221/laurent-rosenfeld/blog1.txt @@ -0,0 +1 @@ +https://blogs.perl.org/users/laurent_r/2023/06/perl-weekly-challenge-221-arithmetic-subsequence.html diff --git a/challenge-221/laurent-rosenfeld/perl/ch-1.pl b/challenge-221/laurent-rosenfeld/perl/ch-1.pl new file mode 100644 index 0000000000..dee5b9c37f --- /dev/null +++ b/challenge-221/laurent-rosenfeld/perl/ch-1.pl @@ -0,0 +1,28 @@ +use strict; +use warnings; +use feature 'say'; + +sub find_good { + my ($string, @words) = @_; + # say $string, " - ", "@words"; + my $length = 0; + my %chars; + $chars{$_}++ for split //, $string; + WORD: for my $word (@words) { + my %char_cpy = %chars; + for my $let (split //, $word) { + next WORD unless $char_cpy{$let}; + $char_cpy{$let}--; + } + $length += length $word; + } + return $length +} +for my $test ( + ["atach", []], + ["atach", []], + ["atach", []], + ["welldonehopper", []]) { + printf "%-15s - %-22s => ", "@$test[0]", "@{@$test[1]}"; + say find_good @$test[0], @{@$test[1]}; +} diff --git a/challenge-221/laurent-rosenfeld/perl/ch-2.pl b/challenge-221/laurent-rosenfeld/perl/ch-2.pl new file mode 100644 index 0000000000..a577abbfbc --- /dev/null +++ b/challenge-221/laurent-rosenfeld/perl/ch-2.pl @@ -0,0 +1,25 @@ +use strict; +use warnings; +use feature 'say'; + +sub longest_subseq { + my @pairs; + for my $i (0..$#_) { + for my $j ($i+1..$#_) { + push @pairs, [$_[$i], $_[$j]]; + } + } + my %gaps; + $gaps{($_->[1] - $_->[0])}++ for @pairs; + my $max = 0; + for my $k (keys %gaps) { + $max = $gaps{$k} if $gaps{$k} > $max; + } + # For n gaps, we have n + 1 values + return $max + 1; +} + +for my $test ( [<9 4 7 2 10>], [<3 6 9 12>], [<20 1 15 3 10 5 8>] ) { + printf "%-18s => ", "@$test"; + say longest_subseq @$test; +} diff --git a/challenge-221/laurent-rosenfeld/raku/ch-1.raku b/challenge-221/laurent-rosenfeld/raku/ch-1.raku new file mode 100644 index 0000000000..b7d322e00d --- /dev/null +++ b/challenge-221/laurent-rosenfeld/raku/ch-1.raku @@ -0,0 +1,14 @@ +sub find-good ($string, @words) { + my $chars = $string.comb.Bag; + my $length = 0; + for @words -> $word { + $length += $word.chars if $word.comb.Bag ⊆ $chars; + } + return $length +} +for (("atach", ), + ("atach", ), + ("welldonehopper", )) -> @test { + printf "%-15s - %-22s => ", "@test[0]", "@test[1]"; + say find-good @test[0], @test[1]; +} diff --git a/challenge-221/laurent-rosenfeld/raku/ch-2.raku b/challenge-221/laurent-rosenfeld/raku/ch-2.raku new file mode 100644 index 0000000000..9e11e6f79e --- /dev/null +++ b/challenge-221/laurent-rosenfeld/raku/ch-2.raku @@ -0,0 +1,11 @@ +sub longest-subseq (@in) { + my @pairs = @in.combinations: 2; + my %gaps; + %gaps{~($_[1] - $_[0])}++ for @pairs; + # For n gaps, we have n + 1 values + return %gaps.values.max + 1; +} + +for <9 4 7 2 10>, <3 6 9 12>, <20 1 15 3 10 5 8> -> @test { + printf "%-18s => %d\n", ~(@test), longest-subseq @test; +} diff --git a/challenge-221/perl/ch-1.pl b/challenge-221/perl/ch-1.pl deleted file mode 100755 index 1978b64c5a..0000000000 --- a/challenge-221/perl/ch-1.pl +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env perl -# Perl weekly challenge 221 -# Task 1: Good Strings -# -# See https://wlmb.github.io/2023/06/12/PWC221/#task-1-good-strings -use v5.36; -use List::Util qw(all); -die <<~"FIN" unless @ARGV; - Usage: $0 C W1 [W2...] - to find the total length of the set of words {Wn} than are formed by - the characters in C - FIN -my ($chars, @words)=@ARGV; -my %char_count; -$char_count{$_}++ for split "", $chars; -my @results=grep { - my %word_char_count; - $word_char_count{$_}++ for split "", $_; - all {$word_char_count{$_}<=$char_count {$_}} keys %word_char_count -} @words; -say("chars: $chars, words: @words -> good strings: @results -> length: ", - length join "", @results) diff --git a/challenge-221/perl/ch-2.pl b/challenge-221/perl/ch-2.pl deleted file mode 100755 index f9de84d188..0000000000 --- a/challenge-221/perl/ch-2.pl +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env perl -# Perl weekly challenge 221 -# Task 2: Arithmetic Subsequence -# -# See https://wlmb.github.io/2023/06/12/PWC221/#task-2-arithmetic-subsequence -use v5.36; -use List::Util qw(max first); -die <<~"FIN" unless @ARGV; - Usage: $0 N1 [N2...] - to find the longest arithmetic subsequence of the integers N1 N2... - FIN -my @set=@ARGV; -# Search longest subsequence, remove leading element and repeat. Keep max. -say "@set -> ", max map {test(@set[$_..@set-1])} 0..@set-1; - -sub test(@subset){ - return 0+@subset unless @subset>1; # 0 or 1 for empty or one element subsets - return 1+max map {rest($subset[$_]-$subset[0], @subset[$_..@subset-1])} 1..@subset-1; -} - -sub rest($val, @subset){ - # find index of next (the second) element of arithmetic subsequence - # starting at the first element $subset[0] and separated by value $val - my $i=first {$subset[$_]==$subset[0]+$val} 1..@subset-1; - return 1 unless defined $i; # none found? Only the first element is in sequence - return 1+rest($val, @subset[$i..@subset-1]); # recurse starting from found value -} diff --git a/challenge-221/perlboy1967/perl/ch-1.pl b/challenge-221/perlboy1967/perl/ch-1.pl new file mode 100755 index 0000000000..a84549d1d4 --- /dev/null +++ b/challenge-221/perlboy1967/perl/ch-1.pl @@ -0,0 +1,47 @@ +#!/bin/perl + +=pod + +The Weekly Challenge - 221 +- https://theweeklychallenge.org/blog/perl-weekly-challenge-221 + +Author: Niels 'PerlBoy' van Dijke + +Task 1: Good Strings +Submitted by: Mohammad S Anwar + +You are given a list of @words and a string $chars. + +|| A string is good if it can be formed by characters from $chars, each character +|| can be used only once. + + +Write a script to return the sum of lengths of all good strings in words. + +=cut + +use v5.16; + +use common::sense; + +use Test::More; + +sub goodStrings ($@) { + my ($c,$s) = (shift,0); + + my %c; $c{$_}++ for (split //,$c); + + for (@_) { + my %m; $m{$_}++ for (split //,$_); + map { delete $m{$_} if ($m{$_} <= $c{$_} // 0) } keys %m; + $s += length($_) if (keys %m == 0); + } + + return $s +} + +is(goodStrings('attach','cat','bt','hat','tree'),6); +is(goodStrings('welldonehopper','hello','world','challenge'),10); +is(goodStrings('race','ace','racecar'),3); + +done_testing; diff --git a/challenge-221/perlboy1967/perl/ch1.pl b/challenge-221/perlboy1967/perl/ch1.pl deleted file mode 100755 index a84549d1d4..0000000000 --- a/challenge-221/perlboy1967/perl/ch1.pl +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/perl - -=pod - -The Weekly Challenge - 221 -- https://theweeklychallenge.org/blog/perl-weekly-challenge-221 - -Author: Niels 'PerlBoy' van Dijke - -Task 1: Good Strings -Submitted by: Mohammad S Anwar - -You are given a list of @words and a string $chars. - -|| A string is good if it can be formed by characters from $chars, each character -|| can be used only once. - - -Write a script to return the sum of lengths of all good strings in words. - -=cut - -use v5.16; - -use common::sense; - -use Test::More; - -sub goodStrings ($@) { - my ($c,$s) = (shift,0); - - my %c; $c{$_}++ for (split //,$c); - - for (@_) { - my %m; $m{$_}++ for (split //,$_); - map { delete $m{$_} if ($m{$_} <= $c{$_} // 0) } keys %m; - $s += length($_) if (keys %m == 0); - } - - return $s -} - -is(goodStrings('attach','cat','bt','hat','tree'),6); -is(goodStrings('welldonehopper','hello','world','challenge'),10); -is(goodStrings('race','ace','racecar'),3); - -done_testing; diff --git a/challenge-221/robert-dicicco/julia/ch-1.jl b/challenge-221/robert-dicicco/julia/ch-1.jl new file mode 100644 index 0000000000..0d75c4eebe --- /dev/null +++ b/challenge-221/robert-dicicco/julia/ch-1.jl @@ -0,0 +1,63 @@ +#!/usr/bin/env julia +#= +------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-06-13 +Challenge 221 Task 1 Good Strings ( Julia ) +------------------------------------- +=# + +using Printf + +total_score = 0 + +words = [["cat", "bt", "hat", "tree"], ["hello", "world", "challenge"]] +chlist = ["atach","welldonehopper"] +cnt = 1 +listcnt = 1 + +for wds in words + @printf("Input: @words = %s\n",wds) + chars = chlist[cnt] + global total_score = 0 + score = 0 + for w in wds + ln = length(w) + for mycnt in 1:ln + tst = w[mycnt] + if occursin(tst, chlist[listcnt]) + score += 1 + else + break + end + end + if score == ln + @printf("%s\n",w) + total_score += score + score = 0 + end + end + @printf("\tTotal: %d\n", total_score) + println() + global listcnt += 1 +end + +#= +------------------------------------- +SAMPLE OUTPUT +julia .\GoodStrings.jl + +Input: @words = ["cat", "bt", "hat", "tree"] +cat +hat + Total: 6 + +Input: @words = ["hello", "world", "challenge"] +hello +world + Total: 10 +------------------------------------- +=# + + + diff --git a/challenge-221/robert-dicicco/perl/ch-1.pl b/challenge-221/robert-dicicco/perl/ch-1.pl new file mode 100644 index 0000000000..012a057a2f --- /dev/null +++ b/challenge-221/robert-dicicco/perl/ch-1.pl @@ -0,0 +1,60 @@ +#!/usr/bin/env perl +=begin comment +------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-06-12 +Challenge 221 Task 1 Good Strings ( Perl ) +------------------------------------- +=cut +use strict; +use warnings; +use feature 'say'; + +my $total_score = 0; + +my @words = (["cat", "bt", "hat", "tree"], ["hello", "world", "challenge"]); +my @chlist = ("atach","welldonehopper"); +my $cnt = 0; +for my $word (@words) { + say "Input: \@words = (@$word)"; + my $chars = $chlist[$cnt]; + $total_score = 0; + for my $w (@$word) { + my $ln = length($w); + my $score = 0; + for (my $cnt = 0; $cnt < $ln; $cnt++){ + my $tst = substr($w,$cnt,1); + if ($chars =~ /$tst/) { + $score++; + } else { + last; + } + + } + if ($score == $ln) { + say $w; + $total_score += $score; + $score = 0; + } + } + say "\tTotal: ", $total_score; + say ""; + $cnt++; +} + +=begin comment +------------------------------------- +SAMPLE OUTPUT +perl .\GoodStrings.pl + +Input: @words = (cat bt hat tree) +cat +hat + Total: 6 + +Input: @words = (hello world challenge) +hello +world + Total: 10 +------------------------------------- +=cut diff --git a/challenge-221/robert-dicicco/python/ch-1.py b/challenge-221/robert-dicicco/python/ch-1.py new file mode 100644 index 0000000000..5433676bd3 --- /dev/null +++ b/challenge-221/robert-dicicco/python/ch-1.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# ------------------------------------- +# AUTHOR: Robert DiCicco +# DATE : 2023-06-13 +# Challenge 221 Task 1 Good Strings ( Python ) +# ------------------------------------- + +total_score = 0 + +words = [["cat", "bt", "hat", "tree"], ["hello", "world", "challenge"]] +chlist = ["atach","welldonehopper"] +cnt = 0 +listcnt = 0 + +for wds in words: + print("Input: @words = ",wds) + chars = chlist[cnt] + total_score = 0 + score = 0 + for w in wds: + ln = len(w) + for mycnt in range(0,ln): + tst = w[mycnt] + if tst in chlist[listcnt]: + score += 1 + else: + break + if score == ln: + print(w) + total_score += score + score = 0 + print("\tTotal: ",total_score) + print("") + listcnt += 1 + +# ------------------------------------- +# SAMPLE OUTPUT +# python .\GoodStrings.py + +# Input: @words = ['cat', 'bt', 'hat', 'tree'] +# cat +# hat + # Total: 6 + +# Input: @words = ['hello', 'world', 'challenge'] +# hello +# world + # Total: 10 +# ------------------------------------- + + diff --git a/challenge-221/robert-dicicco/raku/ch-1.raku b/challenge-221/robert-dicicco/raku/ch-1.raku new file mode 100644 index 0000000000..2216add23d --- /dev/null +++ b/challenge-221/robert-dicicco/raku/ch-1.raku @@ -0,0 +1,58 @@ +#!/usr/bin/env raku +=begin comment +------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-06-12 +Challenge 221 Task 1 Good Strings ( Raku ) +------------------------------------- +=end comment + +my $total_score = 0; + +my @words = (["cat", "bt", "hat", "tree"], ["hello", "world", "challenge"]); +my @chlist = ("atach","welldonehopper"); +my $cnt = 0; +for (@words) -> @word { + say "Input: \@words = ",@word; + my $chars = @chlist[$cnt]; + $total_score = 0; + for (@word) -> $w { + my $ln = $w.chars; + my $score = 0; + loop (my $cnt = 0; $cnt < $ln; $cnt++){ + my $tst = substr($w,$cnt,1); + if $chars.contains($tst) { + $score++; + } else { + last; + } + } + if ($score == $ln) { + say $w; + $total_score += $score; + $score = 0; + } + } + say "\tTotal: ", $total_score; + say ""; + $cnt++; +} + +=begin comment +------------------------------------- +SAMPLE OUTPUT +raku .\GoodStrings.rk + +Input: @words = [cat bt hat tree] +cat +hat + Total: 6 + +Input: @words = [hello world challenge] +hello +world + Total: 10 +------------------------------------- +=end comment + + diff --git a/challenge-221/robert-dicicco/ruby/ch-1.rb b/challenge-221/robert-dicicco/ruby/ch-1.rb new file mode 100644 index 0000000000..2bb6caae75 --- /dev/null +++ b/challenge-221/robert-dicicco/ruby/ch-1.rb @@ -0,0 +1,62 @@ +#!/usr/bin/env ruby +=begin +------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-06-12 +Challenge 221 Task 1 Good Strings ( Ruby ) +------------------------------------- +=end + +total_score = 0 + +words = [["cat", "bt", "hat", "tree"], ["hello", "world", "challenge"]] +chlist = ["atach","welldonehopper"] +cnt = 0 +listcnt = 0 + +words.each do |wds| + puts("Input: @words = #{wds}") + chars = chlist[cnt] + total_score = 0 + wds.each do |w| + ln = w.length + score = 0 + for cnt in 0..ln-1 do + tst = w[cnt,1] + if chlist[listcnt].include? tst + score += 1 + else + break + end + end + if score == ln + puts("#{w}") + total_score += score + score = 0 + end + end + puts("\tTotal: #{total_score}\n\n") + cnt += 1 + listcnt += 1 +end + +=begin +------------------------------------- +SAMPLE OUTPUT +ruby .\GoodStrings.rb +Input: @words = ["cat", "bt", "hat", "tree"] +cat +hat + Total: 6 + +Input: @words = ["hello", "world", "challenge"] +hello +world + Total: 10 +------------------------------------- +=end + + + + + diff --git a/challenge-221/ulrich-rieke/cpp/ch-1.cpp b/challenge-221/ulrich-rieke/cpp/ch-1.cpp new file mode 100644 index 0000000000..71caaed73c --- /dev/null +++ b/challenge-221/ulrich-rieke/cpp/ch-1.cpp @@ -0,0 +1,64 @@ +#include +#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 ; +} + +bool condition( const std::string & word , const std::map & + provided ) { + std::map lettercount ; + for ( char c : word ) + lettercount[c]++ ; + for ( char c : word ) { + if ( ! ( provided.find( c ) != provided.end( ) && + (provided.find( c ))->second >= + (lettercount.find( c ) )->second ) ) + return false ; + } + return true ; +} + + +int main( ) { + std::cout << "Enter some words, separated by blanks!\n" ; + std::string line ; + std::getline( std::cin , line ) ; + std::vector words ( split( line, " " ) ) ; + std::cout << "Enter a word to take the characters from!\n" ; + std::string comparator ; + std::cin >> comparator ; + std::map compCount ; + for ( char c : comparator ) + compCount[c]++ ; + std::vector selected ; + for ( auto s : words ) { + if ( condition( s , compCount ) ) { + selected.push_back( s ) ; + } + } + if ( selected.size( ) > 0 ) { + std::vector lengths ; + for ( auto s : selected ) + lengths.push_back( s.length( ) ) ; + std::cout << std::accumulate( lengths.begin( ) , lengths.end( ) , 0 ) + << std::endl ; + } + else { + std::cout << 0 << std::endl ; + } + return 0 ; +} diff --git a/challenge-221/ulrich-rieke/cpp/ch-2.cpp b/challenge-221/ulrich-rieke/cpp/ch-2.cpp new file mode 100644 index 0000000000..6375a48fa7 --- /dev/null +++ b/challenge-221/ulrich-rieke/cpp/ch-2.cpp @@ -0,0 +1,87 @@ +#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 ; +} + +std::string to_binary_string( int n , int len) { + std::string binstr ; + int total = n ; + while ( total != 0 ) { + binstr.append( std::to_string( total % 2 ) ) ; + total /= 2 ; + } + int difference = len - binstr.length( ) ; + if ( difference > 0 ) { + for ( int i = 0 ; i < difference ; i++ ) + binstr.append( std::string( "0" ) ) ; + } + std::reverse( binstr.begin( ) , binstr.end( ) ) ; + return binstr ; +} + +std::vector extract( const std::vector & numbers , + const std::string & binstring ) { + std::vector selection ; + for ( int i = 0 ; i < binstring.length( ) ; i++ ) { + if ( binstring.substr( i , 1 ) == "1" ) + selection.push_back( numbers[ i ] ) ; + } + return selection ; +} + +bool is_arithmetic( const std::vector & aSeq ) { + int len = aSeq.size( ) ; + int start = aSeq[1] - aSeq[0] ; + for ( int i = 1 ; i < len - 1 ; i++ ) { + if ( aSeq[ i + 1 ] - aSeq[ i ] != start ) { + return false ; + } + } + return true ; +} + +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 ) ) ; + int len = numbers.size( ) ; + if ( is_arithmetic( numbers ) ) + std::cout << len << std::endl ; + else { + int maxlen = 0 ; + int limit = static_cast( std::pow( 2.0 , + static_cast( len )) - 1 ) ; + for ( int i = 0 ; i < limit + 1 ; i++ ) { + std::string binstring ( to_binary_string( i , len ) ) ; + if ( std::count( binstring.begin( ) , binstring.end( ) , + '1' ) > 1 ) { + std::vector selection ( extract( numbers , binstring ) ) ; + if ( is_arithmetic( selection ) ) { + int sublen = selection.size( ) ; + if ( sublen > maxlen ) + maxlen = sublen ; + } + } + } + std::cout << maxlen << std::endl ; + } + return 0 ; +} diff --git a/challenge-221/ulrich-rieke/haskell/ch-1.hs b/challenge-221/ulrich-rieke/haskell/ch-1.hs new file mode 100644 index 0000000000..3dbb69b261 --- /dev/null +++ b/challenge-221/ulrich-rieke/haskell/ch-1.hs @@ -0,0 +1,30 @@ +module Challenge221 + where +import qualified Data.Set as S + +isGood :: String -> String -> Bool +isGood word lettersource = S.isSubsetOf wordSet sourceSet && all +(\c -> (count c word) <= ( count c lettersource )) word +where + wordSet :: S.Set Char + wordSet = S.fromList word + sourceSet :: S.Set Char + sourceSet = S.fromList lettersource + count :: Char -> String -> Int + count l w = length $ filter (== l ) w + +solution :: [String] -> String -> Int +solution wordlist source + |not $ null goodlist = sum $ map length goodlist + |otherwise = 0 + where + goodlist :: [String] + goodlist = filter (\s -> isGood s source ) wordlist + +main :: IO ( ) +main = do + putStrLn "Enter some words, separated by blanks!" + wordlist <- getLine + putStrLn "Enter a word as a source of letters!" + lettersource <- getLine + print $ solution ( words wordlist ) lettersource diff --git a/challenge-221/ulrich-rieke/haskell/ch-2.hs b/challenge-221/ulrich-rieke/haskell/ch-2.hs new file mode 100644 index 0000000000..b19673e3da --- /dev/null +++ b/challenge-221/ulrich-rieke/haskell/ch-2.hs @@ -0,0 +1,21 @@ +module Challenge221_2 + where +import Data.List ( sortOn , subsequences ) +import Data.List.Split( divvy ) + +is_algorithmic :: [Int] -> Bool +is_algorithmic list = allEqual $ map (\li -> last li - head li ) +$ divvy 2 1 list +where + allEqual :: [Int] -> Bool + allEqual someList = all (\i -> i == head someList) someList + +solution :: [Int] -> Int +solution = length . last . sortOn length . filter is_algorithmic +. subsequences + +main :: IO ( ) +main = do + putStrLn "Enter some digits separated by blanks!" + numbers <- getLine + print $ solution $ map read $ words numbers diff --git a/challenge-221/ulrich-rieke/perl/ch-1.pl b/challenge-221/ulrich-rieke/perl/ch-1.pl new file mode 100644 index 0000000000..91f108a81f --- /dev/null +++ b/challenge-221/ulrich-rieke/perl/ch-1.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; +use List::Util qw ( sum ) ; + +sub condition { + my $word = shift ; + my $lettercomp = shift ; + my %letterwords ; + for my $letter( split( // , $word ) ) { + $letterwords{ $letter }++ ; + } + for my $letter ( split( // , $word ) ) { + unless ( exists( $lettercomp->{$letter}) && $lettercomp->{$letter} + >= $letterwords{ $letter } ) { + return 0 ; + } + } + return 1 ; +} + +say "Enter some words, separated by blanks!" ; +my $line = ; +chomp $line ; +my @words = split( /\s/ , $line ) ; +say "Enter a word to take the letters from!" ; +my $comparator = ; +chomp $comparator ; +my %compLetters ; +for my $letter( split( // , $comparator ) ) { + $compLetters{ $letter }++ ; +} +my @selected = grep { condition( $_ , \%compLetters )} @words ; +if ( @selected ) { + my @nums = map { length $_ } @selected ; + say sum( @nums ) ; +} +else { + say 0 ; +} diff --git a/challenge-221/ulrich-rieke/perl/ch-2.pl b/challenge-221/ulrich-rieke/perl/ch-2.pl new file mode 100644 index 0000000000..041f12f02d --- /dev/null +++ b/challenge-221/ulrich-rieke/perl/ch-2.pl @@ -0,0 +1,36 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; +use Algorithm::Combinatorics qw( subsets ) ; + +sub is_arithmetic { + my $array = shift ; + my $len = scalar( @$array ) ; + my $start = $array->[1] - $array->[0] ; + for my $i ( 1..$len - 2 ) { + if ( $array->[ $i + 1 ] - $array->[$i] != $start ) { + return 0 ; + } + } + return 1 ; +} + +say "Enter some integers, separated by blanks!" ; +my $line = ; +chomp $line ; +my @numbers = split( /\s/ , $line ) ; +my $len = scalar ( @numbers ) ; +my $iter = subsets( \@numbers ) ; +my $maxlen = 0 ; +while ( my $c = $iter->next ) { + my $sublen = scalar( @$c ) ; + if ( $sublen > 1 ) { + if ( is_arithmetic( $c ) ) { + if ( $sublen > $maxlen ) { + $maxlen = $sublen ; + } + } + } +} +say $maxlen ; diff --git a/challenge-221/ulrich-rieke/raku/ch-1.raku b/challenge-221/ulrich-rieke/raku/ch-1.raku new file mode 100644 index 0000000000..1852645681 --- /dev/null +++ b/challenge-221/ulrich-rieke/raku/ch-1.raku @@ -0,0 +1,38 @@ +use v6 ; + +sub lettercount( $word ) { + my %wordHash ; + for $word.comb -> $letter { + %wordHash{$letter}++ ; + } + return %wordHash ; +} + +sub condition( $aWord, %compCount ) { + my %wordHash = lettercount( $aWord ) ; + for %wordHash.keys -> $k { + if not ( %compCount{$k}:exists && %compCount{ $k } >= + %wordHash{ $k } ) { + return False ; + } + } + return True ; +} + +say "Enter some words, separated by blanks!" ; +my $line = $*IN.get ; +my @words = $line.words ; +say "Enter a word to take the letters from!" ; +my $comparator = $*IN.get ; +my %compHash ; +for $comparator.comb -> $letter { + %compHash{$letter}++ ; +} +my @selected = @words.grep( {condition( $_ , %compHash )} ) ; +if ( @selected ) { + my @lengths = @selected.map( {$_.chars} ) ; + say [+] @lengths ; +} +else { + say 0 ; +} diff --git a/challenge-221/ulrich-rieke/raku/ch-2.raku b/challenge-221/ulrich-rieke/raku/ch-2.raku new file mode 100644 index 0000000000..799948af3b --- /dev/null +++ b/challenge-221/ulrich-rieke/raku/ch-2.raku @@ -0,0 +1,87 @@ +use v6 ; + +sub is_arithmetic ( @array ) { + my $len = @array.elems ; + my $start = @array[1] - @array[0] ; + for (1..$len - 2) -> $i { + if ( @array[ $i + 1 ] - @array[ $i ] != $start ) { + return False ; + } + } + return True ; +} + +#count the number of 1's in the binary string +sub count_ones( $bin_str ) { + my $ones = 0 ; + for ( 0..$bin_str.chars( ) ) -> $i { + if $bin_str.substr( $i , 1 ) eq '1' { + $ones++ ; + } + } + return $ones ; +} + +#convert a binary string into a subset of an array +sub find_subset( $binary_str , @array ) { + my $len = @array.elems ; + my @subset ; + for (0..$len - 1 ) -> $i { + if ( $binary_str.substr($i , 1 ) eq '1' ) { + @subset.push( @array[ $i ] ) ; + } + } + return @subset ; +} + +#prefix as many 0's as necessary +sub pad_zeroes( $binstr , $desired_len ) { + my $len = $binstr.chars( ) ; + my $padded ; + if ( $len < $desired_len ) { + $padded = '0' x ( $desired_len - $len ) ; + $padded ~= $binstr ; + } + else { + $padded = $binstr ; + } + return $padded ; +} +#there are as many subsets in the set of integers that were input as +#given by (2 to the power of length of input) - 1 +#so we create the binary numbers of all integers from 0 to this upper +#limit that is denoted by the power of 2 +#we can then extract elements of the number array that correspond to +#the ones in the binary numbers +say "Enter some integers, separated by blanks!" ; +my $line = $*IN.get ; +my @numbers = $line.words.map( {.Int} ) ; +if ( is_arithmetic( @numbers ) ) { + say @numbers.elems ; +} +else { + my $len = @numbers.elems ; + my $subset_number = 2 ** $len - 1 ; + my $max_len = 0 ; + for (0..$subset_number ) -> $num { + my $binstr = $num.base( 2 ) ; + my $ones = count_ones( $binstr ) ; + my $padded_bin ; + if ( $ones > 1 ) { + if ( $binstr.chars( ) < $len ) { + $padded_bin = pad_zeroes( $binstr , $len ) ; + } + else { + $padded_bin = $binstr ; + } + my @selection = find_subset( $padded_bin , @numbers ) ; + if ( is_arithmetic( @selection )) { + my $sublen = @selection.elems ; + if ( $sublen > $max_len ) { + $max_len = $sublen ; + } + } + } + } + say $max_len ; +} diff --git a/challenge-221/ulrich-rieke/rust/ch-1.rs b/challenge-221/ulrich-rieke/rust/ch-1.rs new file mode 100644 index 0000000000..74584ca820 --- /dev/null +++ b/challenge-221/ulrich-rieke/rust/ch-1.rs @@ -0,0 +1,42 @@ +use std::io ; +use std::collections::HashMap ; + +fn is_good( a_word : &&str , comparator : &&str ) -> bool { + let mut word_map = HashMap::new( ) ; + let mut comp_map = HashMap::new ( ) ; + for c in a_word.chars( ) { + let value : &mut usize = word_map.entry( c ).or_default( ) ; + *value += 1 ; + } + for c in comparator.chars( ) { + let value : &mut usize = comp_map.entry( c ).or_default( ) ; + *value += 1 ; + } + for c in a_word.chars( ) { + if ! ( comp_map.contains_key( &c ) && comp_map.get( &c).unwrap( ) + >= word_map.get( &c).unwrap( ) ) { + return false ; + } + } + true +} + +fn main() { + println!("Please enter some words , separated by blanks!"); + let mut inline : String = String::new( ) ; + io::stdin( ).read_line( &mut inline ).unwrap( ) ; + let words_line : &str = &*inline ; + let words_entered : Vec<&str> = words_line.split_whitespace( ). + map( | s | s.trim( ) ).collect( ) ; + println!("Enter a word you want to take the characters from!" ) ; + let mut word_line : String = String::new( ) ; + io::stdin( ).read_line( &mut word_line).unwrap( ) ; + let comp_line : &str = &*word_line ; + let mut lengths : Vec = Vec::new( ) ; + for w in words_entered { + if is_good( &w , &comp_line ) { + lengths.push( w.len( ) ) ; + } + } + println!("{}" , lengths.iter( ).sum::( ) ) ; +} diff --git a/challenge-221/ulrich-rieke/rust/ch-2.rs b/challenge-221/ulrich-rieke/rust/ch-2.rs new file mode 100644 index 0000000000..6193a837ac --- /dev/null +++ b/challenge-221/ulrich-rieke/rust/ch-2.rs @@ -0,0 +1,42 @@ +use std::io ; +use itertools::Itertools ; + +fn is_arithmetic( a_vec : &Vec ) -> bool { + let len = a_vec.len( ) ; + let start = a_vec[1] - a_vec[0] ; + for i in 1..len - 1 { + if a_vec[i + 1] - a_vec[ i ] != start { + return false ; + } + } + true +} + +//the idea is : find the powerset of the numbers entered, that is +//the set of all sets. Extract those sets that are arithmetic , and +//find their maximum length +fn main() { + println!("Enter some integers, separated by blanks!") ; + let mut inline : String = String::new( ) ; + io::stdin( ).read_line( &mut inline ).unwrap( ) ; + let entered_line : &str = &*inline ; + let numbers : Vec = entered_line.split_whitespace( ).map( | s | + s.trim( ).parse::( ).unwrap( ) ).collect( ) ; + if is_arithmetic( &numbers ) { + println!("{}" , numbers.len( ) ) ; + } + else { + let all_subsets : Vec> = numbers.into_iter( ). + powerset( ).collect( ) ; + let mut max_len : usize = 0 ; + for v in all_subsets { + let v_len = v.len( ) ; + if v_len > 1 && is_arithmetic( &v ) { + if v_len > max_len { + max_len = v_len ; + } + } + } + println!("{}" , max_len ) ; + } +} diff --git a/members.json b/members.json index 637fb0270a..7eaac4fa33 100644 --- a/members.json +++ b/members.json @@ -14,6 +14,7 @@ "alexander-karelas" : "Alexander Karelas", "alexander-pankoff" : "Alexander Pankoff", "andinus" : "Andinus", + "andreas-voegele" : "Andreas Voegele", "aut0exec" : "Rob Turner", "avery-adams" : "Avery Adams", "mathmauney" : "Alex Mauney", diff --git a/stats/pwc-challenge-218.json b/stats/pwc-challenge-218.json index b5d0cb754b..ec6f374e1f 100644 --- a/stats/pwc-challenge-218.json +++ b/stats/pwc-challenge-218.json @@ -1,187 +1,11 @@ { - "legend" : { - "enabled" : 0 + "xAxis" : { + "type" : "category" }, "tooltip" : { - "pointFormat" : "{point.name}: {point.y:f}
", "headerFormat" : "{series.name}
", - "followPointer" : 1 - }, - "title" : { - "text" : "The Weekly Challenge - 218" - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - } - } - }, - "series" : [ - { - "colorByPoint" : 1, - "data" : [ - { - "name" : "Arne Sommer", - "y" : 3, - "drilldown" : "Arne Sommer" - }, - { - "drilldown" : "Athanasius", - "y" : 2, - "name" : "Athanasius" - }, - { - "y" : 3, - "drilldown" : "Avery Adams", - "name" : "Avery Adams" - }, - { - "name" : "BarrOff", - "y" : 2, - "drilldown" : "BarrOff" - }, - { - "name" : "Bruce Gray", - "drilldown" : "Bruce Gray", - "y" : 2 - }, - { - "name" : "Cheok-Yin Fung", - "y" : 2, - "drilldown" : "Cheok-Yin Fung" - }, - { - "name" : "David Ferrone", - "y" : 2, - "drilldown" : "David Ferrone" - }, - { - "name" : "E. Choroba", - "drilldown" : "E. Choroba", - "y" : 2 - }, - { - "drilldown" : "Flavio Poletti", - "y" : 6, - "name" : "Flavio Poletti" - }, - { - "y" : 5, - "drilldown" : "Jaldhar H. Vyas", - "name" : "Jaldhar H. Vyas" - }, - { - "y" : 1, - "drilldown" : "Jan Krnavek", - "name" : "Jan Krnavek" - }, - { - "name" : "Jorg Sommrey", - "y" : 2, - "drilldown" : "Jorg Sommrey" - }, - { - "drilldown" : "Laurent Rosenfeld", - "y" : 4, - "name" : "Laurent Rosenfeld" - }, - { - "y" : 2, - "drilldown" : "Lubos Kolouch", - "name" : "Lubos Kolouch" - }, - { - "name" : "Mark Anderson", - "drilldown" : "Mark Anderson", - "y" : 2 - }, - { - "name" : "Matthias Muth", - "y" : 3, - "drilldown" : "Matthias Muth" - }, - { - "drilldown" : "Niels van Dijke", - "y" : 2, - "name" : "Niels van Dijke" - }, - { - "name" : "Paulo Custodio", - "drilldown" : "Paulo Custodio", - "y" : 2 - }, - { - "name" : "Peter Campbell Smith", - "y" : 3, - "drilldown" : "Peter Campbell Smith" - }, - { - "y" : 2, - "drilldown" : "Robbie Hatley", - "name" : "Robbie Hatley" - }, - { - "drilldown" : "Robert DiCicco", - "y" : 4, - "name" : "Robert DiCicco" - }, - { - "name" : "Robert Ransbottom", - "y" : 2, - "drilldown" : "Robert Ransbottom" - }, - { - "drilldown" : "Roger Bell_West", - "y" : 5, - "name" : "Roger Bell_West" - }, - { - "name" : "Simon Green", - "drilldown" : "Simon Green", - "y" : 3 - }, - { - "name" : "Solathian", - "drilldown" : "Solathian", - "y" : 1 - }, - { - "name" : "Stephen G. Lynn", - "y" : 3, - "drilldown" : "Stephen G. Lynn" - }, - { - "name" : "Steven Wilson", - "drilldown" : "Steven Wilson", - "y" : 1 - }, - { - "name" : "Thomas Kohler", - "y" : 4, - "drilldown" : "Thomas Kohler" - }, - { - "name" : "Ulrich Rieke", - "y" : 3, - "drilldown" : "Ulrich Rieke" - }, - { - "name" : "W. Luis Mochan", - "y" : 3, - "drilldown" : "W. Luis Mochan" - } - ], - "name" : "The Weekly Challenge - 218" - } - ], - "subtitle" : { - "text" : "[Champions: 30] Last updated at 2023-06-12 04:11:27 GMT" - }, - "xAxis" : { - "type" : "category" + "followPointer" : 1, + "pointFormat" : "{point.name}: {point.y:f}
" }, "chart" : { "type" : "column" @@ -189,6 +13,8 @@ "drilldown" : { "series" : [ { + "name" : "Arne Sommer", + "id" : "Arne Sommer", "data" : [ [ "Raku", @@ -198,13 +24,9 @@ "Blog", 1 ] - ], - "id" : "Arne Sommer", - "name" : "Arne Sommer" + ] }, { - "name" : "Athanasius", - "id" : "Athanasius", "data" : [ [ "Perl", @@ -214,11 +36,11 @@ "Raku", 1 ] - ] + ], + "id" : "Athanasius", + "name" : "Athanasius" }, { - "name" : "Avery Adams", - "id" : "Avery Adams", "data" : [ [ "Perl", @@ -228,9 +50,12 @@ "Blog", 2 ] - ] + ], + "id" : "Avery Adams", + "name" : "Avery Adams" }, { + "id" : "BarrOff", "data" : [ [ "Perl", @@ -241,52 +66,59 @@ 1 ] ], - "name" : "BarrOff", - "id" : "BarrOff" + "name" : "BarrOff" }, { + "name" : "Bob Lied", "data" : [ [ - "Raku", + "Perl", 2 ] ], + "id" : "Bob Lied" + }, + { "name" : "Bruce Gray", - "id" : "Bruce Gray" + "id" : "Bruce Gray", + "data" : [ + [ + "Raku", + 2 + ] + ] }, { + "name" : "Cheok-Yin Fung", "data" : [ [ "Perl", 2 ] ], - "name" : "Cheok-Yin Fung", "id" : "Cheok-Yin Fung" }, { - "name" : "David Ferrone", - "id" : "David Ferrone", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "David Ferrone", + "name" : "David Ferrone" }, { + "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] ], - "name" : "E. Choroba", - "id" : "E. Choroba" + "name" : "E. Choroba" }, { - "name" : "Flavio Poletti", - "id" : "Flavio Poletti", "data" : [ [ "Perl", @@ -300,9 +132,12 @@ "Blog", 2 ] - ] + ], + "id" : "Flavio Poletti", + "name" : "Flavio Poletti" }, { + "id" : "Jaldhar H. Vyas", "data" : [ [ "Perl", @@ -317,18 +152,17 @@ 1 ] ], - "id" : "Jaldhar H. Vyas", "name" : "Jaldhar H. Vyas" }, { + "name" : "Jan Krnavek", + "id" : "Jan Krnavek", "data" : [ [ "Raku", 1 ] - ], - "id" : "Jan Krnavek", - "name" : "Jan Krnavek" + ] }, { "data" : [ @@ -337,11 +171,10 @@ 2 ] ], - "name" : "Jorg Sommrey", - "id" : "Jorg Sommrey" + "id" : "Jorg Sommrey", + "name" : "Jorg Sommrey" }, { - "id" : "Laurent Rosenfeld", "name" : "Laurent Rosenfeld", "data" : [ [ @@ -356,21 +189,22 @@ "Blog", 1 ] - ] + ], + "id" : "Laurent Rosenfeld" }, { "name" : "Lubos Kolouch", - "id" : "Lubos Kolouch", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Lubos Kolouch" }, { - "id" : "Mark Anderson", "name" : "Mark Anderson", + "id" : "Mark Anderson", "data" : [ [ "Raku", @@ -389,32 +223,31 @@ 1 ] ], - "name" : "Matthias Muth", - "id" : "Matthias Muth" + "id" : "Matthias Muth", + "name" : "Matthias Muth" }, { - "id" : "Niels van Dijke", "name" : "Niels van Dijke", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Niels van Dijke" }, { - "id" : "Paulo Custodio", "name" : "Paulo Custodio", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Paulo Custodio" }, { "id" : "Peter Campbell Smith", - "name" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -424,11 +257,11 @@ "Blog", 1 ] - ] + ], + "name" : "Peter Campbell Smith" }, { "id" : "Robbie Hatley", - "name" : "Robbie Hatley", "data" : [ [ "Perl", @@ -438,10 +271,10 @@ "Blog", 1 ] - ] + ], + "name" : "Robbie Hatley" }, { - "id" : "Robert DiCicco", "name" : "Robert DiCicco", "data" : [ [ @@ -452,21 +285,20 @@ "Raku", 2 ] - ] + ], + "id" : "Robert DiCicco" }, { - "id" : "Robert Ransbottom", - "name" : "Robert Ransbottom", "data" : [ [ "Raku", 2 ] - ] + ], + "id" : "Robert Ransbottom", + "name" : "Robert Ransbottom" }, { - "name" : "Roger Bell_West", - "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -480,7 +312,9 @@ "Blog", 1 ] - ] + ], + "id" : "Roger Bell_West", + "name" : "Roger Bell_West" }, { "data" : [ @@ -498,17 +332,15 @@ }, { "id" : "Solathian", - "name" : "Solathian", "data" : [ [ "Perl", 1 ] - ] + ], + "name" : "Solathian" }, { - "id" : "Stephen G. Lynn", - "name" : "Stephen G. Lynn", "data" : [ [ "Perl", @@ -518,19 +350,22 @@ "Blog", 1 ] - ] + ], + "id" : "Stephen G. Lynn", + "name" : "Stephen G. Lynn" }, { + "name" : "Steven Wilson", "data" : [ [ "Perl", 1 ] ], - "id" : "Steven Wilson", - "name" : "Steven Wilson" + "id" : "Steven Wilson" }, { + "id" : "Thomas Kohler", "data" : [ [ "Perl", @@ -541,10 +376,10 @@ 2 ] ], - "id" : "Thomas Kohler", "name" : "Thomas Kohler" }, { + "name" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -555,11 +390,9 @@ 1 ] ], - "name" : "Ulrich Rieke", "id" : "Ulrich Rieke" }, { - "id" : "W. Luis Mochan", "name" : "W. Luis Mochan", "data" : [ [ @@ -570,13 +403,195 @@ "Blog", 1 ] - ] + ], + "id" : "W. Luis Mochan" } ] }, + "title" : { + "text" : "The Weekly Challenge - 218" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + }, + "series" : [ + { + "data" : [ + { + "y" : 3, + "drilldown" : "Arne Sommer", + "name" : "Arne Sommer" + }, + { + "y" : 2, + "drilldown" : "Athanasius", + "name" : "Athanasius" + }, + { + "name" : "Avery Adams", + "drilldown" : "Avery Adams", + "y" : 3 + }, + { + "drilldown" : "BarrOff", + "y" : 2, + "name" : "BarrOff" + }, + { + "name" : "Bob Lied", + "y" : 2, + "drilldown" : "Bob Lied" + }, + { + "name" : "Bruce Gray", + "y" : 2, + "drilldown" : "Bruce Gray" + }, + { + "drilldown" : "Cheok-Yin Fung", + "y" : 2, + "name" : "Cheok-Yin Fung" + }, + { + "drilldown" : "David Ferrone", + "y" : 2, + "name" : "David Ferrone" + }, + { + "name" : "E. Choroba", + "drilldown" : "E. Choroba", + "y" : 2 + }, + { + "drilldown" : "Flavio Poletti", + "y" : 6, + "name" : "Flavio Poletti" + }, + { + "drilldown" : "Jaldhar H. Vyas", + "y" : 5, + "name" : "Jaldhar H. Vyas" + }, + { + "name" : "Jan Krnavek", + "y" : 1, + "drilldown" : "Jan Krnavek" + }, + { + "y" : 2, + "drilldown" : "Jorg Sommrey", + "name" : "Jorg Sommrey" + }, + { + "name" : "Laurent Rosenfeld", + "drilldown" : "Laurent Rosenfeld", + "y" : 4 + }, + { + "drilldown" : "Lubos Kolouch", + "y" : 2, + "name" : "Lubos Kolouch" + }, + { + "y" : 2, + "drilldown" : "Mark Anderson", + "name" : "Mark Anderson" + }, + { + "name" : "Matthias Muth", + "drilldown" : "Matthias Muth", + "y" : 3 + }, + { + "y" : 2, + "drilldown" : "Niels van Dijke", + "name" : "Niels van Dijke" + }, + { + "name" : "Paulo Custodio", + "y" : 2, + "drilldown" : "Paulo Custodio" + }, + { + "name" : "Peter Campbell Smith", + "y" : 3, + "drilldown" : "Peter Campbell Smith" + }, + { + "name" : "Robbie Hatley", + "y" : 2, + "drilldown" : "Robbie Hatley" + }, + { + "name" : "Robert DiCicco", + "drilldown" : "Robert DiCicco", + "y" : 4 + }, + { + "name" : "Robert Ransbottom", + "y" : 2, + "drilldown" : "Robert Ransbottom" + }, + { + "name" : "Roger Bell_West", + "drilldown" : "Roger Bell_West", + "y" : 5 + }, + { + "y" : 3, + "drilldown" : "Simon Green", + "name" : "Simon Green" + }, + { + "y" : 1, + "drilldown" : "Solathian", + "name" : "Solathian" + }, + { + "name" : "Stephen G. Lynn", + "drilldown" : "Stephen G. Lynn", + "y" : 3 + }, + { + "y" : 1, + "drilldown" : "Steven Wilson", + "name" : "Steven Wilson" + }, + { + "name" : "Thomas Kohler", + "drilldown" : "Thomas Kohler", + "y" : 4 + }, + { + "name" : "Ulrich Rieke", + "drilldown" : "Ulrich Rieke", + "y" : 3 + }, + { + "y" : 3, + "drilldown" : "W. Luis Mochan", + "name" : "W. Luis Mochan" + } + ], + "name" : "The Weekly Challenge - 218", + "colorByPoint" : 1 + } + ], "yAxis" : { "title" : { "text" : "Total Solutions" } + }, + "legend" : { + "enabled" : 0 + }, + "subtitle" : { + "text" : "[Champions: 31] Last updated at 2023-06-17 07:59:52 GMT" } } diff --git a/stats/pwc-challenge-220.json b/stats/pwc-challenge-220.json new file mode 100644 index 0000000000..06117ae5b4 --- /dev/null +++ b/stats/pwc-challenge-220.json @@ -0,0 +1,620 @@ +{ + "xAxis" : { + "type" : "category" + }, + "chart" : { + "type" : "column" + }, + "tooltip" : { + "pointFormat" : "{point.name}: {point.y:f}
", + "followPointer" : 1, + "headerFormat" : "{series.name}
" + }, + "drilldown" : { + "series" : [ + { + "name" : "Ali Moradi", + "id" : "Ali Moradi", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "id" : "Arne Sommer", + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Arne Sommer" + }, + { + "id" : "Athanasius", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "name" : "Athanasius" + }, + { + "data" : [ + [ + "Perl", + 1 + ], + [ + "Blog", + 2 + ] + ], + "id" : "Avery Adams", + "name" : "Avery Adams" + }, + { + "data" : [ + [ + "Perl", + 1 + ], + [ + "Raku", + 2 + ] +