From 3a0d3971fee4f0e88baa2cf83e7a4a33b24ca8ec Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Mon, 23 Jan 2023 01:51:15 +0000 Subject: - Added solutions by Roger Bell_West. - Added solutions by Dave Jacoby. - Added solutions by David Ferrone. - Added solutions by Luca Ferrari. - Added solutions by Mark Anderson. - Added solutions by W. Luis Mochan. - Added solutions by Peter Campbell Smith. - Added solutions by Mariano Spadaccini. - Added solutions by Thomas Kohler. - Added solutions by Bob Lied. - Added solutions by Jorg Sommrey. - Added solutions by Flavio Poletti. - Added solutions by Pip Stuart. - Added solutions by E. Choroba. - Added solutions by Stephen G. Lynn. - Added solutions by Matthew Neleigh. - Added solutions by Robert Ransbottom. - Added solutions by Athanasius. - Added solutions by Simon Green. - Added solutions by Cheok-Yin Fung. - Added solutions by Tyler Wardhaugh. - Added solutions by Jan Krnavek. - Added solutions by Bruce Gray. - Added solutions by James Smith. - Added solutions by Robbie Hatley. - Added solutions by Solathian. - Added solutions by Arne Sommer. - Added solutions by Carlos Oliveira. - Added solutions by Marton Polgar. - Added solutions by Adam Russell. - Added solutions by Duncan C. White. - Added solutions by Lars Balker. - Added solutions by Colin Crain. - Added solutions by Laurent Rosenfeld. - Added solutions by Robert DiCicco. - Added solutions by Ulrich Rieke. --- challenge-199/eric-cheung/python/ch-1.py | 20 + challenge-199/eric-cheung/python/ch-2.py | 25 + challenge-200/colin-crain/blog.txt | 1 + challenge-200/colin-crain/perl/ch-1.pl | 78 ++ challenge-200/colin-crain/perl/ch-2.pl | 89 ++ challenge-200/eric-cheung/python/ch-1.py | 25 + challenge-200/eric-cheung/python/ch-2.py | 11 + challenge-200/lars-balker/perl/ch-2.pl | 47 + challenge-200/laurent-rosenfeld/blog.txt | 1 + challenge-200/laurent-rosenfeld/perl/ch-1.pl | 22 + challenge-200/laurent-rosenfeld/perl/ch-2.pl | 34 + challenge-200/laurent-rosenfeld/raku/ch-1.raku | 15 + challenge-200/laurent-rosenfeld/raku/ch-2.raku | 29 + challenge-200/robert-dicicco/julia/ch-1.jl | 127 ++ challenge-200/robert-dicicco/perl/ch-1.pl | 125 ++ challenge-200/robert-dicicco/raku/ch-1.raku | 123 ++ challenge-200/robert-dicicco/ruby/ch-1.rb | 121 ++ challenge-200/spadacciniweb/README | 2 +- challenge-200/ulrich-rieke/haskell/ch-1.hs | 28 + challenge-200/ulrich-rieke/perl/ch-1.pl | 40 + challenge-200/ulrich-rieke/perl/ch-2.pl | 84 ++ challenge-200/ulrich-rieke/raku/ch-1.raku | 33 + challenge-200/ulrich-rieke/raku/ch-2.raku | 102 ++ challenge-200/ulrich-rieke/rust/ch-1.rs | 40 + members.json | 1 + stats/pwc-challenge-198.json | 307 +++-- stats/pwc-challenge-199.json | 673 +++++++++ stats/pwc-current.json | 621 ++++----- stats/pwc-language-breakdown-summary.json | 54 +- stats/pwc-language-breakdown.json | 1395 +++++++++---------- stats/pwc-leaders.json | 512 +++---- stats/pwc-summary-1-30.json | 108 +- stats/pwc-summary-121-150.json | 42 +- stats/pwc-summary-151-180.json | 64 +- stats/pwc-summary-181-210.json | 128 +- stats/pwc-summary-211-240.json | 74 +- stats/pwc-summary-241-270.json | 76 +- stats/pwc-summary-271-300.json | 44 +- stats/pwc-summary-31-60.json | 122 +- stats/pwc-summary-61-90.json | 44 +- stats/pwc-summary-91-120.json | 108 +- stats/pwc-summary.json | 1748 ++++++++++++------------ 42 files changed, 4651 insertions(+), 2692 deletions(-) create mode 100755 challenge-199/eric-cheung/python/ch-1.py create mode 100755 challenge-199/eric-cheung/python/ch-2.py create mode 100644 challenge-200/colin-crain/blog.txt create mode 100755 challenge-200/colin-crain/perl/ch-1.pl create mode 100755 challenge-200/colin-crain/perl/ch-2.pl create mode 100755 challenge-200/eric-cheung/python/ch-1.py create mode 100755 challenge-200/eric-cheung/python/ch-2.py create mode 100755 challenge-200/lars-balker/perl/ch-2.pl create mode 100644 challenge-200/laurent-rosenfeld/blog.txt create mode 100644 challenge-200/laurent-rosenfeld/perl/ch-1.pl create mode 100644 challenge-200/laurent-rosenfeld/perl/ch-2.pl create mode 100644 challenge-200/laurent-rosenfeld/raku/ch-1.raku create mode 100644 challenge-200/laurent-rosenfeld/raku/ch-2.raku create mode 100644 challenge-200/robert-dicicco/julia/ch-1.jl create mode 100644 challenge-200/robert-dicicco/perl/ch-1.pl create mode 100644 challenge-200/robert-dicicco/raku/ch-1.raku create mode 100644 challenge-200/robert-dicicco/ruby/ch-1.rb create mode 100644 challenge-200/ulrich-rieke/haskell/ch-1.hs create mode 100644 challenge-200/ulrich-rieke/perl/ch-1.pl create mode 100644 challenge-200/ulrich-rieke/perl/ch-2.pl create mode 100644 challenge-200/ulrich-rieke/raku/ch-1.raku create mode 100644 challenge-200/ulrich-rieke/raku/ch-2.raku create mode 100644 challenge-200/ulrich-rieke/rust/ch-1.rs create mode 100644 stats/pwc-challenge-199.json diff --git a/challenge-199/eric-cheung/python/ch-1.py b/challenge-199/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..5227a2c7b1 --- /dev/null +++ b/challenge-199/eric-cheung/python/ch-1.py @@ -0,0 +1,20 @@ + +from itertools import combinations + +def get_GoodPairs_List(arrInput): + + arrGoodPairsList = [] + + nIndxTuple = combinations(range(0, len(arrInput)), 2) + + for nIndxLoop_01, nIndxLoop_02 in list(nIndxTuple): + if arrInput[nIndxLoop_01] == arrInput[nIndxLoop_02]: + arrGoodPairsList.append([nIndxLoop_01, nIndxLoop_02]) + + return arrGoodPairsList + +## arrInputList = [1, 2, 3, 1, 1, 3] ## Example 1 +## arrInputList = [1, 2, 3] ## Example 2 +arrInputList = [1, 1, 1, 1] ## Example 3 + +print (len(get_GoodPairs_List(arrInputList))) diff --git a/challenge-199/eric-cheung/python/ch-2.py b/challenge-199/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..2ed1c89d29 --- /dev/null +++ b/challenge-199/eric-cheung/python/ch-2.py @@ -0,0 +1,25 @@ + +from itertools import combinations + +def get_GoodTriplets_List(arrInput, arrInputInt): + + arrGoodPairsList = [] + + nIndxTuple = combinations(range(0, len(arrInput)), 3) + + for nIndxLoop_01, nIndxLoop_02, nIndxLoop_03 in list(nIndxTuple): + if abs(arrInput[nIndxLoop_01] - arrInput[nIndxLoop_02]) <= arrInputInt[0] and abs(arrInput[nIndxLoop_02] - arrInput[nIndxLoop_03]) <= arrInputInt[1] and abs(arrInput[nIndxLoop_01] - arrInput[nIndxLoop_03]) <= arrInputInt[2]: + arrGoodPairsList.append([nIndxLoop_01, nIndxLoop_02, nIndxLoop_03]) + + return arrGoodPairsList + + +## Example 1 +## arrInputList = [3, 0, 1, 1, 9, 7] +## arrInputList_Int = [7, 2, 3] + +## Example 2 +arrInputList = [1, 1, 2, 2, 3] +arrInputList_Int = [0, 0, 1] + +print (len(get_GoodTriplets_List(arrInputList, arrInputList_Int))) diff --git a/challenge-200/colin-crain/blog.txt b/challenge-200/colin-crain/blog.txt new file mode 100644 index 0000000000..de69cd7720 --- /dev/null +++ b/challenge-200/colin-crain/blog.txt @@ -0,0 +1 @@ +https://colincrain.com/2023/01/22/seven-segments-to-midnight diff --git a/challenge-200/colin-crain/perl/ch-1.pl b/challenge-200/colin-crain/perl/ch-1.pl new file mode 100755 index 0000000000..3afdc4e84e --- /dev/null +++ b/challenge-200/colin-crain/perl/ch-1.pl @@ -0,0 +1,78 @@ +#!/Users/colincrain/perl5/perlbrew/perls/perl-5.32.0/bin/perl +# +# arithmetic-sequences.pl +# +# Arithmetic Slices +# Submitted by: Mohammad S Anwar +# You are given an array of integers. +# +# Write a script to find out all Arithmetic Slices for the given +# array of integers. +# +# An integer array is called arithmetic if it has at least 3 +# elements and the differences between any three consecutive +# elements are the same. +# +# +# Example 1 +# Input: @array = (1,2,3,4) +# Output: (1,2,3), (2,3,4), (1,2,3,4) +# +# Example 2 +# Input: @array = (2) +# Output: () as no slice found. +# +# +# method: +# +# we work from left to right. Starting at element [0], we look +# ahead to element [1]. We set the $last difference as the +# difference between elements [1] and [0]. We then look to +# element 2. If the difference between it and [1] is the same +# we have a sequence: store the slice between our starting and +# ending positions as a nested array in @out. +# +# We then move through the rest of the array as long as the +# difference between adjacent elements remains the same as the +# last difference. If it is, again store the slice from the start to +# current lookahead in @out as well. +# +# On failure move the start position up one and begin to search again. +# +# Stop two places from the end position, as that is the minimal space to +# find a new sequence. +# +# © 2022 colin crain +## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## + + + +use warnings; +use strict; +use utf8; +use feature ":5.26"; +use feature qw(signatures); +no warnings 'experimental::signatures'; + + +my @arr = @ARGV; +@arr == 0 and @arr = (1,2,3,5,7,9,6,3,0,-3); + +my @out; +my $last; +my $curr; + +for (0..$#arr-2) { + $curr = $_+1; + $last = $arr[$_+1] - $arr[$_]; + while ($arr[$curr+1] - $arr[$curr] == $last) { + push @out, [ @arr[$_..$curr+1] ]; + last if ++$curr == $#arr; + } +} + +say "$_->@*" for @out; + + + + diff --git a/challenge-200/colin-crain/perl/ch-2.pl b/challenge-200/colin-crain/perl/ch-2.pl new file mode 100755 index 0000000000..b328ae1429 --- /dev/null +++ b/challenge-200/colin-crain/perl/ch-2.pl @@ -0,0 +1,89 @@ +#!/Users/colincrain/perl5/perlbrew/perls/perl-5.32.0/bin/perl +# +# seven-seconds.pl +# +# Seven Segment 200 +# Submitted by: Ryan J Thompson +# +# A seven segment display is an electronic component, usually used +# to display digits. The segments are labeled 'a' through 'g' as +# shown: +# +# a +# f b +# g +# e c +# d +# +# The encoding of each digit can thus be represented compactly as a +# truth table: +# +# my @truth = qw; For example, $truth[1] = ‘bc’. The digit 1 would +# have segments ‘b’ and ‘c’ enabled. +# +# Write a program that accepts any decimal number and draws that +# number as a horizontal sequence of ASCII seven segment displays, +# similar to the following: +# +# +# ------- ------- ------- +# | | | | | +# | | | | | +# ------- +# | | | | | +# | | | | | +# ------- ------- ------- +# +# To qualify as a seven segment display, each segment must be drawn +# (or not drawn) according to your @truth table. +# +# The number "200" was of course chosen to celebrate our 200th +# week! +# +# +# +# © 2022 colin crain +## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## + + + +use warnings; +use strict; +use utf8; +use feature ":5.26"; +use feature qw(signatures); +no warnings 'experimental::signatures'; +use open ':std', ':encoding(UTF-8)'; + +## given encoding method +my @truth = qw( abcdef bc abdeg abcdg bcfg acdfg acdefg abc abcdefg abcfg ); + +## input +my $num = shift @ARGV // 31415926; +my @out; + +for my $d (split //, $num) { + $out[0] .= $truth[$d] =~ s/(a?)[bcdefg]*/ $1 ? ' ╺╸ ' : ' '/er; + $out[1] .= reverse $truth[$d] =~ s/a?(b?)[cde]*(f?)g?/ + ($1 ? '┃' : ' ') + . ' ' + . ($2 ? '┃' : ' ')/er; + $out[2] .= $truth[$d] =~ s/[abcdef]*(g?)/ $1 ? ' ━━ ' : ' '/er; + $out[3] .= reverse $truth[$d] =~ s/a?b?(c?)d?(e?)f?g?/ + ($1 ? '┃' : ' ') + . ' ' + . ($2 ? '┃' : ' ')/er; + $out[4] .= $truth[$d] =~ s/[abc]*(d?)[efg]*/$1 ? ' ╺╸ ' : ' '/er; + + $out[$_] .= ' ' for (0..4); +} + +## output +for my $i (0..4) { + say $out[$i]; +} + + + + diff --git a/challenge-200/eric-cheung/python/ch-1.py b/challenge-200/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..74f509b821 --- /dev/null +++ b/challenge-200/eric-cheung/python/ch-1.py @@ -0,0 +1,25 @@ + +## arrInput = [1, 2, 3, 4] ## Example 1 +arrInput = [2] ## Example 2 + +def IsArithmetic(arrSubInput): + + if len(arrSubInput) < 3: + return False + + nDiff = arrSubInput[1] - arrSubInput[0] + + for nLoop in range(2, len(arrSubInput)): + if arrSubInput[nLoop] - arrSubInput[nLoop - 1] != nDiff: + return False + + return True + +arrOutput = [] + +for nLen in range(3, len(arrInput) + 1): + for nIndx in range(0, len(arrInput) - nLen + 1): + if IsArithmetic(arrInput[nIndx:nIndx + nLen]): + arrOutput.append(arrInput[nIndx:nIndx + nLen]) + +print (arrOutput) \ No newline at end of file diff --git a/challenge-200/eric-cheung/python/ch-2.py b/challenge-200/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..e6ca0422eb --- /dev/null +++ b/challenge-200/eric-cheung/python/ch-2.py @@ -0,0 +1,11 @@ + +## Remarks +## https://pypi.org/project/sevseg/ +## https://inventwithpython.com/bigbookpython/project64.html +## + +import sevseg + +nInput = 200 + +print (sevseg.getSevSegStr(nInput, 1)) diff --git a/challenge-200/lars-balker/perl/ch-2.pl b/challenge-200/lars-balker/perl/ch-2.pl new file mode 100755 index 0000000000..070ae1d18a --- /dev/null +++ b/challenge-200/lars-balker/perl/ch-2.pl @@ -0,0 +1,47 @@ +use v5.30; + +my @array = (1,2,3,4); +# Output: (1,2,3), (2,3,4), (1,2,3,4) + +my @res; +for my $length (3 .. @array) { + I: + for my $i (0 .. @array - $length) { + my $delta = $array[$i + 1] - $array[$i]; + my $j = 1; + while ($j + 1 < $length) { + next I if $array[$i + $j + 1] - $array[$i + $j] != $delta; + $j++; + } + push @res, [ @array[ $i .. $i + $length - 1 ] ]; + } +} +@res = ([]) unless @res; +say join ", ", map { "(" . (join ",", @$_) . ")" } @res; + + + + +my @truth = qw; + +my @input = split //, "200"; + +my @out = ("aaaaaaa ", + "f b ", + "f b ", + "ggggggg ", + "e c ", + "e c ", + "ddddddd "); +my %symbol = qw/ a - b | c | d - e | f | g - /; + +for my $line (0..$#out) { + for my $digit (@input) { + my @show = split //, $truth[$digit]; + my $out = $out[$line]; + $out =~ s/$_/$symbol{$_}/g for @show; + $out =~ s/[a-g]/ /g; + print $out; + } + print "\n"; +} diff --git a/challenge-200/laurent-rosenfeld/blog.txt b/challenge-200/laurent-rosenfeld/blog.txt new file mode 100644 index 0000000000..82acaae7a9 --- /dev/null +++ b/challenge-200/laurent-rosenfeld/blog.txt @@ -0,0 +1 @@ +https://blogs.perl.org/users/laurent_r/2023/01/perl-weekly-challenge-200-arithmetic-slices-and-seven-segment-display.html diff --git a/challenge-200/laurent-rosenfeld/perl/ch-1.pl b/challenge-200/laurent-rosenfeld/perl/ch-1.pl new file mode 100644 index 0000000000..8fa13a071a --- /dev/null +++ b/challenge-200/laurent-rosenfeld/perl/ch-1.pl @@ -0,0 +1,22 @@ +use strict; +use warnings; +use feature "say"; + +sub find_slices { + my @in = @_; + my @out; + # return [] if @in < 3; + for my $i (0..$#in - 2) { + my $gap = $in[$i+1] - $in[$i]; + for my $j ($i+2..$#in) { + last if $in[$j] - $in[$j-1] != $gap; + push @out, [@in[$i..$j]]; + } + } + return @out ? @out : []; +} +for my $test ([<1 2 3 4>], [<2 5>], [<3 4 5 6 8>], + [<3 5 7 9>], [<2 5 9>]) { + printf "%-10s => ", "@$test"; + say map "(@$_) ", find_slices @$test; +} diff --git a/challenge-200/laurent-rosenfeld/perl/ch-2.pl b/challenge-200/laurent-rosenfeld/perl/ch-2.pl new file mode 100644 index 0000000000..99a8927fa4 --- /dev/null +++ b/challenge-200/laurent-rosenfeld/perl/ch-2.pl @@ -0,0 +1,34 @@ +use strict; +use warnings; +use feature "say"; + +my %c; # ascii coding of digit's slices +$c{'h'} = "-" x 7; # Horizontal line +$c{'l'} = "| "; # Vertical bar, left +$c{'r'} = " |"; # Vertical bar, right +$c{'2'} = "| |"; # 2 vertical bars +$c{'n'} = " " x 7; # empty horizontal line + +my @nums = ( # Digit hoirizontal slices + [], # 0 + [], # 1 + [], # 2 + [], # 3 + [], # 4 + [], # 5 + [], # 6 + [], # 7 + [], # 8 + []); # 9 + + +sub display{ + my @digits = split //, shift; + for my $l (0..6) { + say join " ", map {$c{$nums[$_][$l]}} @digits; + } +} + +for my $test (<200 2023 01234 56789>) { + display $test; +} diff --git a/challenge-200/laurent-rosenfeld/raku/ch-1.raku b/challenge-200/laurent-rosenfeld/raku/ch-1.raku new file mode 100644 index 0000000000..704c39bea3 --- /dev/null +++ b/challenge-200/laurent-rosenfeld/raku/ch-1.raku @@ -0,0 +1,15 @@ +sub find_slices (@in) { + my @out; + return @out if @in.elems < 3; + for 0..@in.end - 2 -> $i { + my $gap = @in[$i+1] - @in[$i]; + for $i+2..@in.end -> $j { + last if @in[$j] - @in[$j-1] != $gap; + push @out, @in[$i..$j]; + } + } + return @out; +} +for <1 2 3 4>, <2 5>, <3 5 7 9>, <2 5 9> -> @test { + say (~@test).fmt("%-10s => "), find_slices @test; +} diff --git a/challenge-200/laurent-rosenfeld/raku/ch-2.raku b/challenge-200/laurent-rosenfeld/raku/ch-2.raku new file mode 100644 index 0000000000..55ce30bb4a --- /dev/null +++ b/challenge-200/laurent-rosenfeld/raku/ch-2.raku @@ -0,0 +1,29 @@ +my %c; # ascii coding of digit's slices +%c = "-" x 7; # Horizontal line +%c = "| "; # Vertical bar, left +%c = " |"; # Vertical bar, right +%c<2> = "| |"; # 2 vertical bars +%c = " " x 7; # empty horizontal line + +my @nums = # Digit horizontal slices + , # 0 + , # 1 + , # 2 + , # 3 + , # 4 + , # 5 + , # 6 + , # 7 + , # 8 + ; # 9 + +sub display ($num) { + my @digits = $num.comb; + for 0..6 -> $l { # Lines 0 to 6 iof the display + say join " ", map {%c{@nums[$_][$l]}}, @digits; + } +} + +for <200 2023 01234 56789> -> $test { + display $test; +} diff --git a/challenge-200/robert-dicicco/julia/ch-1.jl b/challenge-200/robert-dicicco/julia/ch-1.jl new file mode 100644 index 0000000000..3725469509 --- /dev/null +++ b/challenge-200/robert-dicicco/julia/ch-1.jl @@ -0,0 +1,127 @@ +#!/usr/bin/env julia + +#= + +AUTHOR: Robert DiCicco + +DATE: 01-18-2023 + +Challenge #200 Arithmetic Slices ( Julia ) + +=# + +using Printf + +  + +lists = [[1,2,3,4],[2]] + +out = [] + +  + +function GetIntervals(slice) + + if length(slice) < 3 + + return -1 + + end + + x = 1 + +                + + while x < length(slice) + + if x > 1 + + interval = slice[x] - slice[x-1] + + push!(out, interval) + + end + + x += 1 + + end + + testval = out[1] + + for arrint in out + + if arrint != testval + + return -1 + + end + + end + + return 1 + +end + +  + +for list in lists + + cnt = 1 + + @printf("Input: @array = %s\n", list) + + slice = Int64[] + + @printf("Output: ") + + while cnt < length(list)-1 + + push!(slice, list[cnt]) + + push!(slice, list[cnt + 1]) + + push!(slice, list[cnt + 2]) + + if length(slice) == 3 + + retval = GetIntervals(slice) + + if retval == 1 + + @printf("%s ",slice) + + end + + end + + cnt += 1 + + slice = Int64[] + + end + + ret = GetIntervals(list) + + ret == 1 ? (println(list); println(" ")) : println("()") + +end + +  + +#= + +SAMPLE OUTPUT + +julia .\ArithmeticSlices.jl + +Input: @array = [1, 2, 3, 4] + +Output: [1, 2, 3] [2, 3, 4] [1, 2, 3, 4] + +  + +Input: @array = [2] + +Output: () + +=# diff --git a/challenge-200/robert-dicicco/perl/ch-1.pl b/challenge-200/robert-dicicco/perl/ch-1.pl new file mode 100644 index 0000000000..b9881772c3 --- /dev/null +++ b/challenge-200/robert-dicicco/perl/ch-1.pl @@ -0,0 +1,125 @@ +#!/usr/bin/env perl + +=begin comment + +AUTHOR: Robert DiCicco + +DATE: 01-18-2023 + +Challenge #200 Arithmetic Slices ( Perl ) + +=cut + +  + +use strict; + +use warnings; + +  + +my @out = (); + +  + +sub GetIntervals { + + my $slice = shift; + + return -1 if (scalar @$slice < 3); + + my $x = 0; + +                                + + while ( $x < scalar @$slice ) { + + if ( $x > 0 ) { + + my $interval = $slice->[$x] - $slice->[$x-1]; + + push(@out, $interval ); + + } + + $x++; + + } + + my $testval = $out[0]; + + for my $arrint (@out) { + + if ( $arrint != $testval ){ + + return -1; + + } + + } + + return 1; + +} + +  + +my @lists = ([1,2,3,4],[2]); + +  + +for my $list (@lists) { + + my $cnt = 0; + + print("Input: \@array = \[@$list\]\n"); + + my @slice = (); + + print("Output: "); + + while( $cnt < scalar @$list - 2) { + + @slice = @$list[$cnt..$cnt+2]; + + if (scalar @slice == 3) { + + my $retval = GetIntervals(\@slice); + + if ($retval == 1 ) { print("[@slice] ")}; + + } + + $cnt++; + + @slice = (); + + } + + my $ret = GetIntervals(\@$list); + + $ret == 1 ? print("[@$list]\n") : print("()\n"); + + print("\n"); + +} + +  + +=begin + +SAMPLE OUTPUT + +perl .\ArithmeticSlices.pl + +Input: @array = [1 2 3 4] + +Output: [1 2 3] [2 3 4] [1 2 3 4] + +  + +Input: @array = [2] + +Output: () + +=cut diff --git a/challenge-200/robert-dicicco/raku/ch-1.raku b/challenge-200/robert-dicicco/raku/ch-1.raku new file mode 100644 index 0000000000..231803904f --- /dev/null +++ b/challenge-200/robert-dicicco/raku/ch-1.raku @@ -0,0 +1,123 @@ +#/usr/bin/env raku + +=begin comment + +AUTHOR: Robert DiCicco + +DATE: 01-18-2023 + +Challenge #200 Arithmetic Slices ( Raku ) + +=end comment + +use v6; + +  + +my @out = (); + +my @lists = ([1,2,3,4],[2]); + +  + +sub GetIntervals(@slice) { + + return -1 if (@slice.elems < 3); + + my $x = 0; + +                                + + while ( $x < @slice.elems ) { + + if ( $x > 0 ) { + + my $interval = @slice[$x] - @slice[$x-1]; + + @out.push: $interval; + + } + + $x++; + + } + + my $testval = @out[0]; + + for (@out) -> $arrint { + + if ( $arrint != $testval ) { + + return -1; + + } + + } + + return 1; + +} + +  + +for (@lists) -> @list { + + my $cnt = 0; + + print("Input: \@array = \[",@list,"\]\n"); + + my @slice; + + print("Output: "); + + while $cnt < @list.elems - 2 { + + @slice = @list[$cnt..$cnt+2]; + + if @slice.elems == 3 { + + my $retval = GetIntervals(@slice); + + if $retval == 1 { + + print("[",@slice,"] "); + + } + + } + + $cnt++; + + @slice = (); + + } + + my $ret = GetIntervals(@list); + + $ret == 1 ?? print("[",@list,"]\n") !! print("()\n"); + + print("\n"); + +} + +  + +  + +=begin comment + +SAMPLE OUTPUT + +raku .\ArithmeticSlices.rk + +Input: @array = [1 2 3 4] + +Output: [1 2 3] [2 3 4] [1 2 3 4] + +  + +Input: @array = [2] + +Output: () + +=end comment diff --git a/challenge-200/robert-dicicco/ruby/ch-1.rb b/challenge-200/robert-dicicco/ruby/ch-1.rb new file mode 100644 index 0000000000..90512f81ad --- /dev/null +++ b/challenge-200/robert-dicicco/ruby/ch-1.rb @@ -0,0 +1,121 @@ +#!/usr/bin/env ruby + +=begin + +AUTHOR: Robert DiCicco + +DATE: 01-18-2023 + +Challenge #200 Arithmetic Slices ( Ruby ) + +=end + +  + +lists = [[1,2,3,4],[2]] + +$out = Array.new + +  + +def GetIntervals(slice) + + if slice.length < 3 then + + return(-1) + + end + + x = 0 + +                                + + while ( x < slice.length() ) + + if ( x > 0 ) + + interval = slice[x] - slice[x-1] + + $out.push(interval) + + end + + x += 1 + + end + + testval = $out[0] + + $out.each do |arrint| + + if ( arrint != testval ) + + return -1; + + end + + end + + return 1; + +end + +  + +lists.each do |list| + + cnt = 0 + + puts("Input: @array = #{list}"); + + slice = Array.new + + print("Output: ") + + while cnt < list.length() + + slice = list[cnt, 3] + + if slice.length == 3 + + retval = GetIntervals(slice) + + if retval == 1 + + print("#{slice} ") + + end + + end + + cnt = cnt + 1 + + slice = Array.new() + + end + + ret = GetIntervals(list) + + ret == 1 ? (puts("#{list}");puts(" ")) : puts("()"); + +end + +  + +=begin + +SAMPLE OUTPUT + +ruby .\ArithmeticSlices.rb + +Input: @array = [1, 2, 3, 4] + +Output: [1, 2, 3] [2, 3, 4] [1, 2, 3, 4] + +  + +Input: @array = [2] + +Output: () + +=end diff --git a/challenge-200/spadacciniweb/README b/challenge-200/spadacciniweb/README index 8d335de4c1..45f6424dde 100644 --- a/challenge-200/spadacciniweb/README +++ b/challenge-200/spadacciniweb/README @@ -1 +1 @@ -Solution by Mariano Spadaccini. +Solutions by Mariano Spadaccini. diff --git a/challenge-200/ulrich-rieke/haskell/ch-1.hs b/challenge-200/ulrich-rieke/haskell/ch-1.hs new file mode 100644 index 0000000000..71195f0f27 --- /dev/null +++ b/challenge-200/ulrich-rieke/haskell/ch-1.hs @@ -0,0 +1,28 @@ +module Challenge200 + where +import Data.List.Split ( divvy ) +import qualified Data.Set as S + +combinations :: Int -> [a] -> [[a]] +combinations 0 _ = [[]] +combinations n xs = [ xs !! i : x | i <- [0..(length xs ) - 1 ] , +x <- combinations (n - 1 ) ( drop ( i + 1 ) xs ) ] +  +solution :: [Int] -> [[Int]]  +solution list + |l < 3 = [] + |otherwise = filter myCondition $ concat $ map (\i -> combinations i list ) + [3..l] + where + l :: Int + l = length list + myCondition :: [Int] -> Bool + myCondition li = length ( S.toList $ S.fromList (map (\subl -> + last subl - head subl ) $ divvy 2 1 li )) == 1 + +main :: IO ( ) +main = do + putStrLn "Please enter some integers, separated by a blank!" + numberline <- getLine + let numbers = map read $ words numberline + print $ solution numbers diff --git a/challenge-200/ulrich-rieke/perl/ch-1.pl b/challenge-200/ulrich-rieke/perl/ch-1.pl new file mode 100644 index 0000000000..b4828ea56b --- /dev/null +++ b/challenge-200/ulrich-rieke/perl/ch-1.pl @@ -0,0 +1,40 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; +use Algorithm::Combinatorics qw ( combinations ) ; +use List::Util qw ( all ) ; + +sub myCondition { + my $array = shift ; + my $len = scalar( @$array ) ; + my @differences ; + for my $i (0.. $len - 2 ) { + push @differences , $array->[$i + 1] - $array->[ $i ] ; + } + return all { $_ == $differences[ 0 ] } @differences ; +} + +say "Please enter some integers, separated by a blank!" ; +my $line = ; +chomp $line ; +my @numbers = split( /\s/ , $line ) ; +my $len = scalar( @numbers ) ; +if ( $len < 3 ) { + say "()" ; +} +else { + my $fulfilled = 0 ; + for my $l (3..$len) { + my $iter = combinations(\@numbers , $l ) ; + while ( my $p = $iter->next ) { + if ( myCondition( $p ) ) { + say "(" . join( ',' , @$p ) . ")" ; + $fulfilled = 1 ; + } + } + unless ( $fulfilled ) { + say "( )" ; + } + } +} diff --git a/challenge-200/ulrich-rieke/perl/ch-2.pl b/challenge-200/ulrich-rieke/perl/ch-2.pl new file mode 100644 index 0000000000..fc39458c86 --- /dev/null +++ b/challenge-200/ulrich-rieke/perl/ch-2.pl @@ -0,0 +1,84 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; + +sub printHorizontal { #logic for horizontal segments + my $printOrder = shift ; + my $len = length $printOrder ; + for my $pos ( 0..$len - 1 ) { + if ( substr( $printOrder , $pos , 1 ) eq '1' ) { + print '-' x 7 ; + } + else { + print ' ' x 7 ; + } + print ' ' x 3 ; #print interdigit space + } + say ' ' ; +} + +sub printVertical {#logic for vertical segments which are printed twice + my $printOrder = shift ; + my $len = shift ; + for (1 .. 2 ) { + for my $pos( 0 .. $len - 1 ) { + if ( substr( $printOrder , $pos , 1 ) eq '1' ) { + print '|' ; + } + else { + print ' ' ; + } + if ( substr( $printOrder , $pos + $len , 1 ) eq '1' ) { + print (' ' x 5 . '|' ) ; + } + else { + print ' ' x 6 ; + } + print ' ' x 3 ; + } + say ' ' ; + } +} + +my $number = $ARGV[0] ; +my @digits ; +while ( $number != 0 ) { + push @digits , $number % 10 ; + $number = int( $number / 10 ) ; +} +@digits = reverse @digits ; +my @truth = qw ; +my @selected ; #which truth table entries represend the digits entered ? +for my $n ( @digits ) { + if ( $n <= 5 ) { + push @selected , $truth[ $n ] ; + } + else { + push @selected , $truth[ $n + 1 ] ; + } +} +my $finalLetterOrder ; +for my $char ( 'a' , 'f' , 'b' , 'g' , 'e' , 'c' , 'd' ) { + for my $table ( @selected ) { + my %letters ; + my @singleLetters = split( // , $table ) ; + map { $letters{$_}++ } @singleLetters ; + if ( exists $letters{ $char } ) { + $finalLetterOrder .= '1' ; + } + else { + $finalLetterOrder .= '0' ; + } + } +} +my $len = scalar( @digits ) ; +printHorizontal(substr( $finalLetterOrder , 0 , $len )) ;#segment 'a' +#then segment 'f' and 'b' +printVertical( substr( $finalLetterOrder , $len , 2 * $len ) , $len ) ; +#segment 'g' +printHorizontal( substr( $finalLetterOrder , 3 * $len , $len ) ) ; +#segment 'e' and 'c' +printVertical( substr( $finalLetterOrder , 4 * $len , 2 * $len ) , $len ) ; +#segment 'd' +printHorizontal( substr( $finalLetterOrder , 6 * $len , $len ) ) ; diff --git a/challenge-200/ulrich-rieke/raku/ch-1.raku b/challenge-200/ulrich-rieke/raku/ch-1.raku new file mode 100644 index 0000000000..a939d71697 --- /dev/null +++ b/challenge-200/ulrich-rieke/raku/ch-1.raku @@ -0,0 +1,33 @@ +use v6 ; + +sub myCondition( $array ) { + my $len = $array.elems ; + my @differences ; + for (0..$len - 2 ) -> $i { + @differences.push( $array[ $i + 1 ] - $array[ $i ] ) ; + } + my $set = @differences.Set ; + return $set.elems == 1 ; +} + +say "Please enter some numbers, separated by a blank!" ; +my $line = $*IN.get ; +my @numbers = $line.words.map( {.Int} ) ; +my $len = @numbers.elems ; +if ( $len < 3 ) { + say "()" ; +} +else { + my $fulfilled = False ; + for (3..$len) -> $l { + for @numbers.combinations( $l ) -> $combi { + if ( myCondition( $combi ) ) { + say "(" ~ $combi ~ ")" ; + $fulfilled = True ; + } + } + } + unless $fulfilled { + say "()" ; + } +} diff --git a/challenge-200/ulrich-rieke/raku/ch-2.raku b/challenge-200/ulrich-rieke/raku/ch-2.raku new file mode 100644 index 0000000000..dcc03c13ad --- /dev/null +++ b/challenge-200/ulrich-rieke/raku/ch-2.raku @@ -0,0 +1,102 @@ +use v6 ; + +sub MAIN( Int $number is copy ) { + my @digits ; + while ( $number != 0 ) { + @digits.push( $number % 10 ) ; + $number div= 10 ; + } + @digits .=reverse ; + my @truth = ; + my @selected ; #which truth elements are in the number entered ? + for @digits -> $n { + if ( $n <= 5 ) { + @selected.push( @truth[ $n ] ) ; + } + else { + @selected.push( @truth[ $n + 1 ] ) ; + } + } + my $finalLetterOrder ;#if a segment is printed , put '1' , else put 0 +#starting with a, then f, b and so on + for -> $aChar {#this is the order to observe + for @selected -> $table { + my $set = $table.comb.Set ; #set of letters in the selected entry + if ( $aChar (elem) $set ) { + $finalLetterOrder ~= '1' ; + } + else { + $finalLetterOrder ~= '0' ; + } + } + } + my $len = @digits.elems ; + for (0..$len - 1 ) -> $pos {#print 'a' segment + if ( $finalLetterOrder.substr( $pos , 1 ) eq '1' ) { + print '-' x 7 ; + } + else { + print ' ' x 7 ; + } + print ' ' x 3 ;#print interdigit space + } + say ' ' ; + for (1..2) -> $i {#print 'f' and 'b' segment twice + for ($len..2 * $len - 1 ) -> $pos { + if ( $finalLetterOrder.substr( $pos , 1 ) eq '1' ) { + print '|' ; + } + else { + print ' ' ; + } +#if 'f' is printed we must see whether 'b' segment in the same row is activated +#so we have to look $len elements ahead    + if ( $finalLetterOrder.substr( $pos + $len , 1 ) eq '1' ) { + print ' ' x 5 ~ '|' ; + } + else { + print ' ' x 6 ; + } + print ' ' x 3 ; + } + say ' ' ; + } + for (3 * $len .. 4 * $len - 1 ) -> $pos {#print 'g' , same logic as for 'a' + if ( $finalLetterOrder.substr( $pos , 1 ) eq '1' ) { + print '-' x 7 ; + } + else { + print ' ' x 7 ; + } + print ' ' x 3 ; + } + say ' ' ; + for (1..2 ) -> $i { #print 'e' and 'c', same logic as for 'f' and 'b' + for (4 * $len .. 5 * $len - 1 ) -> $pos { + if ( $finalLetterOrder.substr( $pos , 1 ) eq '1' ) { + print '|' ; + } + else { + print ' ' ; + } + if ( $finalLetterOrder.substr( $pos + $len , 1 ) eq '1' ) { + print ' ' x 5 ~ '|' ; + } + else { + print ' ' x 6 ; + } + print ' ' x 3 ; + } + say ' ' ; + } + for (6 * $len .. 7 * $len - 1 ) -> $pos {#print 'd' , as 'g' or 'a' + if ( $finalLetterOrder.substr( $pos , 1 ) eq '1' ) { + print '-' x 7 ; + } + else { + print ' ' x 7 ; + } + print ' ' x 3 ; + } + say ' ' ; +} diff --git a/challenge-200/ulrich-rieke/rust/ch-1.rs b/challenge-200/ulrich-rieke/rust/ch-1.rs new file mode 100644 index 0000000000..388922e7f4 --- /dev/null +++ b/challenge-200/ulrich-rieke/rust/ch-1.rs @@ -0,0 +1,40 @@ +use std::io ; +use itertools::Itertools ; +use std::collections::HashSet ; + +fn my_condition( my_vector : &Vec<&i32> ) -> bool { + let mut differences : HashSet = HashSet::new( ) ; + let len = my_vector.len( ) ; + for i in 0..=len - 2 { + differences.insert( *my_vector[ i + 1 ] - *my_vector[ i ] ) ; + } + differences.len( ) == 1 +} + +fn main() { + println!("Please enter some integers, separated by a blank!") ; + 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( ) ; + let len = numbers.len( ) ; + if len >= 3 { + let mut fulfilled = false ; + for i in 3..=len { + let mut it = numbers.iter( ).combinations( i ) ; + while let Some( combi ) = it.next( ) { + if my_condition( &combi ) { + println!("{:?}" , combi ) ; + fulfilled = true ; + } + } + } + if ! fulfilled { + println!("()") ; + } + } + else { + println!("()") ; + } +} diff --git a/members.json b/members.json index 88ccd36d4d..3fb4ddbdac 100644 --- a/members.json +++ b/members.json @@ -236,6 +236,7 @@ "simon-proctor" : "Simon Proctor", "simon-reinhardt" : "Simon Reinhardt", "sitaram-chamarty" : "Sitaram Chamarty", + "spadacciniweb" : "Mariano Spadaccini", "spazm" : "Andrew Grangaard", "solathian" : "Solathian", "sol-demuth" : "Sol DeMuth", diff --git a/stats/pwc-challenge-198.json b/stats/pwc-challenge-198.json index a00eae3a49..11ed218704 100644 --- a/stats/pwc-challenge-198.json +++ b/stats/pwc-challenge-198.json @@ -1,32 +1,19 @@ { - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } - }, "chart" : { "type" : "column" }, - "title" : { - "text" : "The Weekly Challenge - 198" - }, "series" : [ { "colorByPoint" : 1, - "name" : "The Weekly Challenge - 198", "data" : [ { - "drilldown" : "Adam Russell", "y" : 4, - "name" : "Adam Russell" + "name" : "Adam Russell", + "drilldown" : "Adam Russell" }, { - "drilldown" : "Ali Moradi", "name" : "Ali Moradi", + "drilldown" : "Ali Moradi", "y" : 4 }, { @@ -40,69 +27,74 @@ "y" : 3 }, { - "drilldown" : "Athanasius", + "y" : 4, "name" : "Athanasius", - "y" : 4 + "drilldown" : "Athanasius" }, { - "y" : 2, + "drilldown" : "Bob Lied", "name" : "Bob Lied", - "drilldown" : "Bob Lied" + "y" : 2 }, { - "drilldown" : "Bruce Gray", "y" : 2, - "name" : "Bruce Gray" + "name" : "Bruce Gray", + "drilldown" : "Bruce Gray" }, { - "drilldown" : "Carlos Oliveira", + "y" : 2, "name" : "Carlos Oliveira", - "y" : 2 + "drilldown" : "Carlos Oliveira" }, { + "y" : 1, "drilldown" : "Cheok-Yin Fung", - "name" : "Cheok-Yin Fung", - "y" : 1 + "name" : "Cheok-Yin Fung" }, { - "drilldown" : "Colin Crain", "y" : 2, + "drilldown" : "Colin Crain", "name" : "Colin Crain" }, { - "name" : "Dave Jacoby", "y" : 3, + "name" : "Dave Jacoby", "drilldown" : "Dave Jacoby" }, { - "drilldown" : "David Ferrone", "y" : 4, - "name" : "David Ferrone" + "name" : "David Ferrone", + "drilldown" : "David Ferrone" }, { - "drilldown" : "Duncan C. White", "name" : "Duncan C. White", + "drilldown" : "Duncan C. White", "y" : 2 }, { "name" : "E. Choroba", - "y" : 2, - "drilldown" : "E. Choroba" + "drilldown" : "E. Choroba", + "y" : 2 }, { - "drilldown" : "Feng Chang", "y" : 2, - "name" : "Feng Chang" + "name" : "Feng Chang", + "drilldown" : "Feng Chang" }, { - "y" : 6, + "drilldown" : "Flavio Poletti", "name" : "Flavio Poletti", - "drilldown" : "Flavio Poletti" + "y" : 6 + }, + { + "y" : 5, + "name" : "Jaldhar H. Vyas", + "drilldown" : "Jaldhar H. Vyas" }, { "name" : "James Smith", - "y" : 3, - "drilldown" : "James Smith" + "drilldown" : "James Smith", + "y" : 3 }, { "drilldown" : "Jan Krnavek", @@ -116,13 +108,13 @@ }, { "y" : 5, - "name" : "Laurent Rosenfeld", - "drilldown" : "Laurent Rosenfeld" + "drilldown" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld" }, { - "drilldown" : "Luca Ferrari", "y" : 8, - "name" : "Luca Ferrari" + "name" : "Luca Ferrari", + "drilldown" : "Luca Ferrari" }, { "y" : 2, @@ -130,91 +122,110 @@ "drilldown" : "Mark Anderson" }, { - "y" : 2, + "drilldown" : "Marton Polgar", "name" : "Marton Polgar", - "drilldown" : "Marton Polgar" + "y" : 2 }, { "name" : "Niels van Dijke", - "y" : 2, - "drilldown" : "Niels van Dijke" + "drilldown" : "Niels van Dijke", + "y" : 2 }, { - "drilldown" : "Peter Campbell Smith", "y" : 3, + "drilldown" : "Peter Campbell Smith", "name" : "Peter Campbell Smith" }, { - "drilldown" : "Pip Stuart", "y" : 2, - "name" : "Pip Stuart" + "name" : "Pip Stuart", + "drilldown" : "Pip Stuart" }, { - "name" : "Rawley Fowler", "y" : 2, + "name" : "Rawley Fowler", "drilldown" : "Rawley Fowler" }, { "drilldown" : "Robbie Hatley", - "y" : 3, - "name" : "Robbie Hatley" + "name" : "Robbie Hatley", + "y" : 3 }, { + "y" : 2, "drilldown" : "Robert DiCicco", - "name" : "Robert DiCicco", - "y" : 2 + "name" : "Robert DiCicco" }, { - "drilldown" : "Roger Bell_West", + "y" : 5, "name" : "Roger Bell_West", - "y" : 5 + "drilldown" : "Roger Bell_West" }, { - "drilldown" : "Simon Green", "y" : 3, - "name" : "Simon Green" + "name" : "Simon Green", + "drilldown" : "Simon Green" }, { - "y" : 2, + "drilldown" : "Solathian", "name" : "Solathian", - "drilldown" : "Solathian" + "y" : 2 }, { + "name" : "Stephen G. Lynn", "drilldown" : "Stephen G. Lynn", - "y" : 5, - "name" : "Stephen G. Lynn" + "y" : 5 }, { - "drilldown" : "Thomas Kohler", "name" : "Thomas Kohler", + "drilldown" : "Thomas Kohler", "y" : 4 }, { + "name" : "Ulrich Rieke", "drilldown" : "Ulrich Rieke", - "y" : 4, - "name" : "Ulrich Rieke" + "y" : 4 }, { "name" : "W. Luis Mochan", - "y" : 3, - "drilldown" : "W. Luis Mochan" + "drilldown" : "W. Luis Mochan", + "y" : 3 } - ] + ], + "name" : "The Weekly Challenge - 198" } ], "subtitle" : { - "text" : "[Champions: 36] Last updated at 2023-01-10 18:29:22 GMT" + "text" : "[Champions: 37] Last updated at 2023-01-23 00:15:13 GMT" + }, + "title" : { + "text" : "The Weekly Challenge - 198" }, "yAxis" : { "title" : { "text" : "Total Solutions" } }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + }, + "xAxis" : { + "type" : "category" + }, + "tooltip" : { + "followPointer" : 1, + "pointFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "{series.name}
" + }, "drilldown" : { "series" : [ { - "name" : "Adam Russell", - "id" : "Adam Russell", "data" : [ [ "Perl", @@ -224,11 +235,11 @@ "Blog", 2 ] - ] + ], + "name" : "Adam Russell", + "id" : "Adam Russell" }, { - "name" : "Ali Moradi", - "id" : "Ali Moradi", "data" : [ [ "Perl", @@ -238,19 +249,22 @@ "Raku", 2 ] - ] + ], + "name" : "Ali Moradi", + "id" : "Ali Moradi" }, { - "id" : "Andrew Grangaard", "data" : [ [ "Perl", 2 ] ], - "name" : "Andrew Grangaard" + "name" : "Andrew Grangaard", + "id" : "Andrew Grangaard" }, { + "id" : "Arne Sommer", "data" : [ [ "Raku", @@ -261,10 +275,11 @@ 1 ] ], - "id" : "Arne Sommer", "name" : "Arne Sommer" }, { + "id" : "Athanasius", + "name" : "Athanasius", "data" : [ [ "Perl", @@ -274,53 +289,51 @@ "Raku", 2 ] - ], - "id" : "Athanasius", - "name" : "Athanasius" + ] }, { - "name" : "Bob Lied", + "id" : "Bob Lied", "data" : [ [ "Perl", 2 ] ], - "id" : "Bob Lied" + "name" : "Bob Lied" }, { + "id" : "Bruce Gray", "data" : [ [ "Raku", 2 ] ], - "id" : "Bruce Gray", "name" : "Bruce Gray" }, { - "name" : "Carlos Oliveira", - "id" : "Carlos Oliveira", "data" : [ [ "Raku", 2 ] - ] + ], + "name" : "Carlos Oliveira", + "id" : "Carlos Oliveira" }, { - "name" : "Cheok-Yin Fung", "data" : [ [ "Perl", 1 ] ], + "name" : "Cheok-Yin Fung", "id" : "Cheok-Yin Fung" }, { - "name" : "Colin Crain", "id" : "Colin Crain", + "name" : "Colin Crain", "data" : [ [ "Perl", @@ -330,7 +343,6 @@ }, { "name" : "Dave Jacoby", - "id" : "Dave Jacoby", "data" : [ [ "Perl", @@ -340,10 +352,11 @@ "Blog", 1 ] - ] + ], + "id" : "Dave Jacoby" }, { - "id" : "David Ferrone", + "name" : "David Ferrone", "data" : [ [ "Perl", @@ -354,37 +367,37 @@ 2 ] ], - "name" : "David Ferrone" + "id" : "David Ferrone" }, { "name" : "Duncan C. White", - "id" : "Duncan C. White", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Duncan C. White" }, { - "name" : "E. Choroba", "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "E. Choroba" }, { + "id" : "Feng Chang", + "name" : "Feng Chang", "data" : [ [ "Raku", 2 ] - ], - "id" : "Feng Chang", - "name" : "Feng Chang" + ] }, { "name" : "Flavio Poletti", @@ -405,22 +418,40 @@ "id" : "Flavio Poletti" }, { - "name" : "James Smith", + "name" : "Jaldhar H. Vyas", "data" : [ [ "Perl", 2 ], + [ + "Raku", + 2 + ], [ "Blog", 1 ] ], - "id" : "James Smith" + "id" : "Jaldhar H. Vyas" + }, + { + "id" : "James Smith", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "James Smith" }, { - "name" : "Jan Krnavek", "id" : "Jan Krnavek", + "name" : "Jan Krnavek", "data" : [ [ "Raku", @@ -430,17 +461,16 @@ }, { "name" : "Jorg Sommrey", - "id" : "Jorg Sommrey", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Jorg Sommrey" }, { "name" : "Laurent Rosenfeld", - "id" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -454,10 +484,11 @@ "Blog", 1 ] - ] + ], + "id" : "Laurent Rosenfeld" }, { - "name" : "Luca Ferrari", + "id" : "Luca Ferrari", "data" : [ [ "Raku", @@ -468,11 +499,11 @@ 6 ] ], - "id" : "Luca Ferrari" + "name" : "Luca Ferrari" }, { - "name" : "Mark Anderson", "id" : "Mark Anderson", + "name" : "Mark Anderson", "data" : [ [ "Raku", @@ -481,8 +512,8 @@ ] }, { - "name" : "Marton Polgar", "id" : "Marton Polgar", + "name" : "Marton Polgar", "data" : [ [ "Raku", @@ -501,6 +532,7 @@ "id" : "Niels van Dijke" }, { + "id" : "Peter Campbell Smith", "name" : "Peter Campbell Smith", "data" : [ [ @@ -511,27 +543,26 @@ "Blog", 1 ] - ], - "id" : "Peter Campbell Smith" + ] }, { "id" : "Pip Stuart", + "name" : "Pip Stuart", "data" : [ [ "Perl", 2 ] - ], - "name" : "Pip Stuart" + ] }, { - "name" : "Rawley Fowler", "data" : [ [ "Raku", 2 ] ], + "name" : "Rawley Fowler", "id" : "Rawley Fowler" }, { @@ -545,11 +576,12 @@ 1 ] ], - "id" : "Robbie Hatley", - "name" : "Robbie Hatley" + "name" : "Robbie Hatley", + "id" : "Robbie Hatley" }, { "id" : "Robert DiCicco", + "name" : "Robert DiCicco", "data" : [ [ "Perl", @@ -559,10 +591,10 @@ "Raku", 1 ] - ], - "name" : "Robert DiCicco" + ] }, { + "id" : "Roger Bell_West", "name" : "Roger Bell_West", "data" : [ [ @@ -577,11 +609,9 @@ "Blog", 1 ] - ], - "id" : "Roger Bell_West" + ] }, { - "name" : "Simon Green", "data" : [ [ "Perl", @@ -592,20 +622,20 @@ 1 ] ], + "name" : "Simon Green", "id" : "Simon Green" }, { + "id" : "Solathian", + "name" : "Solathian", "data" : [ [ "Perl", 2 ] - ], - "id" : "Solathian", - "name" : "Solathian" + ] }, { - "id" : "Stephen G. Lynn", "data" : [ [ "Perl", @@ -620,11 +650,12 @@ 1 ] ], - "name" : "Stephen G. Lynn" + "name" : "Stephen G. Lynn", + "id" : "Stephen G. Lynn" }, { - "name" : "Thomas Kohler", "id" : "Thomas Kohler", + "name" : "Thomas Kohler", "data" : [ [ "Perl", @@ -638,7 +669,6 @@ }, { "name" : "Ulrich Rieke", - "id" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -648,9 +678,11 @@ "Raku", 2 ] - ] + ], + "id" : "Ulrich Rieke" }, { + "name" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -661,20 +693,11 @@ 1 ] ], - "id" : "W. Luis Mochan", - "name" : "W. Luis Mochan" + "id" : "W. Luis Mochan" } ] }, - "xAxis" : { - "type" : "category" - }, "legend" : { "enabled" : 0 - }, - "tooltip" : { - "headerFormat" : "{series.name}
", - "pointFormat" : "{point.name}: {point.y:f}
", - "followPointer" : 1 } } diff --git a/stats/pwc-challenge-199.json b/stats/pwc-challenge-199.json new file mode 100644 index 0000000000..92cfe9eb9a --- /dev/null +++ b/stats/pwc-challenge-199.json @@ -0,0 +1,673 @@ +{ + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "xAxis" : { + "type" : "category" + }, + "legend" : { + "enabled" : 0 + }, + "tooltip" : { + "followPointer" : 1, + "headerFormat" : "{series.name}
", + "pointFormat" : "{point.name}: {point.y:f}
" + }, + "drilldown" : { + "series" : [ + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 2 + ] + ], + "name" : "Adam Russell", + "id" : "Adam Russell" + }, + { + "id" : "Ali Moradi", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "name" : "Ali Moradi" + }, + { + "id" : "Arne Sommer", + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Arne Sommer" + }, + { + "id" : "Arpad Toth", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Arpad Toth" + }, + { + "id" : "Athanasius", + "name" : "Athanasius", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Bob Lied", + "id" : "Bob Lied" + }, + { + "name" : "Carlos Oliveira", + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Carlos Oliveira" + }, + { + "id" : "Cheok-Yin Fung", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Cheok-Yin Fung" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Colin Crain", + "id" : "Colin Crain" + }, + { + "name" : "Dave Jacoby", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Dave Jacoby" + }, + { + "id" : "David Ferrone", + "name" : "David Ferrone", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ] + }, + { + "id" : "E. Choroba", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "E. Choroba" + }, + { + "id" : "Feng Chang", + "name" : "Feng Chang", + "data" : [ + [ + "Raku", + 2 + ] + ] + }, + { + "id" : "Flavio Poletti", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ], + "name" : "Flavio Poletti" + }, + { + "name" : "Jaldhar H. Vyas", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Jaldhar H. Vyas" + }, + { + "id" : "James Smith", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], +