From 07e42d14bd2245214cbfde133ce9ffbc0d7fd227 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Sun, 8 Oct 2023 19:51:46 +0100 Subject: - Added solutions by Robert DiCicco. - Added solutions by Packy Anderson. - Added solutions by Lubos Kolouch. - Added solutions by Dave Jacoby. - Added solutions by Jorg Sommrey. - Added solutions by Ali Moradi. - Added solutions by Avery Adams. - Added solutions by Bob Lied. - Added solutions by Steven Wilson. - Added solutions by Athanasius. - Added solutions by Flavio Poletti. - Added solutions by Matthias Muth. - Added solutions by Robert Ransbottom. - Added solutions by Simon Green. - Added solutions by Yves Orton. - Added solutions by Mark Anderson. - Added solutions by Ulrich Rieke. - Added solutions by Robbie Hatley. --- challenge-237/avery-adams/blog.txt | 1 + challenge-237/avery-adams/blog1.txt | 1 + challenge-237/avery-adams/blogs.txt | 2 - challenge-237/robert-dicicco/julia/ch-2.jl | 60 + challenge-237/robert-dicicco/perl/ch-2.pl | 60 + challenge-237/robert-dicicco/powershell/ch-2.psl | 55 + challenge-237/robert-dicicco/python/ch-2.py | 51 + challenge-237/robert-dicicco/raku/ch-2.raku | 56 + challenge-237/robert-dicicco/ruby/ch-2.rb | 55 + challenge-237/steven-wilson/python/ch-01.py | 29 - challenge-237/steven-wilson/python/ch-02.py | 43 - challenge-237/steven-wilson/python/ch-1.py | 29 + challenge-237/steven-wilson/python/ch-2.py | 43 + challenge-237/ulrich-rieke/cpp/ch-2.cpp | 47 + challenge-237/ulrich-rieke/haskell/ch-1.hs | 41 + challenge-237/ulrich-rieke/haskell/ch-2.hs | 21 + challenge-237/ulrich-rieke/perl/ch-1.pl | 40 + challenge-237/ulrich-rieke/perl/ch-2.pl | 25 + challenge-237/ulrich-rieke/raku/ch-1.raku | 26 + challenge-237/ulrich-rieke/raku/ch-2.raku | 20 + challenge-237/ulrich-rieke/rust/ch-1.rs | 33 + challenge-237/ulrich-rieke/rust/ch-2.rs | 27 + stats/pwc-challenge-229.json | 563 +- stats/pwc-challenge-236.json | 528 +- stats/pwc-current.json | 445 +- stats/pwc-language-breakdown-summary.json | 96 +- stats/pwc-language-breakdown.json | 9284 +++++++++++----------- stats/pwc-leaders.json | 812 +- stats/pwc-summary-1-30.json | 106 +- stats/pwc-summary-121-150.json | 42 +- stats/pwc-summary-151-180.json | 42 +- stats/pwc-summary-181-210.json | 100 +- stats/pwc-summary-211-240.json | 110 +- stats/pwc-summary-241-270.json | 102 +- stats/pwc-summary-271-300.json | 44 +- stats/pwc-summary-31-60.json | 112 +- stats/pwc-summary-61-90.json | 60 +- stats/pwc-summary-91-120.json | 46 +- stats/pwc-summary.json | 106 +- 39 files changed, 7144 insertions(+), 6219 deletions(-) create mode 100644 challenge-237/avery-adams/blog.txt create mode 100644 challenge-237/avery-adams/blog1.txt delete mode 100644 challenge-237/avery-adams/blogs.txt create mode 100644 challenge-237/robert-dicicco/julia/ch-2.jl create mode 100644 challenge-237/robert-dicicco/perl/ch-2.pl create mode 100644 challenge-237/robert-dicicco/powershell/ch-2.psl create mode 100644 challenge-237/robert-dicicco/python/ch-2.py create mode 100644 challenge-237/robert-dicicco/raku/ch-2.raku create mode 100644 challenge-237/robert-dicicco/ruby/ch-2.rb delete mode 100644 challenge-237/steven-wilson/python/ch-01.py delete mode 100644 challenge-237/steven-wilson/python/ch-02.py create mode 100644 challenge-237/steven-wilson/python/ch-1.py create mode 100644 challenge-237/steven-wilson/python/ch-2.py create mode 100755 challenge-237/ulrich-rieke/cpp/ch-2.cpp create mode 100755 challenge-237/ulrich-rieke/haskell/ch-1.hs create mode 100755 challenge-237/ulrich-rieke/haskell/ch-2.hs create mode 100755 challenge-237/ulrich-rieke/perl/ch-1.pl create mode 100755 challenge-237/ulrich-rieke/perl/ch-2.pl create mode 100755 challenge-237/ulrich-rieke/raku/ch-1.raku create mode 100755 challenge-237/ulrich-rieke/raku/ch-2.raku create mode 100755 challenge-237/ulrich-rieke/rust/ch-1.rs create mode 100755 challenge-237/ulrich-rieke/rust/ch-2.rs diff --git a/challenge-237/avery-adams/blog.txt b/challenge-237/avery-adams/blog.txt new file mode 100644 index 0000000000..7bf8ae3516 --- /dev/null +++ b/challenge-237/avery-adams/blog.txt @@ -0,0 +1 @@ +https://dev.to/oldtechaa/perl-weekly-challenge-237-carpe-diem-1i09 diff --git a/challenge-237/avery-adams/blog1.txt b/challenge-237/avery-adams/blog1.txt new file mode 100644 index 0000000000..ef268625bd --- /dev/null +++ b/challenge-237/avery-adams/blog1.txt @@ -0,0 +1 @@ +https://blogs.perl.org/users/oldtechaa/2023/10/perl-weekly-challenge-237---carpe-diem.html diff --git a/challenge-237/avery-adams/blogs.txt b/challenge-237/avery-adams/blogs.txt deleted file mode 100644 index 1fed97a89c..0000000000 --- a/challenge-237/avery-adams/blogs.txt +++ /dev/null @@ -1,2 +0,0 @@ -https://dev.to/oldtechaa/perl-weekly-challenge-237-carpe-diem-1i09 -https://blogs.perl.org/users/oldtechaa/2023/10/perl-weekly-challenge-237---carpe-diem.html diff --git a/challenge-237/robert-dicicco/julia/ch-2.jl b/challenge-237/robert-dicicco/julia/ch-2.jl new file mode 100644 index 0000000000..1859cb952e --- /dev/null +++ b/challenge-237/robert-dicicco/julia/ch-2.jl @@ -0,0 +1,60 @@ +#!usr/bin/env julia +#= +----------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-10-05 +Challenge 237 Task 02 Maximise Greatness ( Julia ) +----------------------------------------- +=# +using Printf +using Combinatorics + +mynums = [[1, 3, 5, 2, 1, 3, 1], [1, 2, 3, 4]] + +maxscore = 0; +score = 0; + +function CalcScore(a,b) + cnt = 1 + score = 0 + while cnt < length(a) + if a[cnt] < b[cnt] + score += 1 + end + cnt += 1 + end + return score +end + +for nums in mynums + global maxscore,score + @printf("Input: @nums = %s\n",nums) + maxscore = 0 + p = collect(permutations(nums,length(nums))) + for perm in p + score = 0 + score = CalcScore(nums, perm) + ignore = floor(length(nums) / 2 + 1) + if score >= maxscore && score >= ignore + maxscore = score + end + end + @printf("Output: %s\n\n",maxscore) +end + +#= +----------------------------------------- +SAMPLE OUTPUT +julia .\MaximiseGreatness.jl + +Input: @nums = [1, 3, 5, 2, 1, 3, 1] +Output: 4 + +Input: @nums = [1, 2, 3, 4] +Output: 3 +----------------------------------------- +=# + + + + diff --git a/challenge-237/robert-dicicco/perl/ch-2.pl b/challenge-237/robert-dicicco/perl/ch-2.pl new file mode 100644 index 0000000000..51e5ba9cca --- /dev/null +++ b/challenge-237/robert-dicicco/perl/ch-2.pl @@ -0,0 +1,60 @@ +#!/usr/bin/env perl +=begin comment +----------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-10-05 +Challenge 237 Task 02 Maximise Greatness ( Perl ) +----------------------------------------- +=cut +use v5.38; +use Algorithm::Permute; + +my @mynums = ([1, 3, 5, 2, 1, 3, 1], [1, 2, 3, 4]); + +my $maxscore = 0; +my $score = 0; + +my @output = []; + +sub CalcScore ($a,$b) { + my $cnt = 0; + my $score = 0; + while($cnt < scalar @$a) { + if ($a->[$cnt] < $b->[$cnt]) { + $score++; + } + $cnt++; + } + return $score; +} + +for my $nums ( @mynums) { + say "Input: \@nums = [@$nums]"; + $maxscore = 0; + my @sec = @$nums; + my $p = Algorithm::Permute->new(\@sec); + while ( my @perm = $p->next) { + $score = 0; + $score = CalcScore($nums, \@perm); + my $ignore = int((scalar @$nums / 2) + 1); + if ($score >= $maxscore and $score >= $ignore) { + $maxscore = $score; + } + } + say "Output: $maxscore\n"; +} + +=begin comment +----------------------------------------- +SAMPLE OUTPUT +perl .\MaximiseGreatness.pl + +Input: @nums = [1 3 5 2 1 3 1] +Output: 4 + +Input: @nums = [1 2 3 4] +Output: 3 +----------------------------------------- +=cut + + diff --git a/challenge-237/robert-dicicco/powershell/ch-2.psl b/challenge-237/robert-dicicco/powershell/ch-2.psl new file mode 100644 index 0000000000..068e457ee6 --- /dev/null +++ b/challenge-237/robert-dicicco/powershell/ch-2.psl @@ -0,0 +1,55 @@ +$mynums = @((1, 3, 5, 2, 1, 3, 1), (1, 2, 3, 4)) +<# +----------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-10-07 +Challenge 237 Task 02 Maximise Greatness ( Powershell ) +----------------------------------------- + #> + +$maxscore = 0 +$score = 0 +$output = @() + +function CalcScore($a, $b) { + $cnt = 0 + $score = 0 + while ($cnt -lt $a.length) { + if ($a[$cnt] -lt $b[$cnt]) { + $score += 1 + } + $cnt += 1 + } + return $score +} + + +foreach ($nums in $mynums ) { + write-host "Input: @nums = [$nums]" + $maxscore = 0 + Get-Permutation $nums | ForEach-Object { + $perm = $_ -replace ' ','' + $num1 = $nums -replace ' ','' + $score = CalcScore $num1 $perm + $ignore = [math]::floor(($num1.length / 2 + 1)) + if ($score -ge $maxscore -and $score -ge $ignore) { + $maxscore = $score + } + } + write-host "Output $maxscore`n" +} + +<# +----------------------------------------- +SAMPLE OUTPUT +.\MaximiseGreatness.ps1 + +Input: @nums = [1 3 5 2 1 3 1] +Output 4 + +Input: @nums = [1 2 3 4] +Output 3 +----------------------------------------- + #> + + diff --git a/challenge-237/robert-dicicco/python/ch-2.py b/challenge-237/robert-dicicco/python/ch-2.py new file mode 100644 index 0000000000..27120ea8f9 --- /dev/null +++ b/challenge-237/robert-dicicco/python/ch-2.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +''' +----------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-10-06 +Challenge 237 Task 02 Maximise Greatness ( Python ) +----------------------------------------- +''' + +from itertools import permutations +import math + +mynums = [[1, 3, 5, 2, 1, 3, 1], [1, 2, 3, 4]] + +maxscore = 0; +score = 0; + +def CalcScore(a,b): + cnt = 0 + score = 0 + while cnt < len(a): + if a[cnt] < b[cnt]: + score += 1 + cnt += 1 + return score + +for nums in mynums: + print(f"Input: @nums = {nums}") + maxscore = 0 + p = permutations(nums) + for perm in list(p): + score = CalcScore(nums, perm) + ignore = math.floor(len(nums) / 2 + 1) + if score >= maxscore and score >= ignore: + maxscore = score + print(f"Output: {maxscore}\n") + +''' +----------------------------------------- +SAMPLE OUTPUT +python .\MaximiseGreatness.py + +Input: @nums = [1, 3, 5, 2, 1, 3, 1] +Output: 4 + +Input: @nums = [1, 2, 3, 4] +Output: 3 +----------------------------------------- +''' + + diff --git a/challenge-237/robert-dicicco/raku/ch-2.raku b/challenge-237/robert-dicicco/raku/ch-2.raku new file mode 100644 index 0000000000..9c4efebed1 --- /dev/null +++ b/challenge-237/robert-dicicco/raku/ch-2.raku @@ -0,0 +1,56 @@ +#!/usr/bin/env raku +=begin comment +----------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-10-05 +Challenge 237 Task 02 Maximise Greatness ( Raku ) +----------------------------------------- +=end comment + +my @mynums = ([1, 3, 5, 2, 1, 3, 1], [1, 2, 3, 4]); + +my $maxscore = 0; +my $score = 0; +my @output = []; + +sub CalcScore (@a,@b) { + my $cnt = 0; + my $score = 0; + while ($cnt < @a.elems) { + if (@a[$cnt] < @b[$cnt]) { + $score++; + } + $cnt++; + } + return $score; +} + +for @mynums -> @nums { + say "Input: \@nums = ",@nums; + $maxscore = 0; + my @sec = @nums; + for @sec.permutations -> @perm { + $score = 0; + $score = CalcScore(@nums, @perm); + my $ignore = floor(@nums.elems / 2 + 1); + if ($score >= $maxscore and $score >= $ignore) { + $maxscore = $score; + } + } + say "Output: $maxscore\n"; +} + +=begin comment +----------------------------------------- +SAMPLE OUTPUT + raku .\MaximiseGreatness.rk + +Input: @nums = [1 3 5 2 1 3 1] +Output: 4 + +Input: @nums = [1 2 3 4] +Output: 3 +----------------------------------------- +=end comment + + diff --git a/challenge-237/robert-dicicco/ruby/ch-2.rb b/challenge-237/robert-dicicco/ruby/ch-2.rb new file mode 100644 index 0000000000..a779fcb6b7 --- /dev/null +++ b/challenge-237/robert-dicicco/ruby/ch-2.rb @@ -0,0 +1,55 @@ +#!/usr/bin/env ruby +=begin +----------------------------------------- +AUTHOR: Robert DiCicco +DATE : 2023-10-05 +Challenge 237 Task 02 Maximise Greatness ( Ruby ) +----------------------------------------- +=end + +mynums = [[1, 3, 5, 2, 1, 3, 1], [1, 2, 3, 4]] + +maxscore = 0; +score = 0; +output = []; + +def CalcScore (a,b) + cnt = 0; + score = 0; + while cnt < a.length() + if a[cnt] < b[cnt] + score += 1 + end + cnt += 1 + end + return score; +end + +mynums.each do |nums| + puts("Input: @nums = #{nums}") + maxscore = 0; + nums.permutation.to_a.each do |perm| + score = 0 + score = CalcScore(nums, perm) + ignore = (nums.length() / 2 + 1).floor() + if score >= maxscore && score >= ignore + maxscore = score + end + end + puts("Output: #{maxscore}\n\n") +end + +=begin +----------------------------------------- +SAMPLE OUTPUT +ruby .\MaximiseGreatness.rb + +Input: @nums = [1, 3, 5, 2, 1, 3, 1] +Output: 4 + +Input: @nums = [1, 2, 3, 4] +Output: 3 +----------------------------------------- +=end + + diff --git a/challenge-237/steven-wilson/python/ch-01.py b/challenge-237/steven-wilson/python/ch-01.py deleted file mode 100644 index 6da63f3aa6..0000000000 --- a/challenge-237/steven-wilson/python/ch-01.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 - -from datetime import date, timedelta - - -def seize_the_day(year, month, week, dow): - """ Given a year, a month, a week of month, and a day of week - (1 (Mon) .. 7 (Sun)), return the day of month, 0 is returned if not - possible - >>> seize_the_day(2024, 4, 3, 2) - 16 - >>> seize_the_day(2025, 10, 2, 4) - 9 - >>> seize_the_day(2026, 8, 5, 3) - 0 - """ - d = date(year, month, (1 + (week - 1) * 7)) - while(d.isoweekday() != dow): - d = d + timedelta(days=1) - if(d.month == month): - return d.day - else: - return 0 - - -if __name__ == "__main__": - import doctest - - doctest.testmod() diff --git a/challenge-237/steven-wilson/python/ch-02.py b/challenge-237/steven-wilson/python/ch-02.py deleted file mode 100644 index c7ff7edd00..0000000000 --- a/challenge-237/steven-wilson/python/ch-02.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python3 - -from itertools import permutations - - -def calculate_greatness(elements, permutation): - ''' Calculate greatness of array of integers and a permutation - >>> calculate_greatness([1, 3, 5, 2, 1, 3, 1], [2, 5, 1, 3, 3, 1, 1]) - 4 - >>> calculate_greatness([1, 2, 3, 4], [2, 3, 4, 1]) - 3 - >>> calculate_greatness([1, 2], [1, 2]) - 0 - ''' - count = 0 - for index, elem in enumerate(elements): - if elem < permutation[index]: - count += 1 - return count - - -def maximise_greatness(elements): - ''' return maximum possible greatness from permutations of an array of integers - >>> maximise_greatness([1, 3, 5, 2, 1, 3, 1]) - 4 - >>> maximise_greatness([1, 2, 3, 4]) - 3 - >>> maximise_greatness([1, 1, 1]) - 0 - ''' - perms = set(permutations(elements)) - max_greatness = 0 - for permutation in perms: - greatness = calculate_greatness(elements, permutation) - if greatness > max_greatness: - max_greatness = greatness - return max_greatness - - -if __name__ == "__main__": - import doctest - - doctest.testmod() diff --git a/challenge-237/steven-wilson/python/ch-1.py b/challenge-237/steven-wilson/python/ch-1.py new file mode 100644 index 0000000000..6da63f3aa6 --- /dev/null +++ b/challenge-237/steven-wilson/python/ch-1.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 + +from datetime import date, timedelta + + +def seize_the_day(year, month, week, dow): + """ Given a year, a month, a week of month, and a day of week + (1 (Mon) .. 7 (Sun)), return the day of month, 0 is returned if not + possible + >>> seize_the_day(2024, 4, 3, 2) + 16 + >>> seize_the_day(2025, 10, 2, 4) + 9 + >>> seize_the_day(2026, 8, 5, 3) + 0 + """ + d = date(year, month, (1 + (week - 1) * 7)) + while(d.isoweekday() != dow): + d = d + timedelta(days=1) + if(d.month == month): + return d.day + else: + return 0 + + +if __name__ == "__main__": + import doctest + + doctest.testmod() diff --git a/challenge-237/steven-wilson/python/ch-2.py b/challenge-237/steven-wilson/python/ch-2.py new file mode 100644 index 0000000000..c7ff7edd00 --- /dev/null +++ b/challenge-237/steven-wilson/python/ch-2.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 + +from itertools import permutations + + +def calculate_greatness(elements, permutation): + ''' Calculate greatness of array of integers and a permutation + >>> calculate_greatness([1, 3, 5, 2, 1, 3, 1], [2, 5, 1, 3, 3, 1, 1]) + 4 + >>> calculate_greatness([1, 2, 3, 4], [2, 3, 4, 1]) + 3 + >>> calculate_greatness([1, 2], [1, 2]) + 0 + ''' + count = 0 + for index, elem in enumerate(elements): + if elem < permutation[index]: + count += 1 + return count + + +def maximise_greatness(elements): + ''' return maximum possible greatness from permutations of an array of integers + >>> maximise_greatness([1, 3, 5, 2, 1, 3, 1]) + 4 + >>> maximise_greatness([1, 2, 3, 4]) + 3 + >>> maximise_greatness([1, 1, 1]) + 0 + ''' + perms = set(permutations(elements)) + max_greatness = 0 + for permutation in perms: + greatness = calculate_greatness(elements, permutation) + if greatness > max_greatness: + max_greatness = greatness + return max_greatness + + +if __name__ == "__main__": + import doctest + + doctest.testmod() diff --git a/challenge-237/ulrich-rieke/cpp/ch-2.cpp b/challenge-237/ulrich-rieke/cpp/ch-2.cpp new file mode 100755 index 0000000000..02fec12a09 --- /dev/null +++ b/challenge-237/ulrich-rieke/cpp/ch-2.cpp @@ -0,0 +1,47 @@ +#include +#include +#include +#include + +std::vector split( const std::string & startline , + const std::string & sep ) { + std::vector separated ; + std::string::size_type start { 0 } ; + std::string::size_type pos ; + do { + pos = startline.find_first_of( sep , start ) ; + separated.push_back( startline.substr(start , pos - start )) ; + start = pos + 1 ; + } while ( pos != std::string::npos ) ; + return separated ; +} + +int main( ) { + std::cout << "Enter some integers, separated by blanks!\n" ; + std::string line ; + std::getline( std::cin , line ) ; + std::vector numberstrings( split( line , " " ) ) ; + std::vector numbers ; + for ( auto s : numberstrings ) //convert to vector of ints + numbers.push_back( std::stoi( s ) ) ; + int len = numbers.size( ) ; + //if we want to create successive permutations, we have to sort + //the vector of numbers we entered. Subsequently, we create + //permutations on it. To have something to compare to we have to + //create a copy of the numbers + std::vector original_numbers( numbers ) ; + int max_greatness = 0 ; + std::sort( numbers.begin( ) , numbers.end( ) ) ; + while ( std::next_permutation( numbers.begin( ) , numbers.end( ) ) ) { + int current_greatness = 0 ; + for ( int i = 0 ; i < len ; i++ ) { + if ( numbers[ i ] > original_numbers[ i ] ) { + current_greatness++ ; + } + } + if ( current_greatness > max_greatness ) + max_greatness = current_greatness ; + } + std::cout << max_greatness << std::endl ; + return 0 ; +} diff --git a/challenge-237/ulrich-rieke/haskell/ch-1.hs b/challenge-237/ulrich-rieke/haskell/ch-1.hs new file mode 100755 index 0000000000..c91c55dd4b --- /dev/null +++ b/challenge-237/ulrich-rieke/haskell/ch-1.hs @@ -0,0 +1,41 @@ +module Challenge237 + where +import Data.Time.Calendar +import Data.Maybe ( fromJust ) +import Data.List ( (!!) ) + +numToDayOfWeek :: [(Int , DayOfWeek)] +numToDayOfWeek = zip [1..7] [Monday, Tuesday , Wednesday, Thursday, Friday, Saturday , + Sunday] + +findFirstSuitableWeekday :: Day -> DayOfWeek -> Day +findFirstSuitableWeekday d wd + |dayOfWeek d == wd = d + |otherwise = until ( (== wd ) . dayOfWeek ) ( addDays 1 ) d + +findFinalDay :: Day -> Int -> Day +findFinalDay d pos + |pos == 1 = d + |otherwise = addDays ( toInteger ((pos - 1) * 7 )) d + +getDay :: Day -> Int +getDay day = d + where + (_ , _ , d ) = toGregorian day + +getMonth :: Day -> Int +getMonth day = mo + where + (_ , mo , _) = toGregorian day + +main :: IO ( ) +main = do + putStrLn "Enter a year( positive integer ) , a month( integer from 1 to 12 ) ," + putStrLn "a weekday position( integer from 1 to 5 ) and a weekday ( from 1 to 7 )!" + datepartsStr <- getLine + let dateParts = map read $ words datepartsStr + startDay = fromGregorian ( toInteger $ head dateParts ) (dateParts !! 1 ) 1 + wantedWeekday = fromJust $ lookup ( dateParts !! 3 ) numToDayOfWeek + firstWeekday = findFirstSuitableWeekday startDay wantedWeekday + finalDay = findFinalDay firstWeekday ( dateParts !! 2 ) + if (getMonth finalDay) /= dateParts !! 1 then print 0 else print ( getDay finalDay ) diff --git a/challenge-237/ulrich-rieke/haskell/ch-2.hs b/challenge-237/ulrich-rieke/haskell/ch-2.hs new file mode 100755 index 0000000000..5692e05732 --- /dev/null +++ b/challenge-237/ulrich-rieke/haskell/ch-2.hs @@ -0,0 +1,21 @@ +module Challenge237_2 + where +import Data.List ( permutations ) + +solution :: [Int] -> Int +solution list = maximum greaterNums + where + permus :: [[Int]] + permus = permutations list + listPairs :: [[(Int , Int)]] + listPairs = map (\perm -> zip perm list) permus + greaterNums :: [Int] + greaterNums = map (\p -> length $ filter(\pa -> fst pa > snd pa ) p ) + listPairs + +main :: IO ( ) +main = do + putStrLn "Please enter some integers, separated by blanks!" + numberstrings <- getLine + let numbers = map read $ words numberstrings + print $ solution numbers diff --git a/challenge-237/ulrich-rieke/perl/ch-1.pl b/challenge-237/ulrich-rieke/perl/ch-1.pl new file mode 100755 index 0000000000..ff8680aab0 --- /dev/null +++ b/challenge-237/ulrich-rieke/perl/ch-1.pl @@ -0,0 +1,40 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; +use DateTime ; + +say "Enter a year ( positive integer ) , a month ( integer from 1 to 12 ) ," ; +say "a weekday index ( integer from 1 to 5 ) and a weekday( integer from 1 to 7 )!" ; +my $line = ; +chomp $line ; +my @dateParts = split( /\s/ , $line ) ; +my $d = DateTime->new( + year => $dateParts[ 0 ] , + month => $dateParts[ 1 ] , + day => 1 , + hour => 0 , + minute => 0 , + second => 0 , + nanosecond => 0 , + time_zone => 'Europe/Berlin' , +) ; +my $dt = $d->set_time_zone( 'floating' ) ; #for doing date math +#add 1 day until we've reached the desired weekday +while ( $dt->day_of_week != $dateParts[ 3 ] ) { + $dt->add( days => 1 ) ; +} +#if we want the first such weekday we're already there +if ( $dateParts[ 2 ] == 1 ) { + say $dt->day ; +} +#otherwise , keep adding as many days as necessary to arrive at the n'th position +else { + $dt->add( days => ( $dateParts[ 2 ] - 1 ) * 7 ) ; + if ( $dt->month != $dateParts[ 1 ] ) {#month rollover, the given weekday doesn't exist + say 0 ; + } + else { + say $dt->day ; + } +} diff --git a/challenge-237/ulrich-rieke/perl/ch-2.pl b/challenge-237/ulrich-rieke/perl/ch-2.pl new file mode 100755 index 0000000000..23730279e4 --- /dev/null +++ b/challenge-237/ulrich-rieke/perl/ch-2.pl @@ -0,0 +1,25 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; +use Algorithm::Combinatorics qw ( permutations ) ; + +say "Enter some integers, separated by blanks!" ; +my $line = ; +chomp $line ; +my @numbers = split( /\s/ , $line ) ; +my $len = scalar( @numbers ) ; +my $max_greatness = 0 ; +my $iter = permutations( \@numbers ) ; +while ( my $p = $iter->next ) { + my $current_greatness = 0 ; + for my $i ( 0..$len - 1 ) { + if ( $p->[ $i ] > $numbers[ $i ] ) { + $current_greatness++ ; + } + } + if ( $current_greatness > $max_greatness ) { + $max_greatness = $current_greatness ; + } +} +say $max_greatness ; diff --git a/challenge-237/ulrich-rieke/raku/ch-1.raku b/challenge-237/ulrich-rieke/raku/ch-1.raku new file mode 100755 index 0000000000..240c7b47e4 --- /dev/null +++ b/challenge-237/ulrich-rieke/raku/ch-1.raku @@ -0,0 +1,26 @@ +use v6 ; + +say "Please enter a year( positive integer ) , a month( integer from 1 to 12)," ; +say " the index of a given weekday( integer from 1 to 5 ) , and a weekday( 1 to 7 )" ; +my $line = $*IN.get ; +my @dateparts = $line.words.map( {.Int} ) ; +#construct a date for the first day in the given month of the given year +my $d = Date.new( @dateparts[ 0 ] , @dateparts[ 1 ] , 1 ) ; +#add a day until you reach the given weekday +while ( $d.day-of-week != @dateparts[ 3 ] ) { + $d .= later( days => 1 ) ; +} +#if we want the day of the first given weekday we're already there +if ( @dateparts[ 2 ] == 1 ) { + say $d.day ; +} +#otherwise, we add as many days as necessary to reach the n'th given weekday +else { + $d .= later( days => ( @dateparts[ 2 ] - 1 ) * 7 ) ; + if ( $d.month != @dateparts[ 1 ] ) {#a month rollover occurred! we must output 0! + say 0 ; + } + else { + say $d.day ; #otherwise, we output the day + } +} diff --git a/challenge-237/ulrich-rieke/raku/ch-2.raku b/challenge-237/ulrich-rieke/raku/ch-2.raku new file mode 100755 index 0000000000..c77b3b8894 --- /dev/null +++ b/challenge-237/ulrich-rieke/raku/ch-2.raku @@ -0,0 +1,20 @@ +use v6 ; + +say "Enter some integers, separated by spaces!" ; +my $line = $*IN.get ; +my @numbers = $line.words.map( {.Int} ) ; +my $len = @numbers.elems ; +my $max_greatness = 0 ; +my @allPermus = @numbers.permutations ; +for @allPermus -> $permu { + my $current_greatness = 0 ; + for (0..$len - 1) -> $pos { + if ( $permu[ $pos ] > @numbers[ $pos ] ) { + $current_greatness++ ; + } + } + if ( $current_greatness > $max_greatness ) { + $max_greatness = $current_greatness ; + } +} +say $max_greatness ; diff --git a/challenge-237/ulrich-rieke/rust/ch-1.rs b/challenge-237/ulrich-rieke/rust/ch-1.rs new file mode 100755 index 0000000000..cd48ee7762 --- /dev/null +++ b/challenge-237/ulrich-rieke/rust/ch-1.rs @@ -0,0 +1,33 @@ +use chrono::{NaiveDate , Weekday , Datelike} ; +use std::io ; + +fn main() { + println!("Enter the year , the month , the number of given weekday and the weekday!"); + 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 y : i32 = numbers[0] as i32 ; + let m : u32 = numbers[1] as u32 ; + let num : u8 = numbers[2] as u8 ; + let wd : Weekday = match numbers[3] { + 1 => Weekday::Mon , + 2 => Weekday::Tue , + 3 => Weekday::Wed , + 4 => Weekday::Thu , + 5 => Weekday::Fri , + 6 => Weekday::Sat , + 7 => Weekday::Sun , + _ => Weekday::Sun + } ; + if NaiveDate::from_weekday_of_month_opt( y , m , + wd , num ).is_some( ) { + let day = NaiveDate::from_weekday_of_month_opt( y , m , + wd , num ).unwrap( ).day( ) ; + println!("{}" , day ) ; + } + else { + println!("0") ; + } +} diff --git a/challenge-237/ulrich-rieke/rust/ch-2.rs b/challenge-237/ulrich-rieke/rust/ch-2.rs new file mode 100755 index 0000000000..0060eb6123 --- /dev/null +++ b/challenge-237/ulrich-rieke/rust/ch-2.rs @@ -0,0 +1,27 @@ +use std::io ; +use itertools::Itertools ; + +fn main() { + println!("Enter some integers , separated by spaces!"); + 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 original_numbers : Vec = numbers.clone( ) ; + let len : usize = numbers.len( ) ; + let mut max_greatness : usize = 0 ; + let it = numbers.into_iter( ).permutations( len ) ; + for v in it { + let mut current_greatness : usize = 0 ; + for i in 0..len { + if v[ i ] > original_numbers[ i ] { + current_greatness += 1 ; + } + } + if current_greatness > max_greatness { + max_greatness = current_greatness ; + } + } + println!("{}" , max_greatness ) ; +} diff --git a/stats/pwc-challenge-229.json b/stats/pwc-challenge-229.json index e7a03eac9e..bf66f9167b 100644 --- a/stats/pwc-challenge-229.json +++ b/stats/pwc-challenge-229.json @@ -1,27 +1,219 @@ { - "xAxis" : { - "type" : "category" + "chart" : { + "type" : "column" }, "title" : { "text" : "The Weekly Challenge - 229" }, "plotOptions" : { "series" : { + "borderWidth" : 0, "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - }, - "borderWidth" : 0 + "enabled" : 1, + "format" : "{point.y}" + } } }, "subtitle" : { - "text" : "[Champions: 38] Last updated at 2023-10-01 17:12:10 GMT" + "text" : "[Champions: 37] Last updated at 2023-10-08 18:44:26 GMT" }, + "series" : [ + { + "colorByPoint" : 1, + "data" : [ + { + "y" : 5, + "name" : "Ali Moradi", + "drilldown" : "Ali Moradi" + }, + { + "name" : "Andreas Voegele", + "y" : 3, + "drilldown" : "Andreas Voegele" + }, + { + "drilldown" : "Arne Sommer", + "name" : "Arne Sommer", + "y" : 3 + }, + { + "drilldown" : "Athanasius", + "name" : "Athanasius", + "y" : 4 + }, + { + "y" : 1, + "name" : "Avery Adams", + "drilldown" : "Avery Adams" + }, + { + "y" : 4, + "name" : "BarrOff", + "drilldown" : "BarrOff" + }, + { + "drilldown" : "Bob Lied", + "name" : "Bob Lied", + "y" : 2 + }, + { + "y" : 2, + "name" : "Bruce Gray", + "drilldown" : "Bruce Gray" + }, + { + "drilldown" : "Daniel Pfeiffer", + "name" : "Daniel Pfeiffer", + "y" : 3 + }, + { + "drilldown" : "Dave Jacoby", + "name" : "Dave Jacoby", + "y" : 3 + }, + { + "drilldown" : "David Ferrone", + "name" : "David Ferrone", + "y" : 2 + }, + { + "drilldown" : "E. Choroba", + "name" : "E. Choroba", + "y" : 2 + }, + { + "y" : 2, + "name" : "Feng Chang", + "drilldown" : "Feng Chang" + }, + { + "drilldown" : "Jaldhar H. Vyas", + "y" : 5, + "name" : "Jaldhar H. Vyas" + }, + { + "name" : "Jan Krnavek", + "y" : 2, + "drilldown" : "Jan Krnavek" + }, + { + "y" : 2, + "name" : "Jorg Sommrey", + "drilldown" : "Jorg Sommrey" + }, + { + "drilldown" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld", + "y" : 6 + }, + { + "drilldown" : "Lubos Kolouch", + "name" : "Lubos Kolouch", + "y" : 3 + }, + { + "y" : 8, + "name" : "Luca Ferrari", + "drilldown" : "Luca Ferrari" + }, + { + "drilldown" : "Mark Anderson", + "y" : 2, + "name" : "Mark Anderson" + }, + { + "drilldown" : "Matthew Neleigh", + "name" : "Matthew Neleigh", + "y" : 2 + }, + { + "y" : 3, + "name" : "Matthias Muth", + "drilldown" : "Matthias Muth" + }, + { + "drilldown" : "Niels van Dijke", + "y" : 2, + "name" : "Niels van Dijke" + }, + { + "drilldown" : "Packy Anderson", + "y" : 5, + "name" : "Packy Anderson" + }, + { + "drilldown" : "Peter Campbell Smith", + "name" : "Peter Campbell Smith", + "y" : 3 + }, + { + "drilldown" : "rcmlz", + "y" : 2, + "name" : "rcmlz" + }, + { + "y" : 3, + "name" : "Robbie Hatley", + "drilldown" : "Robbie Hatley" + }, + { + "drilldown" : "Robert DiCicco", + "y" : 4, + "name" : "Robert DiCicco" + }, + { + "drilldown" : "Robert Ransbottom", + "name" : "Robert Ransbottom", + "y" : 2 + }, + { + "drilldown" : "Roger Bell_West", + "name" : "Roger Bell_West", + "y" : 5 + }, + { + "drilldown" : "Solathian", + "y" : 2, + "name" : "Solathian" + }, + { + "drilldown" : "Stephen G. Lynn", + "name" : "Stephen G. Lynn", + "y" : 3 + }, + { + "drilldown" : "Steven Wilson", + "y" : 2, + "name" : "Steven Wilson" + }, + { + "name" : "Thomas Kohler", + "y" : 4, + "drilldown" : "Thomas Kohler" + }, + { + "name" : "Ulrich Rieke", + "y" : 4, + "drilldown" : "Ulrich Rieke" + }, + { + "drilldown" : "W. Luis Mochan", + "name" : "W. Luis Mochan", + "y" : 3 + }, + { + "drilldown" : "Wanderdoc", + "y" : 2, + "name" : "Wanderdoc" + } + ], + "name" : "The Weekly Challenge - 229" + } + ], "drilldown" : { "series" : [ { "id" : "Ali Moradi", - "name" : "Ali Moradi", "data" : [ [ "Perl", @@ -35,10 +227,11 @@ "Blog", 1 ] - ] + ], + "name" : "Ali Moradi" }, { - "name" : "Andreas Voegele", + "id" : "Andreas Voegele", "data" : [ [ "Perl", @@ -49,11 +242,10 @@ 1 ] ], - "id" : "Andreas Voegele" + "name" : "Andreas Voegele" }, { "id" : "Arne Sommer", - "name" : "Arne Sommer", "data" : [ [ "Raku", @@ -63,9 +255,12 @@ "Blog", 1 ] - ] + ], + "name" : "Arne Sommer" }, { + "name" : "Athanasius", + "id" : "Athanasius", "data" : [ [ "Perl", @@ -75,9 +270,7 @@ "Raku", 2 ] - ], - "name" : "Athanasius", - "id" : "Athanasius" + ] }, { "name" : "Avery Adams", @@ -90,6 +283,8 @@ "id" : "Avery Adams" }, { + "name" : "BarrOff", + "id" : "BarrOff", "data" : [ [ "Perl", @@ -99,33 +294,31 @@ "Raku", 2 ] - ], - "name" : "BarrOff", - "id" : "BarrOff" + ] }, { - "id" : "Bob Lied", + "name" : "Bob Lied", "data" : [ [ "Perl", 2 ] ], - "name" : "Bob Lied" + "id" : "Bob Lied" }, { - "id" : "Bruce Gray", - "name" : "Bruce Gray", "data" : [ [ "Raku", 2 ] - ] + ], + "id" : "Bruce Gray", + "name" : "Bruce Gray" }, { - "id" : "Daniel Pfeiffer", "name" : "Daniel Pfeiffer", + "id" : "Daniel Pfeiffer", "data" : [ [ "Perl", @@ -138,7 +331,6 @@ ] }, { - "id" : "Dave Jacoby", "data" : [ [ "Perl", @@ -149,40 +341,40 @@ 1 ] ], + "id" : "Dave Jacoby", "name" : "Dave Jacoby" }, { - "id" : "David Ferrone", "data" : [ [ "Perl", 2 ] ], + "id" : "David Ferrone", "name" : "David Ferrone" }, { - "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] ], + "id" : "E. Choroba", "name" : "E. Choroba" }, { - "id" : "Feng Chang", "data" : [ [ "Raku", 2 ] ], + "id" : "Feng Chang", "name" : "Feng Chang" }, { - "name" : "Flavio Poletti", "data" : [ [ "Perl", @@ -194,52 +386,34 @@ ], [ "Blog", - 2 + 1 ] ], - "id" : "Flavio Poletti" - }, - { "id" : "Jaldhar H. Vyas", - "name" : "Jaldhar H. Vyas", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ] + "name" : "Jaldhar H. Vyas" }, { + "name" : "Jan Krnavek", + "id" : "Jan Krnavek", "data" : [ [ "Raku", 2 ] - ], - "name" : "Jan Krnavek", - "id" : "Jan Krnavek" + ] }, { "id" : "Jorg Sommrey", - "name" : "Jorg Sommrey", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Jorg Sommrey" }, { "id" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -253,11 +427,10 @@ "Blog", 2 ] - ] + ], + "name" : "Laurent Rosenfeld" }, { - "id" : "Lubos Kolouch", - "name" : "Lubos Kolouch", "data" : [ [ "Perl", @@ -267,10 +440,12 @@ "Blog", 1 ] - ] + ], + "id" : "Lubos Kolouch", + "name" : "Lubos Kolouch" }, { - "id" : "Luca Ferrari", + "name" : "Luca Ferrari", "data" : [ [ "Raku", @@ -281,21 +456,21 @@ 6 ] ], - "name" : "Luca Ferrari" + "id" : "Luca Ferrari" }, { - "id" : "Mark Anderson", + "name" : "Mark Anderson", "data" : [ [ "Raku", 2 ] ], - "name" : "Mark Anderson" + "id" : "Mark Anderson" }, { - "id" : "Matthew Neleigh", "name" : "Matthew Neleigh", + "id" : "Matthew Neleigh", "data" : [ [ "Perl", @@ -314,21 +489,21 @@ 1 ] ], - "name" : "Matthias Muth", - "id" : "Matthias Muth" + "id" : "Matthias Muth", + "name" : "Matthias Muth" }, { - "name" : "Niels van Dijke", + "id" : "Niels van Dijke", "data" : [ [ "Perl", 2 ] ], - "id" : "Niels van Dijke" + "name" : "Niels van Dijke" }, { - "name" : "Packy Anderson", + "id" : "Packy Anderson", "data" : [ [ "Perl", @@ -343,10 +518,9 @@ 1 ] ], - "id" : "Packy Anderson" + "name" : "Packy Anderson" }, { - "id" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -357,20 +531,22 @@ 1 ] ], + "id" : "Peter Campbell Smith", "name" : "Peter Campbell Smith" }, { - "name" : "rcmlz", + "id" : "rcmlz", "data" : [ [ "Raku", 2 ] ], - "id" : "rcmlz" + "name" : "rcmlz" }, { "name" : "Robbie Hatley", + "id" : "Robbie Hatley", "data" : [ [ "Perl", @@ -380,8 +556,7 @@ "Blog", 1 ] - ], - "id" : "Robbie Hatley" + ] }, { "data" : [ @@ -394,20 +569,21 @@ 2 ] ], - "name" : "Robert DiCicco", - "id" : "Robert DiCicco" + "id" : "Robert DiCicco", + "name" : "Robert DiCicco" }, { - "id" : "Robert Ransbottom", + "name" : "Robert Ransbottom", "data" : [ [ "Raku", 2 ] ], - "name" : "Robert Ransbottom" + "id" : "Robert Ransbottom" }, { + "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -422,8 +598,7 @@ 1 ] ], - "name" : "Roger Bell_West", - "id" : "Roger Bell_West" + "name" : "Roger Bell_West" }, { "name" : "Solathian", @@ -436,7 +611,7 @@ "id" : "Solathian" }, { - "name" : "Stephen G. Lynn", + "id" : "Stephen G. Lynn", "data" : [ [ "Perl", @@ -447,17 +622,17 @@ 1 ] ], - "id" : "Stephen G. Lynn" + "name" : "Stephen G. Lynn" }, { "id" : "Steven Wilson", - "name" : "Steven Wilson", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Steven Wilson" }, { "id" : "Thomas Kohler", @@ -474,6 +649,7 @@ "name" : "Thomas Kohler" }, { + "name" : "Ulrich Rieke", "id" : "Ulrich Rieke", "data" : [ [ @@ -484,11 +660,10 @@ "Raku", 2 ] - ], - "name" : "Ulrich Rieke" + ] }, { - "name" : "W. Luis Mochan", + "id" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -499,20 +674,23 @@ 1 ] ], - "id" : "W. Luis Mochan" + "name" : "W. Luis Mochan" }, { + "name" : "Wanderdoc", "data" : [ [ "Perl", 2 ] ], - "name" : "Wanderdoc", "id" : "Wanderdoc" } ] }, + "xAxis" : { + "type" : "category" + }, "yAxis" : { "title" : { "text" : "Total Solutions" @@ -521,210 +699,9 @@ "legend" : { "enabled" : 0 }, - "chart" : { - "type" : "column" - }, - "series" : [ - { - "colorByPoint" : 1, - "name" : "The Weekly Challenge - 229", - "data" : [ - { - "y" : 5, - "drilldown" : "Ali Moradi", - "name" : "Ali Moradi" - }, - { - "name" : "Andreas Voegele", - "drilldown" : "Andreas Voegele", - "y" : 3 - }, - { - "name" : "Arne Sommer", - "drilldown" : "Arne Sommer", - "y" : 3 - }, - { - "drilldown" : "Athanasius", - "y" : 4, - "name" : "Athanasius" - }, - { - "name" : "Avery Adams", - "drilldown" : "Avery Adams", - "y" : 1 - }, - { - "drilldown" : "BarrOff", - "y" : 4, - "name" : "BarrOff" - }, - { - "name" : "Bob Lied", - "y" : 2, - "drilldown" : "Bob Lied" - }, - { - "name" : "Bruce Gray", - "drilldown" : "Bruce Gray", - "y" : 2 - }, - { - "y" : 3, - "drilldown" : "Daniel Pfeiffer", - "name" : "Daniel Pfeiffer" - }, - { - "drilldown" : "Dave Jacoby", - "y" : 3, - "name" : "Dave Jacoby" - }, - { - "y" : 2, - "drilldown" : "David Ferrone", - "name" : "David Ferrone" - }, - { - "name" : "E. Choroba", - "drilldown" : "E. Choroba", - "y" : 2 - }, - { - "name" : "Feng Chang", - "y" : 2, - "drilldown" : "Feng Chang" - }, - { - "drilldown" : "Flavio Poletti", - "y" : 6, - "name" : "Flavio Poletti" - }, - { - "y" : 5, - "drilldown" : "Jaldhar H. Vyas", - "name" : "Jaldhar H. Vyas" - }, - { - "drilldown" : "Jan Krnavek", - "y" : 2, - "name" : "Jan Krnavek" - }, - { - "y" : 2, - "drilldown" : "Jorg Sommrey", - "name" : "Jorg Sommrey" - }, - { - "y" : 6, - "drilldown" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld" - }, - { - "y" : 3, - "drilldown" : "Lubos Kolouch", - "name" : "Lubos Kolouch" - }, - { - "name" : "Luca Ferrari", - "drilldown" : "Luca Ferrari", - "y" : 8 - }, - { - "name" : "Mark Anderson", - "drilldown" : "Mark Anderson", - "y" : 2 - }, - { - "y" : 2, - "drilldown" : "Matthew Neleigh", - "name" : "Matthew Neleigh" - }, - { - "name" : "Matthias Muth", - "y" : 3, - "drilldown" : "Matthias Muth" - }, - { - "drilldown" : "Niels van Dijke", - "y" : 2, - "name" : "Niels van Dijke" - }, - { - "y" : 5, - "drilldown" : "Packy Anderson", - "name" : "Packy Anderson" - }, - { - "drilldown" : "Peter Campbell Smith", - "y" : 3, - "name" : "Peter Campbell Smith" - }, - { - "name" : "rcmlz", - "drilldown" : "rcmlz", - "y" : 2 - }, - { - "drilldown" : "Robbie Hatley", - "y" : 3, - "name" : "Robbie Hatley" - }, - { - "name" : "Robert DiCicco", - "y" : 4, - "drilldown" : "Robert DiCicco" - }, - { - "drilldown" : "Robert Ransbottom", - "y" : 2, - "name" : "Robert Ransbottom" - }, - { - "name" : "Roger Bell_West", - "drilldown" : "Roger Bell_West", - "y" : 5 - }, - { - "y" : 2, - "drilldown" : "Solathian", - "name" : "Solathian" - }, - { - "drilldown" : "Stephen G. Lynn", - "y" : 3, - "name" : "Stephen G. Lynn" - }, - { - "drilldown" : "Steven Wilson", - "y" : 2, - "name" : "Steven Wilson" - }, - { - "y" : 4, - "drilldown" : "Thomas Kohler", - "name" : "Thomas Kohler" - }, - { - "y" : 4, - "drilldown" : "Ulrich Rieke", - "name" : "Ulrich Rieke" - }, - { - "y" : 3, - "drilldown" : "W. Luis Mochan", - "name" : "W. Luis Mochan" - }, - { - "y" : 2, - "drilldown" : "Wanderdoc", - "name" : "Wanderdoc" - } - ] - } - ], "tooltip" : { + "headerFormat" : "{series.name}
", "pointFormat" : "{point.name}: {point.y:f}
", - "followPointer" : 1, - "headerFormat" : "{series.name}
" + "followPointer" : 1 } } diff --git a/stats/pwc-challenge-236.json b/stats/pwc-challenge-236.json index b95a94b489..c4713d3674 100644 --- a/stats/pwc-challenge-236.json +++ b/stats/pwc-challenge-236.json @@ -1,23 +1,201 @@ { - "subtitle" : { - "text" : "[Champions: 32] Last updated at 2023-10-03 11:28:05 GMT" + "xAxis" : { + "type" : "category" }, - "chart" : { - "type" : "column" + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "legend" : { + "enabled" : 0 }, "tooltip" : { "headerFormat" : "{series.name}
", - "followPointer" : 1, - "pointFormat" : "{point.name}: {point.y:f}
" - }, - "title" : { - "text" : "The Weekly Challenge - 236" + "pointFormat" : "{point.name}: {point.y:f}
", + "followPointer" : 1 }, + "series" : [ + { + "colorByPoint" : 1, + "data" : [ + { + "y" : 3, + "name" : "Adam Russell", + "drilldown" : "Adam Russell" + }, + { + "drilldown" : "Ali Moradi", + "name" : "Ali Moradi", + "y" : 5 + }, + { + "y" : 3, + "name" : "Arne Sommer", + "drilldown" : "Arne Sommer" + }, + { + "name" : "Athanasius", + "y" : 4, + "drilldown" : "Athanasius" + }, + { + "name" : "Avery Adams", + "y" : 3, + "drilldown" : "Avery Adams" + }, + { + "drilldown" : "Bob Lied", + "name" : "Bob Lied", + "y" : 4 + }, + { + "y" : 2, + "name" : "Bruce Gray", + "drilldown" : "Bruce Gray" + }, + { + "drilldown" : "Cheok-Yin Fung", + "y" : 2, + "name" : "Cheok-Yin Fung" + }, + { + "name" : "Dave Jacoby", + "y" : 2, + "drilldown" : "Dave Jacoby" + }, + { + "y" : 2, + "name" : "David Ferrone", + "drilldown" : "David Ferrone" + }, + { + "drilldown" : "E. Choroba", + "name" : "E. Choroba", + "y" : 2 + }, + { + "name" : "Flavio Poletti", + "y" : 6, + "drilldown" : "Flavio Poletti" + }, + { + "y" : 5, + "name" : "Jaldhar H. Vyas", + "drilldown" : "Jaldhar H. Vyas" + }, + { + "drilldown" : "Jan Krnavek", + "name" : "Jan Krnavek", + "y" : 2 + }, + { + "drilldown" : "Jorg Sommrey", + "y" : 2, + "name" : "Jorg Sommrey" + }, + { + "y" : 6, + "name" : "Laurent Rosenfeld", + "drilldown" : "Laurent Rosenfeld" + }, + { + "name" : "Lubos Kolouch", + "y" : 5, + "drilldown" : "Lubos Kolouch" + }, + { + "drilldown" : "Luca Ferrari", + "name" : "Luca Ferrari", + "y" : 8 + }, + { + "name" : "Mark Anderson", + "y" : 2, + "drilldown" : "Mark Anderson" + }, + { + "drilldown" : "Matthew Neleigh", + "name" : "Matthew Neleigh", + "y" : 2 + }, + { + "name" : "Matthias Muth", + "y" : 3, + "drilldown" : "Matthias Muth" + }, + { + "drilldown" : "Niels van Dijke", + "name" : "Niels van Dijke", + "y" : 2 + }, + { + "drilldown" : "Packy Anderson", + "name" : "Packy Anderson", + "y" : 5 + }, + { + "y" : 3, + "name" : "Peter Campbell Smith", + "drilldown" : "Peter Campbell Smith" + }, + { + "drilldown" : "rcmlz", + "y" : 2, + "name" : "rcmlz" + }, + { + "name" : "Robert DiCicco", + "y" : 4, + "drilldown" : "Robert DiCicco" + }, + { + "drilldown" : "Robert Ransbottom", + "name" : "Robert Ransbottom", + "y" : 2 + }, + { + "drilldown" : "Roger Bell_West", + "y" : 5, + "name" : "Roger Bell_West" + }, + { + "y" : 4, + "name" : "Shimon Bollinger", + "drilldown" : "Shimon Bollinger" + }, + { + "y" : 3, + "name" : "Simon Green", + "drilldown" : "Simon Green" + }, + { + "drilldown" : "Thomas Kohler", + "y" : 4, + "name" : "Thomas Kohler" + }, + { + "drilldown" : "W. Luis Mochan", + "name" : "W. Luis Mochan", + "y" : 3 + }, + { + "y" : 2, + "name" : "Wanderdoc", + "drilldown" : "Wanderdoc" + }, + { + "drilldown" : "Yves Orton", + "name" : "Yves Orton", + "y" : 2 + } + ], + "name" : "The Weekly Challenge - 236" + } + ], "drilldown" : { "series" : [ { - "id" : "Adam Russell", - "name" : "Adam Russell", "data" : [ [ "Perl", @@ -27,7 +205,9 @@ "Blog", 1 ] - ] + ], + "id" : "Adam Russell", + "name" : "Adam Russell" }, { "data" : [ @@ -44,12 +224,10 @@ 1 ] ], - "name" : "Ali Moradi", - "id" : "Ali Moradi" + "id" : "Ali Moradi", + "name" : "Ali Moradi" }, { - "name" : "Arne Sommer", - "id" : "Arne Sommer", "data" : [ [ "Raku", @@ -59,9 +237,12 @@ "Blog", 1 ] - ] + ], + "id" : "Arne Sommer", + "name" : "Arne Sommer" }, { + "id" : "Athanasius", "data" : [ [ "Perl", @@ -72,10 +253,10 @@ 2 ] ], - "name" : "Athanasius", - "id" : "Athanasius" + "name" : "Athanasius" }, { + "name" : "Avery Adams", "data" : [ [ "Perl", @@ -86,12 +267,10 @@ 2 ] ], - "name" : "Avery Adams", "id" : "Avery Adams" }, { "name" : "Bob Lied", - "id" : "Bob Lied", "data" : [ [ "Perl", @@ -101,7 +280,8 @@ "Blog", 2 ] - ] + ], + "id" : "Bob Lied" }, { "name" : "Bruce Gray", @@ -114,24 +294,24 @@ ] }, { + "name" : "Cheok-Yin Fung", + "id" : "Cheok-Yin Fung", "data" : [ [ "Perl", 2 ] - ], - "name" : "Cheok-Yin Fung", - "id" : "Cheok-Yin Fung" + ] }, { + "id" : "Dave Jacoby", "data" : [ [ "Perl", 2 ] ], - "name" : "Dave Jacoby", - "id" : "Dave Jacoby" + "name" : "Dave Jacoby" }, { "data" : [ @@ -144,18 +324,35 @@ "name" : "David Ferrone" }, { - "id" : "E. Choroba", "name" : "E. Choroba", + "id" : "E. Choroba", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "name" : "Flavio Poletti", + "id" : "Flavio Poletti", "data" : [ [ "Perl", 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 2 ] ] }, { "id" : "Jaldhar H. Vyas", - "name" : "Jaldhar H. Vyas", "data" : [ [ "Perl", @@ -169,7 +366,8 @@ "Blog", 1 ] - ] + ], + "name" : "Jaldhar H. Vyas" }, { "name" : "Jan Krnavek", @@ -183,13 +381,13 @@ }, { "name" : "Jorg Sommrey", - "id" : "Jorg Sommrey", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Jorg Sommrey" }, { "name" : "Laurent Rosenfeld", @@ -210,6 +408,8 @@ ] }, { + "name" : "Lubos Kolouch", + "id" : "Lubos Kolouch", "data" : [ [ "Perl", @@ -223,13 +423,9 @@ "Blog", 1 ] - ], - "name" : "Lubos Kolouch", - "id" : "Lubos Kolouch" + ] }, { - "name" : "Luca Ferrari", - "id" : "Luca Ferrari", "data" : [ [ "Raku", @@ -239,30 +435,31 @@ "Blog", 6 ] - ] + ], + "id" : "Luca Ferrari", + "name" : "Luca Ferrari" }, { "name" : "Mark Anderson", - "id" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ] + ], + "id" : "Mark Anderson" }, { + "name" : "Matthew Neleigh", + "id" : "Matthew Neleigh", "data" : [ [ "Perl", 2 ] - ], - "name" : "Matthew Neleigh", - "id" : "Matthew Neleigh" + ] }, { - "id" : "Matthias Muth", "name" : "Matthias Muth", "data" : [ [ @@ -273,7 +470,8 @@ "Blog", 1 ] - ] + ], + "id" : "Matthias Muth" }, { "name" : "Niels van Dijke", @@ -286,6 +484,8 @@ ] }, { +