From 0052ec63ca70eaa6d9ffb1926c294dbfd85f8c05 Mon Sep 17 00:00:00 2001 From: Mohammad Sajid Anwar Date: Wed, 18 Sep 2024 20:18:52 +0100 Subject: - Added solutions by Paulo Custodio. - Added solutions by Peter Campbell Smith. - Added solutions by Robert Ransbottom. - Added solutions by Feng Chang. - Added solutions by PokGoPun. - Added solutions by Peter Pentchev. - Added solutions by Santiago Leyva. - Added solutions by Robbie Hatley. - Added solutions by Ulrich Rieke. - Added solutions by Laurent Rosenfeld. --- challenge-286/santiago-leyva/perl/ch-01.pl | 20 - challenge-286/santiago-leyva/perl/ch-02.pl | 115 ---- challenge-286/santiago-leyva/perl/ch-1.pl | 20 + challenge-286/santiago-leyva/perl/ch-2.pl | 115 ++++ challenge-287/laurent-rosenfeld/blog.txt | 1 + challenge-287/laurent-rosenfeld/blog1.txt | 1 + challenge-287/laurent-rosenfeld/perl/ch-1.pl | 32 + challenge-287/laurent-rosenfeld/perl/ch-2.pl | 19 + challenge-287/laurent-rosenfeld/raku/ch-1.raku | 27 + challenge-287/laurent-rosenfeld/raku/ch-2.raku | 17 + challenge-287/santiago-leyva/perl/ch-01.pl | 65 --- challenge-287/santiago-leyva/perl/ch-02.pl | 23 - challenge-287/santiago-leyva/perl/ch-1.pl | 65 +++ challenge-287/santiago-leyva/perl/ch-2.pl | 23 + challenge-287/ulrich-rieke/cpp/ch-1.cpp | 71 +++ challenge-287/ulrich-rieke/cpp/ch-2.cpp | 22 + challenge-287/ulrich-rieke/haskell/ch-1.hs | 32 + challenge-287/ulrich-rieke/haskell/ch-2.hs | 64 ++ challenge-287/ulrich-rieke/perl/ch-1.pl | 31 + challenge-287/ulrich-rieke/perl/ch-2.pl | 19 + challenge-287/ulrich-rieke/raku/ch-1.raku | 28 + challenge-287/ulrich-rieke/raku/ch-2.raku | 16 + challenge-287/ulrich-rieke/rust/ch-1.rs | 37 ++ challenge-287/ulrich-rieke/rust/ch-2.rs | 18 + stats/pwc-challenge-286.json | 307 +++++----- stats/pwc-current.json | 304 +++++++--- stats/pwc-language-breakdown-2019.json | 634 ++++++++++---------- stats/pwc-language-breakdown-2020.json | 366 ++++++------ stats/pwc-language-breakdown-2021.json | 400 ++++++------- stats/pwc-language-breakdown-2022.json | 770 ++++++++++++------------ stats/pwc-language-breakdown-2023.json | 774 ++++++++++++------------- stats/pwc-language-breakdown-2024.json | 298 +++++----- stats/pwc-language-breakdown-summary.json | 52 +- stats/pwc-leaders.json | 744 ++++++++++++------------ stats/pwc-summary-1-30.json | 54 +- stats/pwc-summary-121-150.json | 44 +- stats/pwc-summary-151-180.json | 114 ++-- stats/pwc-summary-181-210.json | 86 +-- stats/pwc-summary-211-240.json | 58 +- stats/pwc-summary-241-270.json | 108 ++-- stats/pwc-summary-271-300.json | 102 ++-- stats/pwc-summary-301-330.json | 60 +- stats/pwc-summary-31-60.json | 100 ++-- stats/pwc-summary-61-90.json | 108 ++-- stats/pwc-summary-91-120.json | 116 ++-- stats/pwc-summary.json | 710 +++++++++++------------ stats/pwc-yearly-language-summary.json | 90 +-- 47 files changed, 3937 insertions(+), 3343 deletions(-) delete mode 100644 challenge-286/santiago-leyva/perl/ch-01.pl delete mode 100644 challenge-286/santiago-leyva/perl/ch-02.pl create mode 100644 challenge-286/santiago-leyva/perl/ch-1.pl create mode 100644 challenge-286/santiago-leyva/perl/ch-2.pl create mode 100644 challenge-287/laurent-rosenfeld/blog.txt create mode 100644 challenge-287/laurent-rosenfeld/blog1.txt create mode 100644 challenge-287/laurent-rosenfeld/perl/ch-1.pl create mode 100644 challenge-287/laurent-rosenfeld/perl/ch-2.pl create mode 100644 challenge-287/laurent-rosenfeld/raku/ch-1.raku create mode 100644 challenge-287/laurent-rosenfeld/raku/ch-2.raku delete mode 100644 challenge-287/santiago-leyva/perl/ch-01.pl delete mode 100644 challenge-287/santiago-leyva/perl/ch-02.pl create mode 100644 challenge-287/santiago-leyva/perl/ch-1.pl create mode 100644 challenge-287/santiago-leyva/perl/ch-2.pl create mode 100755 challenge-287/ulrich-rieke/cpp/ch-1.cpp create mode 100755 challenge-287/ulrich-rieke/cpp/ch-2.cpp create mode 100755 challenge-287/ulrich-rieke/haskell/ch-1.hs create mode 100755 challenge-287/ulrich-rieke/haskell/ch-2.hs create mode 100755 challenge-287/ulrich-rieke/perl/ch-1.pl create mode 100755 challenge-287/ulrich-rieke/perl/ch-2.pl create mode 100755 challenge-287/ulrich-rieke/raku/ch-1.raku create mode 100755 challenge-287/ulrich-rieke/raku/ch-2.raku create mode 100755 challenge-287/ulrich-rieke/rust/ch-1.rs create mode 100755 challenge-287/ulrich-rieke/rust/ch-2.rs diff --git a/challenge-286/santiago-leyva/perl/ch-01.pl b/challenge-286/santiago-leyva/perl/ch-01.pl deleted file mode 100644 index c0b9890959..0000000000 --- a/challenge-286/santiago-leyva/perl/ch-01.pl +++ /dev/null @@ -1,20 +0,0 @@ -use strict; -use warnings; -my $filename = $0; -my @array; - -open FH,'<',$filename or die "can't open source code"; - -while(my $script = ){ - #chomp($script); - $script =~ s/^\s+//; - #print $script; - my @temp = split(/\s/,$script); - push @array, @temp; -} -close(FH) or die "can't close file $filename"; - -print "\n["; -print join(",",@array); -print "]"; - diff --git a/challenge-286/santiago-leyva/perl/ch-02.pl b/challenge-286/santiago-leyva/perl/ch-02.pl deleted file mode 100644 index 0ee3d29728..0000000000 --- a/challenge-286/santiago-leyva/perl/ch-02.pl +++ /dev/null @@ -1,115 +0,0 @@ -=begin -You are given an array of integers, @ints, whose length is a power of 2. - -Write a script to play the order game (min and max) and return the last element. - -Example 1 -Input: @ints = (2, 1, 4, 5, 6, 3, 0, 2) #8 -> 2**3 -Output: 1 - -Operation 1: - - min(2, 1) = 1 - max(4, 5) = 5 - min(6, 3) = 3 - max(0, 2) = 2 - -Operation 2: - - min(1, 5) = 1 - max(3, 2) = 3 - -Operation 3: - - min(1, 3) = 1 -Example 2 -Input: @ints = (0, 5, 3, 2) -Output: 0 - -Operation 1: - - min(0, 5) = 0 - max(3, 2) = 3 - -Operation 2: - - min(0, 3) = 0 -Example 3 -Input: @ints = (9, 2, 1, 4, 5, 6, 0, 7, 3, 1, 3, 5, 7, 9, 0, 8) -Output: 2 - -Operation 1: - - min(9, 2) = 2 - max(1, 4) = 4 - min(5, 6) = 5 - max(0, 7) = 7 - min(3, 1) = 1 - max(3, 5) = 5 - min(7, 9) = 7 - max(0, 8) = 8 - -Operation 2: - - min(2, 4) = 2 - max(5, 7) = 7 - min(1, 5) = 1 - max(7, 8) = 8 - -Operation 3: - - min(2, 7) = 2 - max(1, 8) = 8 - -Operation 4: - - min(2, 8) = 2 -=cut - -use strict; -use warnings; -use List::Util qw(max); -use List::Util qw(min); - -my @ints = ([2, 1, 4, 5, 6, 3, 0, 2],[0, 5, 3, 2],[9, 2, 1, 4, 5, 6, 0, 7, 3, 1, 3, 5, 7, 9, 0, 8],[10],[200,2]); - -foreach(@ints){ - my $a = $_; - my $result = playGame(\@$a); - print "$result \n"; -} - -sub playGame { - my $arr = shift; - my @A = @$arr; - my $length = scalar @A; - - return $A[0] if $length == 1; - return min($A[0],$A[1]) if $length == 2; - - my ($num1,$num2); - my ($min,$max); - my $op = 1; - while(scalar $length > 1){ - my @res; - for(my $i=0;$i<$length;$i+=2){ - if($op % 2 != 0){ - $num1 = $A[$i]; - $num2 = $A[$i+1]; - $max = min($num1,$num2); - push @res,$max; - $op += 1; - }else{ - $num1 = $A[$i]; - $num2 = $A[$i+1]; - $min = max($num1,$num2); - push @res,$min; - $op += 1; - } - } - $op = 1; - @A = @res; - $length = scalar @A; - } - return $A[0]; -} \ No newline at end of file diff --git a/challenge-286/santiago-leyva/perl/ch-1.pl b/challenge-286/santiago-leyva/perl/ch-1.pl new file mode 100644 index 0000000000..c0b9890959 --- /dev/null +++ b/challenge-286/santiago-leyva/perl/ch-1.pl @@ -0,0 +1,20 @@ +use strict; +use warnings; +my $filename = $0; +my @array; + +open FH,'<',$filename or die "can't open source code"; + +while(my $script = ){ + #chomp($script); + $script =~ s/^\s+//; + #print $script; + my @temp = split(/\s/,$script); + push @array, @temp; +} +close(FH) or die "can't close file $filename"; + +print "\n["; +print join(",",@array); +print "]"; + diff --git a/challenge-286/santiago-leyva/perl/ch-2.pl b/challenge-286/santiago-leyva/perl/ch-2.pl new file mode 100644 index 0000000000..0ee3d29728 --- /dev/null +++ b/challenge-286/santiago-leyva/perl/ch-2.pl @@ -0,0 +1,115 @@ +=begin +You are given an array of integers, @ints, whose length is a power of 2. + +Write a script to play the order game (min and max) and return the last element. + +Example 1 +Input: @ints = (2, 1, 4, 5, 6, 3, 0, 2) #8 -> 2**3 +Output: 1 + +Operation 1: + + min(2, 1) = 1 + max(4, 5) = 5 + min(6, 3) = 3 + max(0, 2) = 2 + +Operation 2: + + min(1, 5) = 1 + max(3, 2) = 3 + +Operation 3: + + min(1, 3) = 1 +Example 2 +Input: @ints = (0, 5, 3, 2) +Output: 0 + +Operation 1: + + min(0, 5) = 0 + max(3, 2) = 3 + +Operation 2: + + min(0, 3) = 0 +Example 3 +Input: @ints = (9, 2, 1, 4, 5, 6, 0, 7, 3, 1, 3, 5, 7, 9, 0, 8) +Output: 2 + +Operation 1: + + min(9, 2) = 2 + max(1, 4) = 4 + min(5, 6) = 5 + max(0, 7) = 7 + min(3, 1) = 1 + max(3, 5) = 5 + min(7, 9) = 7 + max(0, 8) = 8 + +Operation 2: + + min(2, 4) = 2 + max(5, 7) = 7 + min(1, 5) = 1 + max(7, 8) = 8 + +Operation 3: + + min(2, 7) = 2 + max(1, 8) = 8 + +Operation 4: + + min(2, 8) = 2 +=cut + +use strict; +use warnings; +use List::Util qw(max); +use List::Util qw(min); + +my @ints = ([2, 1, 4, 5, 6, 3, 0, 2],[0, 5, 3, 2],[9, 2, 1, 4, 5, 6, 0, 7, 3, 1, 3, 5, 7, 9, 0, 8],[10],[200,2]); + +foreach(@ints){ + my $a = $_; + my $result = playGame(\@$a); + print "$result \n"; +} + +sub playGame { + my $arr = shift; + my @A = @$arr; + my $length = scalar @A; + + return $A[0] if $length == 1; + return min($A[0],$A[1]) if $length == 2; + + my ($num1,$num2); + my ($min,$max); + my $op = 1; + while(scalar $length > 1){ + my @res; + for(my $i=0;$i<$length;$i+=2){ + if($op % 2 != 0){ + $num1 = $A[$i]; + $num2 = $A[$i+1]; + $max = min($num1,$num2); + push @res,$max; + $op += 1; + }else{ + $num1 = $A[$i]; + $num2 = $A[$i+1]; + $min = max($num1,$num2); + push @res,$min; + $op += 1; + } + } + $op = 1; + @A = @res; + $length = scalar @A; + } + return $A[0]; +} \ No newline at end of file diff --git a/challenge-287/laurent-rosenfeld/blog.txt b/challenge-287/laurent-rosenfeld/blog.txt new file mode 100644 index 0000000000..7a3a66c7f0 --- /dev/null +++ b/challenge-287/laurent-rosenfeld/blog.txt @@ -0,0 +1 @@ +https://blogs.perl.org/users/laurent_r/2024/09/perl-weekly-challenge-287-strong-password.html diff --git a/challenge-287/laurent-rosenfeld/blog1.txt b/challenge-287/laurent-rosenfeld/blog1.txt new file mode 100644 index 0000000000..24111c72a2 --- /dev/null +++ b/challenge-287/laurent-rosenfeld/blog1.txt @@ -0,0 +1 @@ +https://blogs.perl.org/users/laurent_r/2024/09/perl-weekly-challenge-287-valid-number.html diff --git a/challenge-287/laurent-rosenfeld/perl/ch-1.pl b/challenge-287/laurent-rosenfeld/perl/ch-1.pl new file mode 100644 index 0000000000..3639c82386 --- /dev/null +++ b/challenge-287/laurent-rosenfeld/perl/ch-1.pl @@ -0,0 +1,32 @@ +use strict; +use warnings; +use feature 'say'; uppercase chara cter class + +sub strong_password { + my $pwd = shift; + my $count = 0; + # At least one uppercase letter + $pwd .= "A" and $count++ if $pwd !~ /[A-Z]/; + # At least one lowercase letter + $pwd .= "b" and $count++ if $pwd !~ /[a-z]/; + # At least one digit + $pwd .= "3" and $count++ if $pwd !~ /\d/; + # no repeating characters + while ($pwd =~ /(.)\1{2}/) { + my $subst = chr (1 + ord $1); + $pwd =~ s/(.)$1{2}/$1$1$subst/; + $count++; + } + for my $ch ('a'..'z') { + last if length $pwd >= 6; + $count++; + $pwd .= $ch + } + return $count; +} + +my @tests = qw; +for my $test (@tests) { + printf "%-10s => ", $test; + say strong_password $test; +} diff --git a/challenge-287/laurent-rosenfeld/perl/ch-2.pl b/challenge-287/laurent-rosenfeld/perl/ch-2.pl new file mode 100644 index 0000000000..074284f55e --- /dev/null +++ b/challenge-287/laurent-rosenfeld/perl/ch-2.pl @@ -0,0 +1,19 @@ +use strict; +use warnings; +use feature 'say'; + +sub valid_number { + my $in = shift; + return "True" if $in =~ + /^[+-]? # start of string & optional + or - sign + ( \d+\.? # digit(s) followed by a dot + | \d*\.\d+) # or digits with a dot inside or before + ([eE][+-]\d+)? # optional positive or negative exponent + $/x; # end of string & option to enable comments + return "False"; +} +my @tests = qw<1 a . 1.2e4.2 -1 +1E-8 .44 16 12.5 5e17e3 foo>; +for my $test (@tests) { + printf "%-10s => ", $test; + say valid_number $test; +} diff --git a/challenge-287/laurent-rosenfeld/raku/ch-1.raku b/challenge-287/laurent-rosenfeld/raku/ch-1.raku new file mode 100644 index 0000000000..785ab93054 --- /dev/null +++ b/challenge-287/laurent-rosenfeld/raku/ch-1.raku @@ -0,0 +1,27 @@ +sub strong-password ($pwd is copy) { + my $count = 0; + # At least one uppercase letter + $pwd ~= "A" and $count++ if $pwd !~~ /<:Lu>/; + # At least one lowercase letter + $pwd ~= "b" and $count++ if $pwd !~~ /<:Ll>/; + # At least one digit + $pwd ~= "3" and $count++ if $pwd !~~ /\d/; + # no repeating characters + while $pwd ~~ /(.)$0**2/ { + my $subst = ($0.ord + 1).chr; + $pwd ~~ s/(.)$0**2/$0$0$subst/; + $count++; + } + for 'a'..'z' -> $ch { + last if $pwd.chars >= 6; + $count++; + $pwd ~= $ch + } + return $count; +} + +my @tests = ; +for @tests -> $test { + printf "%-10s => ", $test; + say strong-password $test; +} diff --git a/challenge-287/laurent-rosenfeld/raku/ch-2.raku b/challenge-287/laurent-rosenfeld/raku/ch-2.raku new file mode 100644 index 0000000000..d9e0999221 --- /dev/null +++ b/challenge-287/laurent-rosenfeld/raku/ch-2.raku @@ -0,0 +1,17 @@ +sub valid-number ($in) { + my token sign { <[+-]> } + my regex integer { ? \d+ } + my token exponent { <[eE]> } + my token decimal { + '.'? | ? '.'? \d+ | '.' \d+ + } + my regex float { } + my token number { | ( ?) } + + return so $in ~~ /^ $/ ; +} + +for <1 a . 1.2e4.2 -1 +1E-8 .44 16 12.5 5e17e3 foo> -> $test { + printf "%-10s => ", $test; + say valid-number $test; +} diff --git a/challenge-287/santiago-leyva/perl/ch-01.pl b/challenge-287/santiago-leyva/perl/ch-01.pl deleted file mode 100644 index f545e66ffb..0000000000 --- a/challenge-287/santiago-leyva/perl/ch-01.pl +++ /dev/null @@ -1,65 +0,0 @@ - -use strict; -use warnings; - -my @passwords = ('a',"aB2","PaaSW0rd","Paaasw0rd","aaaaa","axmlsa"); - -foreach(@passwords){ - print "--> checking password $_ | "; - my $result = checkPassword($_); - print "changes that need to be made: $result\n"; -} - -sub checkPassword { - my $pass = shift; - my $length = length($pass); - my $changes = 0; - my $least6 = $pass =~ /.{6,}/; - my $lower = $pass =~ /(?=.*[a-z])/; - my $upper = $pass =~ /(?=.*[A-Z])/; - my $digit = $pass =~ /(?=.*\d)/; - my $repeated = check3Repeated($pass); - - #check if the length of the password is 6 or greater - if(!$least6){ - my $remain = 6-$length; - if($remain == 1 and (!$lower or !$upper or !$digit)){ - $changes++; - $changes += $remain; - return $changes; - } - $changes += $remain; - return $changes if $remain > 1; - } - if(!$lower){ - $changes += 1; - } - if(!$upper){ - $changes += 1; - } - if(!$digit){ - $changes += 1; - } - if($repeated){ - $changes += 1; - } - return $changes; -} - -sub check3Repeated { - my $s = shift; - my @char = split("",$s); - my %map; - foreach(@char){ - if(!exists($map{$_})){ - $map{$_} = 1; - }else{ - $map{$_} += 1; - } - } - my @values = sort {$a <=> $b} values %map; - if($values[-1] >= 3){ - return 1; - } - return 0; -} \ No newline at end of file diff --git a/challenge-287/santiago-leyva/perl/ch-02.pl b/challenge-287/santiago-leyva/perl/ch-02.pl deleted file mode 100644 index 8f3dc1cba6..0000000000 --- a/challenge-287/santiago-leyva/perl/ch-02.pl +++ /dev/null @@ -1,23 +0,0 @@ -use Data::Dumper; -use strict; - -my @input = ("1","a",".","1.2e4.2","-1.","+1E-8","44","1203ñ{}"); -#my @input = ("-1.","+1E-8","44","1203ñ{}"); - -foreach(@input){ - my $result = checkNumber($_); - print "for $_ -> $result \n"; -} - -sub checkNumber { - my $num = shift; - - my @N = split(/\./,$num); - my $length = scalar @N; - if($length == 1){ - return "True" if ($num =~ /\-*\+*\d+\.*$/g or $num =~ /^\d+e|E\d+$/); - }elsif($length == 2){ - return "True" if ( ($num =~ $N[0] =~ /^\d+$/ and $N[1] =~ /^\d+$/ ) or ($N[0] =~ /^\d+$/ and $N[1] =~ /^\d+e\d+$|E\d+$/) ); - } - return "false"; -} \ No newline at end of file diff --git a/challenge-287/santiago-leyva/perl/ch-1.pl b/challenge-287/santiago-leyva/perl/ch-1.pl new file mode 100644 index 0000000000..f545e66ffb --- /dev/null +++ b/challenge-287/santiago-leyva/perl/ch-1.pl @@ -0,0 +1,65 @@ + +use strict; +use warnings; + +my @passwords = ('a',"aB2","PaaSW0rd","Paaasw0rd","aaaaa","axmlsa"); + +foreach(@passwords){ + print "--> checking password $_ | "; + my $result = checkPassword($_); + print "changes that need to be made: $result\n"; +} + +sub checkPassword { + my $pass = shift; + my $length = length($pass); + my $changes = 0; + my $least6 = $pass =~ /.{6,}/; + my $lower = $pass =~ /(?=.*[a-z])/; + my $upper = $pass =~ /(?=.*[A-Z])/; + my $digit = $pass =~ /(?=.*\d)/; + my $repeated = check3Repeated($pass); + + #check if the length of the password is 6 or greater + if(!$least6){ + my $remain = 6-$length; + if($remain == 1 and (!$lower or !$upper or !$digit)){ + $changes++; + $changes += $remain; + return $changes; + } + $changes += $remain; + return $changes if $remain > 1; + } + if(!$lower){ + $changes += 1; + } + if(!$upper){ + $changes += 1; + } + if(!$digit){ + $changes += 1; + } + if($repeated){ + $changes += 1; + } + return $changes; +} + +sub check3Repeated { + my $s = shift; + my @char = split("",$s); + my %map; + foreach(@char){ + if(!exists($map{$_})){ + $map{$_} = 1; + }else{ + $map{$_} += 1; + } + } + my @values = sort {$a <=> $b} values %map; + if($values[-1] >= 3){ + return 1; + } + return 0; +} \ No newline at end of file diff --git a/challenge-287/santiago-leyva/perl/ch-2.pl b/challenge-287/santiago-leyva/perl/ch-2.pl new file mode 100644 index 0000000000..8f3dc1cba6 --- /dev/null +++ b/challenge-287/santiago-leyva/perl/ch-2.pl @@ -0,0 +1,23 @@ +use Data::Dumper; +use strict; + +my @input = ("1","a",".","1.2e4.2","-1.","+1E-8","44","1203ñ{}"); +#my @input = ("-1.","+1E-8","44","1203ñ{}"); + +foreach(@input){ + my $result = checkNumber($_); + print "for $_ -> $result \n"; +} + +sub checkNumber { + my $num = shift; + + my @N = split(/\./,$num); + my $length = scalar @N; + if($length == 1){ + return "True" if ($num =~ /\-*\+*\d+\.*$/g or $num =~ /^\d+e|E\d+$/); + }elsif($length == 2){ + return "True" if ( ($num =~ $N[0] =~ /^\d+$/ and $N[1] =~ /^\d+$/ ) or ($N[0] =~ /^\d+$/ and $N[1] =~ /^\d+e\d+$|E\d+$/) ); + } + return "false"; +} \ No newline at end of file diff --git a/challenge-287/ulrich-rieke/cpp/ch-1.cpp b/challenge-287/ulrich-rieke/cpp/ch-1.cpp new file mode 100755 index 0000000000..6048d7476f --- /dev/null +++ b/challenge-287/ulrich-rieke/cpp/ch-1.cpp @@ -0,0 +1,71 @@ +#include +#include +#include +#include +#include + +int main( ) { + std::cout << "Enter a password!\n" ; + std::string word ; + std::cin >> word ; + int totalsteps = 0 ; + const std::regex rgx1("[a-z]") ; + const std::regex rgx2("[A-Z]") ; + const std::regex rgx3("\\d") ; + int len = word.length( ) ; + if ( len < 6 ) { + totalsteps += 6 - len ; + } + //beware : it took me quite some time to find out that + //std::regex_match does not return the right result!! + //if you want to check whether a given regular expression + //such as \d matches I had to use std::regex_search!!! + if ( ! std::regex_search( word , rgx1 )) { + if ( len >= 6 ) { + totalsteps++ ; + } + } + if ( ! std::regex_search( word , rgx2 )) { + if ( len >= 6 ) { + totalsteps++ ; + } + } + if ( ! std::regex_search( word , rgx3 )) { + if ( len >= 6 ) { + totalsteps++ ; + } + } + //std::regex appears not to allow backreferences...? + //so, to prevent too many identical neighbouring letters + //I group the letters , divide their lengths by 3 and sum the + //quotients up ( inspired by Haskell where this operation is so easy + //to perform!!! + std::vector neighbouring_letters ; + std::string currentWord ; + //imitate Haskell's group function! + for ( auto it = word.begin( ) ; it != word.end( ) ; ++it ) { + if ( currentWord.empty( ) ) + currentWord.push_back( *it ) ; + else { + char last_char = currentWord.back( ) ; + if ( last_char == *it ) { + currentWord.push_back( *it ) ; + } + else { + neighbouring_letters.push_back( currentWord ) ; + currentWord.clear( ) ; + currentWord.push_back( *it ) ; + } + } + } + neighbouring_letters.push_back( currentWord ) ; + std::vector grouplengths ; + for ( auto v : neighbouring_letters ) { + grouplengths.push_back( v.length( ) / 3 ) ; + } + int replacements = std::accumulate( grouplengths.begin( ) , + grouplengths.end( ) , 0 ) ; + totalsteps += replacements ; + std::cout << totalsteps << '\n' ; + return 0 ; +} diff --git a/challenge-287/ulrich-rieke/cpp/ch-2.cpp b/challenge-287/ulrich-rieke/cpp/ch-2.cpp new file mode 100755 index 0000000000..b5dc14d07a --- /dev/null +++ b/challenge-287/ulrich-rieke/cpp/ch-2.cpp @@ -0,0 +1,22 @@ +#include +#include +#include + +int main( ) { + std::cout << "Enter a string!\n" ; + std::string word ; + std::cin >> word ; + std::string inte {R"(^[-+]?\d+([eE]?[-+]?\d+)*$)"} ; + std::string decifirst {R"(^[-+]?\d+\.([eE]?[-+]?\d+)*$|^[-+]?\d+\.\d+([eE]?[+-]?\d+)*$)"} ; + std::string decisecond {R"(^[+-]?\.\d+([eE]?[+-]?\d+$)*$)" } ; + std::regex integer( inte ) ; + std::regex decimalfirst ( decifirst ) ; + std::regex decimalsecond ( decisecond ) ; + if ( std::regex_match( word , integer ) || std::regex_match( word , decimalfirst ) || + std::regex_match( word , decimalsecond ) ) + std::cout << "true" ; + else + std::cout << "false" ; + std::cout << '\n' ; + return 0 ; +} diff --git a/challenge-287/ulrich-rieke/haskell/ch-1.hs b/challenge-287/ulrich-rieke/haskell/ch-1.hs new file mode 100755 index 0000000000..481f603eee --- /dev/null +++ b/challenge-287/ulrich-rieke/haskell/ch-1.hs @@ -0,0 +1,32 @@ +module Challenge287 + where +import Data.Char ( isUpper , isLower , isDigit ) +import Data.List ( group ) + +solution :: String -> Int +solution word = subterm1 + subterm2 + subterm3 + subterm4 + subterm5 + where + l :: Int + l = length word + subterm1 :: Int + subterm1 = if l < 6 then 6 - l else 0 + subterm2 :: Int + subterm2 = if (length $ filter isLower word) < 1 + then if l >= 6 then 1 else 0 + else 0 + subterm3 :: Int + subterm3 = if (length $ filter isUpper word) < 1 + then if l >= 6 then 1 else 0 + else 0 + subterm4 :: Int + subterm4 = if (length $ filter isDigit word) < 1 + then if l >= 6 then 1 else 0 + else 0 + subterm5 :: Int -- count the number of identical neighbouring letters + subterm5 = sum $ map (\li -> div ( length li ) 3 ) $ group word + +main :: IO ( ) +main = do + putStrLn "Enter a password!" + password <- getLine + print $ solution password diff --git a/challenge-287/ulrich-rieke/haskell/ch-2.hs b/challenge-287/ulrich-rieke/haskell/ch-2.hs new file mode 100755 index 0000000000..e4eb5ecc89 --- /dev/null +++ b/challenge-287/ulrich-rieke/haskell/ch-2.hs @@ -0,0 +1,64 @@ +module Challenge287_2 + where +import Data.Char +import Text.ParserCombinators.ReadP +import Control.Applicative ((<|>)) +import Data.List ( init ) + +sign :: ReadP Char +sign = do + char '-' <|> char '+' + +numbers :: ReadP String +numbers = do + many1 $ satisfy isDigit + +integer :: ReadP String +integer = do + si <- option ' ' sign + nums <- numbers + if si /= ' ' then pure ([si] ++ nums) else pure nums + +expo :: ReadP String +expo = do + c <- char 'e' <|> char 'E' + number <- integer + pure ([c] ++ number) + +decimalfirst :: ReadP String +decimalfirst = do + si <- option ' ' sign + num <- numbers + char '.' + if si /= ' ' then pure ([si] ++ num ++ "." ) else pure (num ++ ".") + +decimalsecond :: ReadP String +decimalsecond = do + si <- option ' ' sign + num <- numbers + char '.' + numgroup <- numbers + if si /= ' ' then pure ([si] ++ num ++ "." ++ numgroup ) else pure( num ++ + "." ++ numgroup ) + +decimalthird :: ReadP String +decimalthird = do + si <- option ' ' sign + char '.' + num <- numbers + if si /= ' ' then pure ([si] ++ "." ++ num ) else pure ("." ++ num) + +validNum :: ReadP String +validNum = do + numgroup <- ( integer >> option " " expo ) <|> ( decimalsecond >> + option " " expo ) <|> (decimalthird >> option " " expo ) <|> + (decimalfirst >> option " " expo ) + if last numgroup == ' ' then pure ( init numgroup ) else pure numgroup + +main :: IO ( ) +main = do + putStrLn "Enter a string!" + string <- getLine + let p = readP_to_S validNum string + if null p then print "false" else if ( null $ snd $ last p ) then print "true" + else print "false" diff --git a/challenge-287/ulrich-rieke/perl/ch-1.pl b/challenge-287/ulrich-rieke/perl/ch-1.pl new file mode 100755 index 0000000000..3e395be14c --- /dev/null +++ b/challenge-287/ulrich-rieke/perl/ch-1.pl @@ -0,0 +1,31 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; + +say "Enter a password!" ; +my $word = ; +chomp $word ; +my $totalsteps = 0 ; +if ( length $word < 6 ) { + $totalsteps += 6 - length $word ;#complement the word! +} +if ( $word !~ /[a-z]/ ) { + if ( length $word >= 6 ) { #replace one character + $totalsteps += 1 ; + } +} +if ( $word !~ /[A-Z]/ ) { + if ( length $word >= 6 ) {#replace one character + $totalsteps += 1 ; + } +} +if ( $word !~ /\d/ ) { + if ( length $word >= 6 ) {#replace one character + $totalsteps += 1 ; + } +} +if ( $word =~ /(.)\1\1/ ) {#replace one character + $totalsteps += 1 ; +} +say $totalsteps ; diff --git a/challenge-287/ulrich-rieke/perl/ch-2.pl b/challenge-287/ulrich-rieke/perl/ch-2.pl new file mode 100755 index 0000000000..b860194272 --- /dev/null +++ b/challenge-287/ulrich-rieke/perl/ch-2.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; + +say "Enter a string!" ; +my $string = ; +chomp $string ; +my $sign = qr/[+\-]??/ ; +my $integer = qr/$sign*\d+/ ; +my $exponent = qr/[eE]$integer/ ; +my $decimal = qr/^$sign*\d+\.$|^$sign*\d+\.\d$|^$sign*\.\d+$/ ; +my $valid = qr/^$integer$exponent*$|^$decimal$exponent*$/ ; +if ( $string =~ /$valid/ ) { + say "true" ; +} +else { + say "false" ; +} diff --git a/challenge-287/ulrich-rieke/raku/ch-1.raku b/challenge-287/ulrich-rieke/raku/ch-1.raku new file mode 100755 index 0000000000..f7c6d65762 --- /dev/null +++ b/challenge-287/ulrich-rieke/raku/ch-1.raku @@ -0,0 +1,28 @@ +use v6 ; + +say "Enter a password!" ; +my $word = $*IN.get ; +my $totalsteps = 0 ; +my $len = $word.chars ; +if ( $len < 6 ) { + $totalsteps += 6 - $len ; +} +if ( $word !~~ /<[a..z]>/ ) { + if ( $len >= 6 ) { + $totalsteps++ ; + } +} +if ( $word !~~ /<[A..Z]>/ ) { + if ( $len >= 6 ) { + $totalsteps++ ; + } +} +if ( $word !~~ /\d/ ) { + if ( $len >= 6 ) { + $totalsteps++ ; + } +} +if ( $word ~~ /(.) $0 $0/ ) { + $totalsteps++ ; +} +$totalsteps.say ; diff --git a/challenge-287/ulrich-rieke/raku/ch-2.raku b/challenge-287/ulrich-rieke/raku/ch-2.raku new file mode 100755 index 0000000000..a63d1b19fa --- /dev/null +++ b/challenge-287/ulrich-rieke/raku/ch-2.raku @@ -0,0 +1,16 @@ +use v6 ; + +say "Enter a string!" ; +my $string = $*IN.get ; +my regex sign { <[- +]> } ; +my regex expo { <[e E]> ? \d+ } ; +my regex integer { ? \d+ ?} ; +my regex decimal { ? \d+ \. ? | ? \d+ \. \d+ ? | + ? \. \d+ ? } ; +my regex valid {^ $ | ^ $} ; +if ( $string ~~ / / ) { + say "true" ; +} +else { + say "false" ; +} diff --git a/challenge-287/ulrich-rieke/rust/ch-1.rs b/challenge-287/ulrich-rieke/rust/ch-1.rs new file mode 100755 index 0000000000..e8a5c93945 --- /dev/null +++ b/challenge-287/ulrich-rieke/rust/ch-1.rs @@ -0,0 +1,37 @@ +use std::io ; +use fancy_regex::Regex ; //this crate only supports Perl's backreferences! + +fn main() { + println!("Enter a word!"); + let mut inline : String = String::new( ) ; + io::stdin( ).read_line( &mut inline ).unwrap( ) ; + let entered_line : &str = inline.as_str( ).trim( ) ; + let re1 = Regex::new(r"[a-z]").unwrap( ) ; + let re2 = Regex::new(r"[A-Z]").unwrap( ) ; + let re3 = Regex::new(r"\d").unwrap( ) ; + let re4 = Regex::new(r"(.)\1\1").unwrap( ) ; + let mut totalsteps : u16 = 0 ; + let len : u16 = entered_line.len( ) as u16 ; + if len < 6 { + totalsteps += 6 - len ; + } + if ! re1.is_match( entered_line ).unwrap( ) { + if len >= 6 { + totalsteps += 1 ; + } + } + if ! re2.is_match( entered_line ).unwrap( ) { + if len >= 6 { + totalsteps += 1 ; + } + } + if ! re3.is_match( entered_line ).unwrap( ) { + if len >= 6 { + totalsteps += 1 ; + } + } + if re4.is_match( entered_line ).unwrap( ) { + totalsteps += 1 ; + } + println!("{}" , totalsteps ) ; +} diff --git a/challenge-287/ulrich-rieke/rust/ch-2.rs b/challenge-287/ulrich-rieke/rust/ch-2.rs new file mode 100755 index 0000000000..44e5ca7e50 --- /dev/null +++ b/challenge-287/ulrich-rieke/rust/ch-2.rs @@ -0,0 +1,18 @@ +use std::io ; +use regex::Regex ; + +fn main() { + println!("Enter a string!"); + let mut inline : String = String::new( ) ; + io::stdin( ).read_line( &mut inline ).unwrap( ) ; + let entered_line : &str = inline.as_str( ).trim( ) ; + let integer = Regex::new( r"^[+-]?\d+([eE]?[+-]?\d+)*$" ).unwrap( ) ; + let decimal = Regex::new( r"^[-+]?\d+\.([eE]?[+-]?\d+)*$|^[-+]*\d+\. + \d+([eE]?[+-]?\d+)*$|^[-+]?\.\d+([eE]?[+-]?\d+)*$").unwrap( ) ; + if integer.is_match( entered_line ) || decimal.is_match( entered_line ) { + println!("true") ; + } + else { + println!("false") ; + } +} diff --git a/stats/pwc-challenge-286.json b/stats/pwc-challenge-286.json index 86e9fa22bc..82f3a970e3 100644 --- a/stats/pwc-challenge-286.json +++ b/stats/pwc-challenge-286.json @@ -2,16 +2,17 @@ "drilldown" : { "series" : [ { + "name" : "Alexander Karelas", + "id" : "Alexander Karelas", "data" : [ [ "Perl", 1 ] - ], - "id" : "Alexander Karelas", - "name" : "Alexander Karelas" + ] }, { + "id" : "Ali Moradi", "data" : [ [ "Perl", @@ -26,8 +27,7 @@ 1 ] ], - "name" : "Ali Moradi", - "id" : "Ali Moradi" + "name" : "Ali Moradi" }, { "data" : [ @@ -40,8 +40,6 @@ "name" : "Andrew Schneider" }, { - "name" : "Arne Sommer", - "id" : "Arne Sommer", "data" : [ [ "Raku", @@ -51,19 +49,22 @@ "Blog", 1 ] - ] + ], + "id" : "Arne Sommer", + "name" : "Arne Sommer" }, { + "id" : "Asher Harvey-Smith", "data" : [ [ "Raku", 1 ] ], - "id" : "Asher Harvey-Smith", "name" : "Asher Harvey-Smith" }, { + "name" : "Athanasius", "data" : [ [ "Perl", @@ -74,18 +75,17 @@ 2 ] ], - "id" : "Athanasius", - "name" : "Athanasius" + "id" : "Athanasius" }, { + "name" : "BarrOff", + "id" : "BarrOff", "data" : [ [ "Raku", 1 ] - ], - "name" : "BarrOff", - "id" : "BarrOff" + ] }, { "data" : [ @@ -98,17 +98,16 @@ "name" : "Bob Lied" }, { + "name" : "Cheok-Yin Fung", "data" : [ [ "Perl", 1 ] ], - "name" : "Cheok-Yin Fung", "id" : "Cheok-Yin Fung" }, { - "id" : "David Ferrone", "name" : "David Ferrone", "data" : [ [ @@ -119,21 +118,22 @@ "Blog", 1 ] - ] + ], + "id" : "David Ferrone" }, { - "id" : "E. Choroba", "name" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "E. Choroba" }, { - "id" : "Feng Chang", "name" : "Feng Chang", + "id" : "Feng Chang", "data" : [ [ "Raku", @@ -142,6 +142,7 @@ ] }, { + "name" : "Jaldhar H. Vyas", "data" : [ [ "Perl", @@ -156,8 +157,7 @@ 1 ] ], - "id" : "Jaldhar H. Vyas", - "name" : "Jaldhar H. Vyas" + "id" : "Jaldhar H. Vyas" }, { "name" : "Jan Krnavek", @@ -185,13 +185,13 @@ }, { "id" : "Kjetil Skotheim", - "name" : "Kjetil Skotheim", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Kjetil Skotheim" }, { "data" : [ @@ -208,38 +208,38 @@ 2 ] ], - "name" : "Laurent Rosenfeld", - "id" : "Laurent Rosenfeld" + "id" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld" }, { + "name" : "Lubos Kolouch", "data" : [ [ "Perl", 2 ] ], - "id" : "Lubos Kolouch", - "name" : "Lubos Kolouch" + "id" : "Lubos Kolouch" }, { + "name" : "Mark Anderson", + "id" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ], - "name" : "Mark Anderson", - "id" : "Mark Anderson" + ] }, { "name" : "Matthew Neleigh", - "id" : "Matthew Neleigh", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Matthew Neleigh" }, { "name" : "Matthias Muth", @@ -256,26 +256,27 @@ ] }, { + "id" : "Nelo Tovar", "data" : [ [ "Perl", 2 ] ], - "name" : "Nelo Tovar", - "id" : "Nelo Tovar" + "name" : "Nelo Tovar" }, { + "name" : "Niels van Dijke", "data" : [ [ "Perl", 2 ] ], - "id" : "Niels van Dijke", - "name" : "Niels van Dijke" + "id" : "Niels van Dijke" }, { + "id" : "Packy Anderson", "data" : [ [ "Perl", @@ -290,21 +291,19 @@ 1 ] ], - "name" : "Packy Anderson", - "id" : "Packy Anderson" + "name" : "Packy Anderson" }, { - "name" : "Paulo Custodio", "id" : "Paulo Custodio", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Paulo Custodio" }, { - "id" : "Peter Campbell Smith", "name" : "Peter Campbell Smith", "data" : [ [ @@ -315,11 +314,12 @@ "Blog", 1 ] - ] + ], + "id" : "Peter Campbell Smith" }, { - "id" : "Peter Meszaros", "name" : "Peter Meszaros", + "id" : "Peter Meszaros", "data" : [ [ "Perl", @@ -328,6 +328,8 @@ ] }, { + "name" : "Peter Pentchev", + "id" : "Peter Pentchev", "data" : [ [ "Perl", @@ -337,11 +339,10 @@ "Blog", 1 ] - ], - "name" : "Peter Pentchev", - "id" : "Peter Pentchev" + ] }, { + "name" : "Robbie Hatley", "data" : [ [ "Perl", @@ -352,20 +353,21 @@ 1 ] ], - "id" : "Robbie Hatley", - "name" : "Robbie Hatley" + "id" : "Robbie Hatley" }, { + "id" : "Robert Ransbottom", "data" : [ [ "Blog", 2 ] ], - "name" : "Robert Ransbottom", - "id" : "Robert Ransbottom" + "name" : "Robert Ransbottom" }, { + "name" : "Roger Bell_West", + "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -379,11 +381,20 @@ "Blog", 1 ] - ], - "id" : "Roger Bell_West", - "name" : "Roger Bell_West" + ] }, { + "name" : "Santiago Leyva", + "id" : "Santiago Leyva", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "name" : "Thomas Kohler", "data" : [ [ "Perl", @@ -394,10 +405,10 @@ 2 ] ], - "id" : "Thomas Kohler", - "name" : "Thomas Kohler" + "id" : "Thomas Kohler" }, { + "name" : "Tim King", "data" : [ [ "Perl", @@ -408,10 +419,10 @@ 1 ] ], - "name" : "Tim King", "id" : "Tim King" }, { + "id" : "Torgny Lyon", "data" : [ [ "Perl", @@ -422,11 +433,9 @@ 1 ] ], - "id" : "Torgny Lyon", "name" : "Torgny Lyon" }, { - "name" : "Ulrich Rieke", "id" : "Ulrich Rieke", "data" : [ [ @@ -437,9 +446,11 @@ "Raku", 2 ] - ] + ], + "name" : "Ulrich Rieke" }, { + "name" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -450,7 +461,6 @@ 1 ] ], - "name" : "W. Luis Mochan", "id" : "W. Luis Mochan" }, { @@ -465,9 +475,34 @@ } ] }, + "legend" : { + "enabled" : 0 + }, + "tooltip" : { + "headerFormat" : "{series.name}
", + "pointFormat" : "{point.name}: {point.y:f}
", + "followPointer" : 1 + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + }, + "borderWidth" : 0 + } + }, + "subtitle" : { + "text" : "[Champions: 38] Last updated at 2024-09-18 19:18:10 GMT" + }, "series" : [ { - "colorByPoint" : 1, + "name" : "The Weekly Challenge - 286", "data" : [ { "name" : "Alexander Karelas", @@ -475,64 +510,64 @@ "drilldown" : "Alexander Karelas" }, { - "y" : 5, "drilldown" : "Ali Moradi", - "name" : "Ali Moradi" + "name" : "Ali Moradi", + "y" : 5 }, { - "name" : "Andrew Schneider", "drilldown" : "Andrew Schneider", + "name" : "Andrew Schneider", "y" : 2 }, { - "drilldown" : "Arne Sommer", "y" : 3, - "name" : "Arne Sommer" + "name" : "Arne Sommer", + "drilldown" : "Arne Sommer" }, { - "name" : "Asher Harvey-Smith", "y" : 1, + "name" : "Asher Harvey-Smith", "drilldown" : "Asher Harvey-Smith" }, { + "y" : 4, "name" : "Athanasius", - "drilldown" : "Athanasius", - "y" : 4 + "drilldown" : "Athanasius" }, { "name" : "BarrOff", - "drilldown" : "BarrOff", - "y" : 1 + "y" : 1, + "drilldown" : "BarrOff" }, { "y" : 2, - "drilldown" : "Bob Lied", - "name" : "Bob Lied" + "name" : "Bob Lied", + "drilldown" : "Bob Lied" }, { + "y" : 1, "name" : "Cheok-Yin Fung", - "drilldown" : "Cheok-Yin Fung", - "y" : 1 + "drilldown" : "Cheok-Yin Fung" }, { - "y" : 3, "drilldown" : "David Ferrone", - "name" : "David Ferrone" + "name" : "David Ferrone", + "y" : 3 }, { + "drilldown" : "E. Choroba", "name" : "E. Choroba", - "y" : 2, - "drilldown" : "E. Choroba" + "y" : 2 }, { - "name" : "Feng Chang", "drilldown" : "Feng Chang", + "name" : "Feng Chang", "y" : 2 }, { "y" : 5, - "drilldown" : "Jaldhar H. Vyas", - "name" : "Jaldhar H. Vyas" + "name" : "Jaldhar H. Vyas", + "drilldown" : "Jaldhar H. Vyas" }, { "drilldown" : "Jan Krnavek", @@ -540,13 +575,13 @@ "name" : "Jan Krnavek" }, { - "name" : "Jorg Sommrey", + "drilldown" : "Jorg Sommrey", "y" : 3, - "drilldown" : "Jorg Sommrey" + "name" : "Jorg Sommrey" }, { - "y" : 2, "drilldown" : "Kjetil Skotheim", + "y" : 2, "name" : "Kjetil Skotheim" }, { @@ -560,136 +595,116 @@ "name" : "Lubos Kolouch" }, { - "name" : "Mark Anderson", "drilldown" : "Mark Anderson", + "name" : "Mark Anderson", "y" : 2 }, { - "drilldown" : "Matthew Neleigh", + "name" : "Matthew Neleigh", "y" : 2, - "name" : "Matthew Neleigh" + "drilldown" : "Matthew Neleigh" }, { "drilldown" : "Matthias Muth", - "y" : 3, - "name" : "Matthias Muth" + "name" : "Matthias Muth", + "y" : 3 }, { + "name" : "Nelo Tovar", "y" : 2, - "drilldown" : "Nelo Tovar", - "name" : "Nelo Tovar" + "drilldown" : "Nelo Tovar" }, { - "y" : 2, "drilldown" : "Niels van Dijke", + "y" : 2, "name" : "Niels van Dijke" }, { - "name" : "Packy Anderson", "drilldown" : "Packy Anderson", + "name" : "Packy Anderson", "y" : 5 }, { - "y" : 2, "drilldown" : "Paulo Custodio", + "y" : 2, "name" : "Paulo Custodio" }, { - "name" : "Peter Campbell Smith", + "drilldown" : "Peter Campbell Smith", "y" : 3, - "drilldown" : "Peter Campbell Smith" + "name" : "Peter Campbell Smith" }, { "name" : "Peter Meszaros", - "drilldown" : "Peter Meszaros", - "y" : 2 + "y" : 2, + "drilldown" : "Peter Meszaros" }, { + "name" : "Peter Pentchev", "y" : 3, - "drilldown" : "Peter Pentchev", - "name" : "Peter Pentchev" + "drilldown" : "Peter Pentchev" }, { - "y" : 3, "drilldown" : "Robbie Hatley", - "name" : "Robbie Hatley" + "name" : "Robbie Hatley", + "y" : 3 }, { + "name" : "Robert Ransbottom", "y" : 2, - "drilldown" : "Robert Ransbottom", - "name" : "Robert Ransbottom" + "drilldown" : "Robert Ransbottom" }, { "y" : 3, - "drilldown" : "Roger Bell_West", - "name" : "Roger Bell_West" + "name" : "Roger Bell_West", + "drilldown" : "Roger Bell_West" + }, + { + "drilldown" : "Santiago Leyva", + "name" : "Santiago Leyva", + "y" : 2 }, { - "name" : "Thomas Kohler", "drilldown" : "Thomas Kohler", - "y" : 4 + "y" : 4, + "name" : "Thomas Kohler" }, { - "name" : "Tim King", "y" : 3, + "name" : "Tim King", "drilldown" : "Tim King" }, { - "y" : 3, "drilldown" : "Torgny Lyon", - "name" : "Torgny Lyon" + "name" : "Torgny Lyon", + "y" : 3 }, { "y" : 4, - "drilldown" : "Ulrich Rieke", - "name" : "Ulrich Rieke" + "name" : "Ulrich Rieke", + "drilldown" : "Ulrich Rieke" }, { - "name" : "W. Luis Mochan", "drilldown" : "W. Luis Mochan", - "y" : 3 + "y" : 3, + "name" : "W. Luis Mochan" }, { - "y" : 2, "drilldown" : "Wanderdoc", + "y" : 2, "name" : "Wanderdoc" } ], - "name" : "The Weekly Challenge - 286" + "colorByPoint" : 1 } ], - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } - }, - "tooltip" : { - "headerFormat" : "{series.name}
", - "followPointer" : 1, - "pointFormat" : "{point.name}: {point.y:f}
" - }, "chart" : { "type" : "column" }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, - "subtitle" : { - "text" : "[Champions: 37] Last updated at 2024-09-16 12:30:14 GMT" + "title" : { + "text" : "The Weekly Challenge - 286" }, "xAxis" : { "type" : "category" - }, - "legend" : { - "enabled" : 0 - }, - "title" : { - "text" : "The Weekly Challenge - 286" } } diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 8757bad830..3ea0181406 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,104 +1,68 @@ { - "subtitle" : { - "text" : "[Champions: 7] Last updated at 2024-09-17 11:54:43 GMT" - }, - "title" : { - "text" : "The Weekly Challenge - 287" - }, - "series" : [ - { - "data" : [ - { - "name" : "David Ferrone", - "y" : 2, - "drilldown" : "David Ferrone" - }, - { - "name" : "E. Choroba", - "y" : 2, - "drilldown" : "E. Choroba" - }, - { - "name" : "Kjetil Skotheim", - "y" : 2, - "drilldown" : "Kjetil Skotheim" - }, - { - "y" : 2, - "drilldown" : "Lubos Kolouch", - "name" : "Lubos Kolouch" - }, - { - "y" : 2, - "drilldown" : "Paulo Custodio", - "name" : "Paulo Custodio" - }, - { - "name" : "Roger Bell_West", - "drilldown" : "Roger Bell_West", - "y" : 4 - }, - { - "name" : "W. Luis Mochan", - "drilldown" : "W. Luis Mochan", - "y" : 3 - } - ], - "colorByPoint" : 1, - "name" : "The Weekly Challenge - 287" - } - ], - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } + "yAxis" : { + "title" : { + "text" : "Total Solutions" } }, - "xAxis" : { - "type" : "category" - }, - "legend" : { - "enabled" : 0 - }, - "tooltip" : { - "followPointer" : 1, - "pointFormat" : "{point.name}: {point.y:f}
", - "headerFormat" : "{series.name}
" - }, "drilldown" : { "series" : [ { - "id" : "David Ferrone", "name" : "David Ferrone", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "David Ferrone" }, { - "id" : "E. Choroba", - "name" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "E. Choroba", + "id" : "E. Choroba" }, { - "id" : "Kjetil Skotheim", + "name" : "Feng Chang", + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Feng Chang" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], "name" : "Kjetil Skotheim", + "id" : "Kjetil Skotheim" + }, + { + "id" : "Laurent Rosenfeld", "data" : [ [ "Perl", 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 2 ] - ] + ], + "name" : "Laurent Rosenfeld" }, { "data" : [ @@ -120,9 +84,60 @@ "name" : "Paulo Custodio", "id" : "Paulo Custodio" }, + { + "id" : "Peter Campbell Smith", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Peter Campbell Smith" + }, + { + "name" : "Peter Pentchev", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Peter Pentchev" + }, + { + "id" : "Robbie Hatley", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Robbie Hatley" + }, + { + "name" : "Robert Ransbottom", + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Robert Ransbottom" + }, { "id" : "Roger Bell_West", - "name" : "Roger Bell_West", "data" : [ [ "Perl", @@ -132,9 +147,35 @@ "Raku", 2 ] + ], + "name" : "Roger Bell_West" + }, + { + "id" : "Santiago Leyva", + "name" : "Santiago Leyva", + "data" : [ + [ + "Perl", + 2 + ] ] }, { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "name" : "Ulrich Rieke", + "id" : "Ulrich Rieke" + }, + { + "id" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -145,17 +186,120 @@ 1 ] ], - "name" : "W. Luis Mochan", - "id" : "W. Luis Mochan" + "name" : "W. Luis Mochan" } ] }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" + "title" : { + "text" : "The Weekly Challenge - 287" + }, + "legend" : { + "enabled" : 0 + }, + "tooltip" : { + "pointFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "{series.name}
", + "followPointer" : 1 + }, + "series" : [ + { + "colorByPoint" : 1, + "data" : [ + { + "y" : 2, + "name" : "David Ferrone", + "drilldown" : "David Ferrone" + }, + { + "drilldown" : "E. Choroba", + "y" : 2, + "name" : "E. Choroba" + }, + { + "drilldown" : "Feng Chang", + "y" : 2, + "name" : "Feng Chang" + }, + { + "drilldown" : "Kjetil Skotheim", + "name" : "Kjetil Skotheim", + "y" : 2 + }, + { + "drilldown" : "Laurent Rosenfeld", + "y" : 6, + "name" : "Laurent Rosenfeld" + }, + { + "y" : 2, + "name" : "Lubos Kolouch", + "drilldown" : "Lubos Kolouch" + }, + { + "drilldown" : "Paulo Custodio", + "name" : "Paulo Custodio", + "y" : 2 + }, + { + "drilldown" : "Peter Campbell Smith", + "y" : 3, + "name" : "Peter Campbell Smith" + }, + { + "drilldown" : "Peter Pentchev", + "y" : 3, + "name" : "Peter Pentchev" + }, + { + "drilldown" : "Robbie Hatley", + "name" : "Robbie Hatley", + "y" : 3 + }, + { + "drilldown" : "Robert Ransbottom", + "y" : 2, + "name" : "Robert Ransbottom" + }, + { + "drilldown" : "Roger Bell_West", + "y" : 4, + "name" : "Roger Bell_West" + }, + { + "name" : "Santiago Leyva", + "y" : 2, + "drilldown" : "Santiago Leyva" + }, + { + "name" : "Ulrich Rieke", + "y" : 4, + "drilldown" : "Ulrich Rieke" + }, + { + "name" : "W. Luis Mochan", + "y" : 3, + "drilldown" : "W. Luis Mochan" + } + ], + "name" : "The Weekly Challenge - 287" } + ], + "xAxis" : { + "type" : "category" }, "chart" : { "type" : "column" + }, + "subtitle" : { + "text" : "[Champions: 15] Last updated at 2024-09-18 19:18:18 GMT" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } } } diff --git a/stats/pwc-language-breakdown-2019.json b/stats/pwc-language-breakdown-2019.json index 0f5ff12b7a..026715b0f8 100644 --- a/stats/pwc-language-breakdown-2019.json +++ b/stats/pwc-language-breakdown-2019.json @@ -1,248 +1,23 @@ { - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2024-09-17 11:54:43 GMT" + "tooltip" : { + "headerFormat" : "", + "followPointer" : "true", + "pointFormat" : "Challenge {point.name}: {point.y:f}
" }, - "series" : [ - { - "name" : "The Weekly Challenge Languages", - "data" : [ - { - "name" : "041", - "drilldown" : "041", - "y" : 80 - }, - { - "y" : 77, - "drilldown" : "040", - "name" : "040" - }, - { - "drilldown" : "039", - "y" : 68, - "name" : "039" - }, - { - "y" : 74, - "drilldown" : "038", - "name" : "038" - }, - { - "name" : "037", - "y" : 70, - "drilldown" : "037" - }, - { - "y" : 70, - "drilldown" : "036", - "name" : "036" - }, - { - "name" : "035", - "drilldown" : "035", - "y" : 68 - }, - { - "name" : "034", - "y" : 70, - "drilldown" : "034" - }, - { - "name" : "033", - "drilldown" : "033", - "y" : 113 - }, - { - "name" : "032", - "drilldown" : "032", - "y" : 97 - }, - { - "name" : "031", - "y" : 93, - "drilldown" : "031" - }, - { - "name" : "030", - "y" : 120, - "drilldown" : "030" - }, - { - "name" : "029", - "drilldown" : "029", - "y" : 83 - }, - { - "name" : "028", - "drilldown" : "028", - "y" : 82 - }, - { - "name" : "027", - "y" : 64, - "drilldown" : "027" - }, - { - "name" : "026", - "drilldown" : "026", - "y" : 75 - }, - { - "name" : "025", - "y" : 62, - "drilldown" : "025" - }, - { - "y" : 77, - "drilldown" : "024", - "name" : "024" - }, - { - "y" : 88, - "drilldown" : "023", - "name" : "023" - }, - { - "name" : "022", - "y" : 72, - "drilldown" : "022" - }, - { - "drilldown" : "021", - "y" : 72, - "name" : "021" - }, - { - "drilldown" : "020", - "y" : 100, - "name" : "020" - }, - { - "drilldown" : "019", - "y" : 101, - "name" : "019" - }, - { - "y" : 82, - "drilldown" : "018", - "name" : "018" - }, - { - "name" : "017", - "drilldown" : "017", - "y" : 83 - }, - { - "drilldown" : "016", - "y" : 75, - "name" : "016" - }, - { - "y" : 95, - "drilldown" : "015", - "name" : "015" - }, - { - "name" : "014", - "y" : 98, - "drilldown" : "014" - }, - { - "drilldown" : "013", - "y" : 85, - "name" : "013" - }, - { - "drilldown" : "012", - "y" : 90, - "name" : "012" - }, - { - "name" : "011", - "y" : 86, - "drilldown" : "011" - }, - { - "name" : "010", -