From dd7263a3d97abb4546bebec943af4f33a8427746 Mon Sep 17 00:00:00 2001 From: Michael Manring Date: Mon, 22 Jul 2024 12:49:16 +1000 Subject: pwc279 solution in python --- challenge-279/pokgopun/python/ch-1.py | 53 +++++++++++++++++++++++++ challenge-279/pokgopun/python/ch-2.py | 73 +++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 challenge-279/pokgopun/python/ch-1.py create mode 100644 challenge-279/pokgopun/python/ch-2.py diff --git a/challenge-279/pokgopun/python/ch-1.py b/challenge-279/pokgopun/python/ch-1.py new file mode 100644 index 0000000000..d68c18c09b --- /dev/null +++ b/challenge-279/pokgopun/python/ch-1.py @@ -0,0 +1,53 @@ +### https://theweeklychallenge.org/blog/perl-weekly-challenge-279/ +""" + +Task 1: Sort Letters + +Submitted by: [45]Mohammad Sajid Anwar + __________________________________________________________________ + + You are given two arrays, @letters and @weights. + + Write a script to sort the given array @letters based on the @weights. + +Example 1 + +Input: @letters = ('R', 'E', 'P', 'L') + @weights = (3, 2, 1, 4) +Output: PERL + +Example 2 + +Input: @letters = ('A', 'U', 'R', 'K') + @weights = (2, 4, 1, 3) +Output: RAKU + +Example 3 + +Input: @letters = ('O', 'H', 'Y', 'N', 'P', 'T') + @weights = (5, 4, 2, 6, 1, 3) +Output: PYTHON + +Task 2: Split String +""" +### solution by pokgopun@gmail.com + +def sortLetters(letters,weights): + return "".join( + e[1] for e in sorted( + (weights[i],letters[i]) for i in range(len(letters)) + ) + ) + +import unittest + +class TestSortLetters(unittest.TestCase): + def test(self): + for (letters,weights),otpt in { + (('R', 'E', 'P', 'L'),(3, 2, 1, 4)): "PERL", + (('A', 'U', 'R', 'K'),(2, 4, 1, 3)): "RAKU", + (('O', 'H', 'Y', 'N', 'P', 'T'),(5, 4, 2, 6, 1, 3)): "PYTHON", + }.items(): + self.assertEqual(sortLetters(letters,weights),otpt) + +unittest.main() diff --git a/challenge-279/pokgopun/python/ch-2.py b/challenge-279/pokgopun/python/ch-2.py new file mode 100644 index 0000000000..129bc186bb --- /dev/null +++ b/challenge-279/pokgopun/python/ch-2.py @@ -0,0 +1,73 @@ +### https://theweeklychallenge.org/blog/perl-weekly-challenge-279/ +""" + +Task 2: Split String + +Submitted by: [46]Mohammad Sajid Anwar + __________________________________________________________________ + + You are given a string, $str. + + Write a script to split the given string into two containing exactly + same number of vowels and return true if you can otherwise false. + +Example 1 + +Input: $str = "perl" +Ouput: false + +Example 2 + +Input: $str = "book" +Ouput: true + +Two possible strings "bo" and "ok" containing exactly one vowel each. + +Example 3 + +Input: $str = "good morning" +Ouput: true + +Two possible strings "good " and "morning" containing two vowels each or "good m +" and "orning" containing two vowels each. + __________________________________________________________________ + + Last date to submit the solution 23:59 (UK Time) Sunday 28th July 2024. + __________________________________________________________________ + +SO WHAT DO YOU THINK ? +""" +### solution by pokgopun@gmail.com + +def splitString0(string: str): + return sum( 1 for i in range(len(string)) if string[i] in "aeiou" ) % 2 == 0 + +def splitString1(string: str): + idx = tuple( i for i in range(len(string)) if string[i] in "aeiou" ) + l = len(idx) + h = int(l/2) + b = l % 2 == 0 + if b: + h -= 1 + i = idx[h+1] if l > 1 else idx[h]+1 + return (string[:i], string[i:], b) + +import unittest + +class TestSplitString(unittest.TestCase): + def test0(self): + for inpt,otpt in { + "perl": False, + "book": True, + "good morning": True, + }.items(): + self.assertEqual(splitString0(inpt),otpt) + def test1(self): + for inpt,otpt in { + "perl": ("pe","rl",False), + "book": ("bo","ok",True), + "good morning": ("good m","orning",True), + }.items(): + self.assertEqual(splitString1(inpt),otpt) + +unittest.main() -- cgit From 9b1b7a71043c6d6cbc702bd75fbb78e16509a698 Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Mon, 22 Jul 2024 04:19:42 +0000 Subject: Challenge 279 Solutions (Raku) --- challenge-279/mark-anderson/raku/ch-1.raku | 16 ++++++++++++ challenge-279/mark-anderson/raku/ch-2.raku | 41 ++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 challenge-279/mark-anderson/raku/ch-1.raku create mode 100644 challenge-279/mark-anderson/raku/ch-2.raku diff --git a/challenge-279/mark-anderson/raku/ch-1.raku b/challenge-279/mark-anderson/raku/ch-1.raku new file mode 100644 index 0000000000..09708331c1 --- /dev/null +++ b/challenge-279/mark-anderson/raku/ch-1.raku @@ -0,0 +1,16 @@ +#!/usr/bin/env raku +use Test; + +is sort-letters([], + [<3 2 1 4>]), 'PERL'; + +is sort-letters([], + [<2 4 1 3>]), 'RAKU'; + +is sort-letters([], + [<5 4 2 6 1 3>]), 'PYTHON'; + +sub sort-letters(@letters, @weights) +{ + [~] %(@weights Z=> @letters){1..@weights} +} diff --git a/challenge-279/mark-anderson/raku/ch-2.raku b/challenge-279/mark-anderson/raku/ch-2.raku new file mode 100644 index 0000000000..1251f5a5d3 --- /dev/null +++ b/challenge-279/mark-anderson/raku/ch-2.raku @@ -0,0 +1,41 @@ +#!/usr/bin/env raku +use HTTP::UserAgent; +use DOM::Tiny; +use Test; + +nok split-string('perl'), '1 vowel'; +ok split-string('book'), '2 vowels'; +ok split-string('good morning'), '4 vowels'; +ok split-string('anybody beyond mystic'), '8 vowels'; + +sub split-string($str is copy) +{ + $str .= lc; + my $count = ($str ~~ m:g/ <[aeiou]> /).elems; + + for $str.words.grep({ .contains('y') }) -> $word + { + if $word.comb.contains(none()) + { + $count += ($word ~~ m:g/y/).elems; + next + } + + my $ua = HTTP::UserAgent.new; + my $res = $ua.get("https://www.merriam-webster.com/dictionary/$word"); + + die $res.status-line unless $res.is-success; + + my $dom = DOM::Tiny.parse($res.content); + my @syllables = $dom.at('.word-syllables-entry') + .text.split("\x[00B7]\x[200B]"); + + for @syllables + { + next unless .contains('y'); + $count += (.comb.indices('y').grep(* > 0)).elems + } + } + + return $count %% 2 +} -- cgit From d16417257e7f2381b0970c2d27ac2086c0ace1e9 Mon Sep 17 00:00:00 2001 From: Michael Manring Date: Mon, 22 Jul 2024 14:39:34 +1000 Subject: pwc279 solution in go --- challenge-279/pokgopun/go/ch-1.go | 64 +++++++++++++++++++++++ challenge-279/pokgopun/go/ch-2.go | 106 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+) create mode 100644 challenge-279/pokgopun/go/ch-1.go create mode 100644 challenge-279/pokgopun/go/ch-2.go diff --git a/challenge-279/pokgopun/go/ch-1.go b/challenge-279/pokgopun/go/ch-1.go new file mode 100644 index 0000000000..1417aaec23 --- /dev/null +++ b/challenge-279/pokgopun/go/ch-1.go @@ -0,0 +1,64 @@ +//# https://theweeklychallenge.org/blog/perl-weekly-challenge-279/ +/*# + +Task 1: Sort Letters + +Submitted by: [45]Mohammad Sajid Anwar + __________________________________________________________________ + + You are given two arrays, @letters and @weights. + + Write a script to sort the given array @letters based on the @weights. + +Example 1 + +Input: @letters = ('R', 'E', 'P', 'L') + @weights = (3, 2, 1, 4) +Output: PERL + +Example 2 + +Input: @letters = ('A', 'U', 'R', 'K') + @weights = (2, 4, 1, 3) +Output: RAKU + +Example 3 + +Input: @letters = ('O', 'H', 'Y', 'N', 'P', 'T') + @weights = (5, 4, 2, 6, 1, 3) +Output: PYTHON + +Task 2: Split String +#*/ +//# solution by pokgopun@gmail.com + +package main + +import ( + "io" + "os" + + "github.com/google/go-cmp/cmp" +) + +func sortLetters(letters []rune, weights []int) string { + r := make([]rune, len(letters)) + for i, v := range letters { + r[weights[i]-1] = v + } + return string(r) +} + +func main() { + for _, data := range []struct { + letters []rune + weights []int + output string + }{ + {[]rune{'R', 'E', 'P', 'L'}, []int{3, 2, 1, 4}, "PERL"}, + {[]rune{'A', 'U', 'R', 'K'}, []int{2, 4, 1, 3}, "RAKU"}, + {[]rune{'O', 'H', 'Y', 'N', 'P', 'T'}, []int{5, 4, 2, 6, 1, 3}, "PYTHON"}, + } { + io.WriteString(os.Stdout, cmp.Diff(sortLetters(data.letters, data.weights), data.output)) // blank if ok otherwise show the difference + } +} diff --git a/challenge-279/pokgopun/go/ch-2.go b/challenge-279/pokgopun/go/ch-2.go new file mode 100644 index 0000000000..852579e91a --- /dev/null +++ b/challenge-279/pokgopun/go/ch-2.go @@ -0,0 +1,106 @@ +//# https://theweeklychallenge.org/blog/perl-weekly-challenge-279/ +/*# + +Task 2: Split String + +Submitted by: [46]Mohammad Sajid Anwar + __________________________________________________________________ + + You are given a string, $str. + + Write a script to split the given string into two containing exactly + same number of vowels and return true if you can otherwise false. + +Example 1 + +Input: $str = "perl" +Ouput: false + +Example 2 + +Input: $str = "book" +Ouput: true + +Two possible strings "bo" and "ok" containing exactly one vowel each. + +Example 3 + +Input: $str = "good morning" +Ouput: true + +Two possible strings "good " and "morning" containing two vowels each or "good m +" and "orning" containing two vowels each. + __________________________________________________________________ + + Last date to submit the solution 23:59 (UK Time) Sunday 28th July 2024. + __________________________________________________________________ + +SO WHAT DO YOU THINK ? +#*/ +//# solution by pokgopun@gmail.com + +package main + +import ( + "io" + "os" + + "github.com/google/go-cmp/cmp" +) + +type text string + +func (tx text) vwlIdx() []int { + var r []int + for i, v := range tx { + switch v { + case 'a', 'e', 'i', 'o', 'u': + r = append(r, i) + } + } + return r +} + +func splitString0(str text) bool { + l := len(str.vwlIdx()) + if l > 0 { + return l%2 == 0 + } + return false +} + +type splitted struct { + First, Second text + Ok bool +} + +func splitString1(str text) splitted { + idx := str.vwlIdx() + l := len(idx) + h := l / 2 + b := l%2 == 0 + if b { + h -= 1 + } + var i int + if l > 1 { + i = idx[h+1] + } else { + i = idx[h] + 1 + } + return splitted{str[:i], str[i:], b} +} + +func main() { + for _, data := range []struct { + str text + output splitted + }{ + {"perl", splitted{"pe", "rl", false}}, + {"book", splitted{"bo", "ok", true}}, + {"good morning", splitted{"good m", "orning", true}}, + } { + io.WriteString(os.Stdout, cmp.Diff(splitString0(data.str), data.output.Ok)) // blank if ok, otherwise show the difference + io.WriteString(os.Stdout, cmp.Diff(splitString1(data.str), data.output)) // blank if ok, otherwise show the difference + } +} -- cgit From 5598c2ce58954b9fa56c460bb77a0e923c29a369 Mon Sep 17 00:00:00 2001 From: Packy Anderson Date: Mon, 22 Jul 2024 01:17:15 -0400 Subject: Challenge 279 solutions by Packy Anderson * Raku that maybe looks like Raku * Perl * Python that definitely looks like Perl * Elixir 1 Blog post --- challenge-279/packy-anderson/README.md | 2 +- challenge-279/packy-anderson/blog.txt | 1 + challenge-279/packy-anderson/elixir/ch-1.exs | 40 ++++++++++++++++++++++++++++ challenge-279/packy-anderson/elixir/ch-2.exs | 27 +++++++++++++++++++ challenge-279/packy-anderson/perl/ch-1.pl | 38 ++++++++++++++++++++++++++ challenge-279/packy-anderson/perl/ch-2.pl | 23 ++++++++++++++++ challenge-279/packy-anderson/python/ch-1.py | 36 +++++++++++++++++++++++++ challenge-279/packy-anderson/python/ch-2.py | 21 +++++++++++++++ challenge-279/packy-anderson/raku/ch-1.raku | 34 +++++++++++++++++++++++ challenge-279/packy-anderson/raku/ch-2.raku | 20 ++++++++++++++ 10 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 challenge-279/packy-anderson/blog.txt create mode 100755 challenge-279/packy-anderson/elixir/ch-1.exs create mode 100755 challenge-279/packy-anderson/elixir/ch-2.exs create mode 100755 challenge-279/packy-anderson/perl/ch-1.pl create mode 100755 challenge-279/packy-anderson/perl/ch-2.pl create mode 100755 challenge-279/packy-anderson/python/ch-1.py create mode 100755 challenge-279/packy-anderson/python/ch-2.py create mode 100755 challenge-279/packy-anderson/raku/ch-1.raku create mode 100755 challenge-279/packy-anderson/raku/ch-2.raku diff --git a/challenge-279/packy-anderson/README.md b/challenge-279/packy-anderson/README.md index 738aeb6df0..4143afe86f 100644 --- a/challenge-279/packy-anderson/README.md +++ b/challenge-279/packy-anderson/README.md @@ -22,4 +22,4 @@ ## Blog Post -[Perl Weekly Challenge: Word Reverse String Sort](https://packy.dardan.com/b/P9) +[Perl Weekly Challenge: Split 'em away!](https://packy.dardan.com/b/PP) diff --git a/challenge-279/packy-anderson/blog.txt b/challenge-279/packy-anderson/blog.txt new file mode 100644 index 0000000000..2df55801aa --- /dev/null +++ b/challenge-279/packy-anderson/blog.txt @@ -0,0 +1 @@ +https://packy.dardan.com/b/PP \ No newline at end of file diff --git a/challenge-279/packy-anderson/elixir/ch-1.exs b/challenge-279/packy-anderson/elixir/ch-1.exs new file mode 100755 index 0000000000..5c16d782d7 --- /dev/null +++ b/challenge-279/packy-anderson/elixir/ch-1.exs @@ -0,0 +1,40 @@ +#!/usr/bin/env elixir + +defmodule PWC do + def sortLetters(letters, weights) do + Enum.zip(weights, letters) + |> Enum.sort_by( &( &1 |> Tuple.to_list |> List.first )) + |> Enum.map_join("", &( &1 |> Tuple.to_list |> List.last )) + end + + def solution(letters, weights) do + IO.puts("Input: @letters = ('" <> + Enum.join(letters, "', '") <> "')" + ) + IO.puts(" @weights = (" <> + Enum.join(weights, ", ") <> ")" + ) + IO.puts("Output: " <> sortLetters(letters, weights) ) + end +end + +IO.puts("Example 1:") +PWC.solution( + ['R', 'E', 'P', 'L'], [3, 2, 1, 4] +) + +IO.puts("\nExample 2:") +PWC.solution( + ['A', 'U', 'R', 'K'], [2, 4, 1, 3] +) + +IO.puts("\nExample 3:") +PWC.solution( + ['O', 'H', 'Y', 'N', 'P', 'T'], [5, 4, 2, 6, 1, 3] +) + +IO.puts("\nExample 4:") +PWC.solution( + [ 'C', 'd', 'F', 'i', 'l', 'n', 'o', 'o', 's', 'u'], + [ 1, 4, 5, 8, 3, 10, 9, 2, 7, 6] +) diff --git a/challenge-279/packy-anderson/elixir/ch-2.exs b/challenge-279/packy-anderson/elixir/ch-2.exs new file mode 100755 index 0000000000..fc55f51ae3 --- /dev/null +++ b/challenge-279/packy-anderson/elixir/ch-2.exs @@ -0,0 +1,27 @@ +#!/usr/bin/env elixir + +defmodule PWC do + require Integer + def splitString(str) do + str + |> String.downcase + |> String.graphemes + |> Enum.filter(&( String.match?(&1, ~r/[aeiou]/) )) + |> Kernel.length + |> Integer.is_even + end + + def solution(str) do + IO.puts("Input: $str = \"#{str}\"") + IO.puts("Output: " <> to_string(splitString(str)) ) + end +end + +IO.puts("Example 1:") +PWC.solution("perl") + +IO.puts("\nExample 2:") +PWC.solution("book") + +IO.puts("\nExample 3:") +PWC.solution("good morning") diff --git a/challenge-279/packy-anderson/perl/ch-1.pl b/challenge-279/packy-anderson/perl/ch-1.pl new file mode 100755 index 0000000000..9ec3202299 --- /dev/null +++ b/challenge-279/packy-anderson/perl/ch-1.pl @@ -0,0 +1,38 @@ +#!/usr/bin/env perl +use v5.40; + +use List::AllUtils qw( zip ); + +sub sortLetters($letters, $weights) { + my %letters = zip @$weights, @$letters; + return join q{}, map { + $letters{$_} + } sort { $a <=> $b } keys %letters; +} + +sub solution($letters, $weights) { + say 'Input: @letters = (\'' . join('\', \'', @$letters) . '\')'; + say ' @weights = (' . join(', ', @$weights) . ')'; + say 'Output: ' . sortLetters($letters, $weights); +} + +say "Example 1:"; +solution( + ['R', 'E', 'P', 'L'], [3, 2, 1, 4] +); + +say "\nExample 2:"; +solution( + ['A', 'U', 'R', 'K'], [2, 4, 1, 3] +); + +say "\nExample 3:"; +solution( + ['O', 'H', 'Y', 'N', 'P', 'T'], [5, 4, 2, 6, 1, 3] +); + +say "\nExample 4:"; +solution( + [ 'C', 'd', 'F', 'i', 'l', 'n', 'o', 'o', 's', 'u'], + [ 1, 4, 5, 8, 3, 10, 9, 2, 7, 6] +); \ No newline at end of file diff --git a/challenge-279/packy-anderson/perl/ch-2.pl b/challenge-279/packy-anderson/perl/ch-2.pl new file mode 100755 index 0000000000..0e1d69a44b --- /dev/null +++ b/challenge-279/packy-anderson/perl/ch-2.pl @@ -0,0 +1,23 @@ +#!/usr/bin/env perl +use v5.40; + +sub splitString($str) { + return ( + ( grep { /[aeiou]/i } split //, $str ) % 2 == 0 + ? 'True' : 'False' + ); +} + +sub solution($str) { + say qq{Input: \$str = "$str"}; + say 'Output: ' . splitString($str); +} + +say "Example 1:"; +solution("perl"); + +say "\nExample 2:"; +solution("book"); + +say "\nExample 3:"; +solution("good morning"); diff --git a/challenge-279/packy-anderson/python/ch-1.py b/challenge-279/packy-anderson/python/ch-1.py new file mode 100755 index 0000000000..f7fa18508d --- /dev/null +++ b/challenge-279/packy-anderson/python/ch-1.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python + +def sortLetters(letters, weights): + letterDict = dict(zip(weights, letters)) + return (''.join([ + letterDict[k] for k in sorted(letterDict.keys(), key=int) + ])) + +def comma_join(arr): + return ', '.join(map(lambda i: str(i), arr)) + +def solution(letters, weights): + print(f"Input: @letters = ('{ ', '.join(letters)}')") + print(f" @weights = ({comma_join(weights)})") + print(f'Output: {sortLetters(letters, weights)}') + +print('Example 1:') +solution( + ['R', 'E', 'P', 'L'], [3, 2, 1, 4] +) + +print('\nExample 2:') +solution( + ['A', 'U', 'R', 'K'], [2, 4, 1, 3] +) + +print('\nExample 3:') +solution( + ['O', 'H', 'Y', 'N', 'P', 'T'], [5, 4, 2, 6, 1, 3] +) + +print('\nExample 4:') +solution( + [ 'C', 'd', 'F', 'i', 'l', 'n', 'o', 'o', 's', 'u'], + [ 1, 4, 5, 8, 3, 10, 9, 2, 7, 6] +) diff --git a/challenge-279/packy-anderson/python/ch-2.py b/challenge-279/packy-anderson/python/ch-2.py new file mode 100755 index 0000000000..b0614bba56 --- /dev/null +++ b/challenge-279/packy-anderson/python/ch-2.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +vowels = ['a', 'e', 'i', 'o', 'u'] + +def splitString(str): + return len([ + v for v in list(str.lower()) if v in vowels + ]) % 2 == 0 + +def solution(str): + print(f'Input: @str = "{str}"') + print(f'Output: {splitString(str)}') + +print('Example 1:') +solution("perl") + +print('\nExample 2:') +solution("book") + +print('\nExample 3:') +solution("good morning") diff --git a/challenge-279/packy-anderson/raku/ch-1.raku b/challenge-279/packy-anderson/raku/ch-1.raku new file mode 100755 index 0000000000..cea6ae4dbb --- /dev/null +++ b/challenge-279/packy-anderson/raku/ch-1.raku @@ -0,0 +1,34 @@ +#!/usr/bin/env raku +use v6; + +sub sortLetters(@letters, @weights) { + my %letters = @weights Z=> @letters; + return %letters.sort(*.key.Int)>>.values.join(q{}); +} + +sub solution(@letters, @weights) { + say 'Input: @letters = (\'' ~ @letters.join('\', \'') ~ '\')'; + say ' @weights = (' ~ @weights.join(', ') ~ ')'; + say 'Output: ' ~ sortLetters(@letters, @weights); +} + +say "Example 1:"; +solution( + ['R', 'E', 'P', 'L'], [3, 2, 1, 4] +); + +say "\nExample 2:"; +solution( + ['A', 'U', 'R', 'K'], [2, 4, 1, 3] +); + +say "\nExample 3:"; +solution( + ['O', 'H', 'Y', 'N', 'P', 'T'], [5, 4, 2, 6, 1, 3] +); + +say "\nExample 4:"; +solution( + [ 'C', 'd', 'F', 'i', 'l', 'n', 'o', 'o', 's', 'u'], + [ 1, 4, 5, 8, 3, 10, 9, 2, 7, 6] +); diff --git a/challenge-279/packy-anderson/raku/ch-2.raku b/challenge-279/packy-anderson/raku/ch-2.raku new file mode 100755 index 0000000000..f01774d574 --- /dev/null +++ b/challenge-279/packy-anderson/raku/ch-2.raku @@ -0,0 +1,20 @@ +#!/usr/bin/env raku +use v6; + +sub splitString($str) { + return $str.lc.comb(/<[aeiou]>/).elems % 2 == 0; +} + +sub solution($str) { + say qq{Input: \$str = "$str"}; + say 'Output: ' ~ splitString($str); +} + +say "Example 1:"; +solution("perl"); + +say "\nExample 2:"; +solution("book"); + +say "\nExample 3:"; +solution("good morning"); -- cgit From d01809d766eb5a42f763e018953f24a48334878c Mon Sep 17 00:00:00 2001 From: pme Date: Mon, 22 Jul 2024 08:58:57 +0200 Subject: challenge-279 --- challenge-279/peter-meszaros/perl/ch-1.pl | 55 ++++++++++++++++++++++++ challenge-279/peter-meszaros/perl/ch-2.pl | 69 +++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100755 challenge-279/peter-meszaros/perl/ch-1.pl create mode 100755 challenge-279/peter-meszaros/perl/ch-2.pl diff --git a/challenge-279/peter-meszaros/perl/ch-1.pl b/challenge-279/peter-meszaros/perl/ch-1.pl new file mode 100755 index 0000000000..d92a44d830 --- /dev/null +++ b/challenge-279/peter-meszaros/perl/ch-1.pl @@ -0,0 +1,55 @@ +#!/usr/bin/env perl +# +=head1 Task 1: Sort Letters + +Submitted by: Mohammad Sajid Anwar + +You are given two arrays, @letters and @weights. + +Write a script to sort the given array @letters based on the @weights. + +=head2 Example 1 + + Input: @letters = ('R', 'E', 'P', 'L') + @weights = (3, 2, 1, 4) + Output: PERL + +=head2 Example 2 + + Input: @letters = ('A', 'U', 'R', 'K') + @weights = (2, 4, 1, 3) + Output: RAKU + +=head2 Example 3 + + Input: @letters = ('O', 'H', 'Y', 'N', 'P', 'T') + @weights = (5, 4, 2, 6, 1, 3) + Output: PYTHON + +=cut + +use strict; +use warnings; +use Test2::V0 -no_srand => 1; +use Data::Dumper; + +my $cases = [ + [[['R','E','P','L'], [3, 2, 1, 4]], 'PERL'], + [[['A','U','R','K'], [2, 4, 1, 3]], 'RAKU'], + [[['O','H','Y','N','P','T'], [5, 4, 2, 6, 1, 3]], 'PYTHON'], +]; + +sub sort_letters +{ + my $l = $_[0]->[0]; + my $w = $_[0]->[1]; + + return join '', $l->@[sort { $w->[$a] cmp $w->[$b] } 0 .. $#$l]; +} + +for (@$cases) { + is(sort_letters($_->[0]), $_->[1], $_->[2]); +} +done_testing(); + +exit 0; diff --git a/challenge-279/peter-meszaros/perl/ch-2.pl b/challenge-279/peter-meszaros/perl/ch-2.pl new file mode 100755 index 0000000000..acb2efeadc --- /dev/null +++ b/challenge-279/peter-meszaros/perl/ch-2.pl @@ -0,0 +1,69 @@ +#!/usr/bin/env perl +# +=head1 Task 2: Split String + +Submitted by: Mohammad Sajid Anwar + +You are given a string, $str. + +Write a script to split the given string into two containing exactly same +number of vowels and return true if you can otherwise false. + +=head2 Example 1 + + Input: $str = "perl" + Ouput: false + +=head2 Example 2 + + Input: $str = "book" + Ouput: true + +Two possible strings "bo" and "ok" containing exactly one vowel each. + +=head2 Example 3 + + Input: $str = "good morning" + Ouput: true + +Two possible strings "good " and "morning" containing two vowels each or +"good m" and "orning" containing two vowels each. + +=cut + +use strict; +use warnings; +use Test2::V0 -no_srand => 1; +use Data::Dumper; + +use constant true => 1; +use constant false => 0; + +my $cases = [ + ["perl", false], + ["book", true], + ["good morning", true], +]; + +my $wovels = { + a => 1, + e => 1, + i => 1, + o => 1, + u => 1, +}; + +sub split_string +{ + my $str = shift; + + return ((grep {$wovels->{$_}} split '', $str) % 2) ? false : true; +} + +for (@$cases) { + is(split_string($_->[0]), $_->[1], $_->[2]); +} +done_testing(); + +exit 0; + -- cgit From be08cae19f652039be25cbae24c0142337386fbe Mon Sep 17 00:00:00 2001 From: Matthew Neleigh Date: Mon, 22 Jul 2024 03:46:43 -0400 Subject: new file: challenge-279/mattneleigh/perl/ch-1.pl new file: challenge-279/mattneleigh/perl/ch-2.pl --- challenge-279/mattneleigh/perl/ch-1.pl | 92 ++++++++++++++++++++++++++++++++++ challenge-279/mattneleigh/perl/ch-2.pl | 63 +++++++++++++++++++++++ 2 files changed, 155 insertions(+) create mode 100755 challenge-279/mattneleigh/perl/ch-1.pl create mode 100755 challenge-279/mattneleigh/perl/ch-2.pl diff --git a/challenge-279/mattneleigh/perl/ch-1.pl b/challenge-279/mattneleigh/perl/ch-1.pl new file mode 100755 index 0000000000..3daa462f63 --- /dev/null +++ b/challenge-279/mattneleigh/perl/ch-1.pl @@ -0,0 +1,92 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use English; + +################################################################################ +# Begin main execution +################################################################################ + +my @letter_sets = ( + [ + [ 'R', 'E', 'P', 'L' ], + [ 3, 2, 1, 4 ] + ], + [ + [ 'A', 'U', 'R', 'K' ], + [ 2, 4, 1, 3 ] + ], + [ + [ 'O', 'H', 'Y', 'N', 'P', 'T' ], + [ 5, 4, 2, 6, 1, 3 ] + ] +); + +print("\n"); +foreach my $letter_set (@letter_sets){ + printf( + "Input: \@letters = (%s)\n\@weights = (%s)\nOutput: %s\n\n", + join( + ", ", + map( + "'" . $_ . "'", + @{$letter_set->[0]} + ) + ), + join( + ", ", + @{$letter_set->[1]} + ), + combine_letters_by_weight($letter_set) + ); +} + +exit(0); +################################################################################ +# End main execution; subroutines follow +################################################################################ + + + +################################################################################ +# Given a set of letters and relative numerical weights, combine the letters +# into a single word, ordered by the specified weights +# Takes one argument: +# * A ref to an array that contains two parallel arrays- one of letters, and +# one of relative weights (e.g. +# [ +# [ 'R', 'E', 'P', 'L' ], +# [ 3, 2, 1, 4 ] +# ] +# ) +# Returns: +# * A word made up of the letters sorted by the specified weights (e.g. "PERL") +################################################################################ +sub combine_letters_by_weight{ + + return( + # 4: Join the letters into a single word + join( + "", + # 3: Extract a list of just the sorted letters + map( + $_->[0], + # 2: Sort the list in ascending order by weight + sort( + { $a->[1] <=> $b->[1] } + # 1: Make a list of of letters and their specified + # weights (e.g. [ "R", 3 ] ) + map( + [ $ARG[0][0][$_], $ARG[0][1][$_] ], + 0 .. $#{$ARG[0][0]} + ) + ) + ) + ) + ); + +} + + + diff --git a/challenge-279/mattneleigh/perl/ch-2.pl b/challenge-279/mattneleigh/perl/ch-2.pl new file mode 100755 index 0000000000..3539be6207 --- /dev/null +++ b/challenge-279/mattneleigh/perl/ch-2.pl @@ -0,0 +1,63 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use English; + +################################################################################ +# Begin main execution +################################################################################ + +my @strings = ( + "perl", + "book", + "good morning" +); + +print("\n"); +foreach my $string (@strings){ + printf( + "Input: \$str = \"%s\"\nOuput: %s\n\n", + $string, + can_evenly_split_vowels($string) ? "true" : "false" + ); +} + +exit(0); +################################################################################ +# End main execution; subroutines follow +################################################################################ + + + +################################################################################ +# Given a string, determine whether it is possible to split a string into two +# substrings with an equal number of vowels +# Takes one argument: +# * A string to examine +# Returns: +# * A value that evaluates as true if it is possible to split the string into +# two substrings with an equal number of vowels, and a value that evaluates +# as false if it is not possible to split the string into two substrings with +# an equal number of vowels; a false value will be returned if there are no +# vaowels present +################################################################################ +sub can_evenly_split_vowels{ + + my $total = 0; + + # Split the word into individual letters and + # count the vowels, case-insensitively + foreach my $letter (split('', shift())){ + $total++ + if($letter =~ m/[aeiou]/i); + } + + # Return true if we had vowels, and an even + # number of them + return($total && !($total % 2)); + +} + + + -- cgit From 4c4b641c4811d0debac2ee7c700298d42371ca1c Mon Sep 17 00:00:00 2001 From: "E. Choroba" Date: Mon, 22 Jul 2024 10:16:04 +0200 Subject: Add solutions to 279: Sort Letters & Split String by E. Choroba --- challenge-279/e-choroba/perl/ch-1.pl | 16 ++++++++++++++++ challenge-279/e-choroba/perl/ch-2.pl | 15 +++++++++++++++ 2 files changed, 31 insertions(+) create mode 100755 challenge-279/e-choroba/perl/ch-1.pl create mode 100755 challenge-279/e-choroba/perl/ch-2.pl diff --git a/challenge-279/e-choroba/perl/ch-1.pl b/challenge-279/e-choroba/perl/ch-1.pl new file mode 100755 index 0000000000..d11b663b3a --- /dev/null +++ b/challenge-279/e-choroba/perl/ch-1.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl +use warnings; +use strict; +use experimental qw( signatures ); + +sub sort_letters($letters, $weights) { + return join "", + @$letters[ sort { $weights->[$a] <=> $weights->[$b] } 0 .. $#$weights ] +} + +use Test::More tests => 3; + +is sort_letters(['R', 'E', 'P', 'L'], [3, 2, 1, 4]), 'PERL', 'Example 1'; +is sort_letters(['A', 'U', 'R', 'K'], [2, 4, 1, 3]), 'RAKU', 'Example 2'; +is sort_letters(['O', 'H', 'Y', 'N', 'P', 'T'], [5, 4, 2, 6, 1, 3]), + 'PYTHON', 'Example 3'; diff --git a/challenge-279/e-choroba/perl/ch-2.pl b/challenge-279/e-choroba/perl/ch-2.pl new file mode 100755 index 0000000000..f1080bfbe9 --- /dev/null +++ b/challenge-279/e-choroba/perl/ch-2.pl @@ -0,0 +1,15 @@ +#!/usr/bin/perl +use warnings; +use strict; +use experimental qw( signatures ); + +sub split_string($string) { + my $tally = $string =~ tr/aeiou//; + return 0 == $tally % 2 +} + +use Test::More tests => 3; + +ok ! split_string('perl'), 'Example 1'; +ok split_string('book'), 'Example 2'; +ok split_string('good morning'), 'Example 3'; -- cgit From c09789e1d811898d44e5f637c59693ed3d8d65be Mon Sep 17 00:00:00 2001 From: Mohammad Sajid Anwar Date: Mon, 22 Jul 2024 09:25:34 +0100 Subject: - Added solutions by Santiago Leyva. --- stats/pwc-current.json | 537 ++-- stats/pwc-language-breakdown-summary.json | 58 +- stats/pwc-language-breakdown.json | 3872 ++++++++++++++--------------- stats/pwc-leaders.json | 706 +++--- stats/pwc-summary-1-30.json | 42 +- stats/pwc-summary-121-150.json | 94 +- stats/pwc-summary-151-180.json | 42 +- stats/pwc-summary-181-210.json | 36 +- stats/pwc-summary-211-240.json | 20 +- stats/pwc-summary-241-270.json | 116 +- stats/pwc-summary-271-300.json | 106 +- stats/pwc-summary-301-330.json | 74 +- stats/pwc-summary-31-60.json | 42 +- stats/pwc-summary-61-90.json | 44 +- stats/pwc-summary-91-120.json | 40 +- stats/pwc-summary.json | 40 +- 16 files changed, 2942 insertions(+), 2927 deletions(-) diff --git a/stats/pwc-current.json b/stats/pwc-current.json index b11a00e454..b50d8e37cd 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,27 +1,220 @@ { + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + }, + "series" : [ + { + "data" : [ + { + "drilldown" : "Alexander Karelas", + "name" : "Alexander Karelas", + "y" : 2 + }, + { + "name" : "Ali Moradi", + "drilldown" : "Ali Moradi", + "y" : 3 + }, + { + "y" : 3, + "drilldown" : "Andrew Schneider", + "name" : "Andrew Schneider" + }, + { + "name" : "Arne Sommer", + "drilldown" : "Arne Sommer", + "y" : 3 + }, + { + "y" : 4, + "drilldown" : "Athanasius", + "name" : "Athanasius" + }, + { + "name" : "BarrOff", + "drilldown" : "BarrOff", + "y" : 2 + }, + { + "name" : "Bob Lied", + "drilldown" : "Bob Lied", + "y" : 2 + }, + { + "drilldown" : "Bruce Gray", + "name" : "Bruce Gray", + "y" : 2 + }, + { + "drilldown" : "Cheok-Yin Fung", + "name" : "Cheok-Yin Fung", + "y" : 2 + }, + { + "y" : 2, + "drilldown" : "Dave Jacoby", + "name" : "Dave Jacoby" + }, + { + "drilldown" : "David Ferrone", + "name" : "David Ferrone", + "y" : 2 + }, + { + "y" : 2, + "drilldown" : "E. Choroba", + "name" : "E. Choroba" + }, + { + "name" : "Feng Chang", + "drilldown" : "Feng Chang", + "y" : 2 + }, + { + "y" : 5, + "drilldown" : "Jaldhar H. Vyas", + "name" : "Jaldhar H. Vyas" + }, + { + "name" : "Jan Krnavek", + "drilldown" : "Jan Krnavek", + "y" : 2 + }, + { + "drilldown" : "Jorg Sommrey", + "name" : "Jorg Sommrey", + "y" : 3 + }, + { + "y" : 2, + "name" : "Kjetil Skotheim", + "drilldown" : "Kjetil Skotheim" + }, + { + "name" : "Lance Wicks", + "drilldown" : "Lance Wicks", + "y" : 1 + }, + { + "drilldown" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld", + "y" : 6 + }, + { + "name" : "Luca Ferrari", + "drilldown" : "Luca Ferrari", + "y" : 11 + }, + { + "y" : 2, + "name" : "Mariano Ortega", + "drilldown" : "Mariano Ortega" + }, + { + "drilldown" : "Mark Anderson", + "name" : "Mark Anderson", + "y" : 2 + }, + { + "name" : "Matthew Neleigh", + "drilldown" : "Matthew Neleigh", + "y" : 2 + }, + { + "drilldown" : "Packy Anderson", + "name" : "Packy Anderson", + "y" : 5 + }, + { + "y" : 3, + "drilldown" : "Peter Campbell Smith", + "name" : "Peter Campbell Smith" + }, + { + "y" : 2, + "drilldown" : "Peter Meszaros", + "name" : "Peter Meszaros" + }, + { + "y" : 3, + "drilldown" : "Reinier Maliepaard", + "name" : "Reinier Maliepaard" + }, + { + "y" : 3, + "name" : "Robbie Hatley", + "drilldown" : "Robbie Hatley" + }, + { + "name" : "Robert Ransbottom", + "drilldown" : "Robert Ransbottom", + "y" : 2 + }, + { + "drilldown" : "Roger Bell_West", + "name" : "Roger Bell_West", + "y" : 5 + }, + { + "y" : 2, + "drilldown" : "Santiago Leyva", + "name" : "Santiago Leyva" + }, + { + "y" : 4, + "drilldown" : "Thomas Kohler", + "name" : "Thomas Kohler" + }, + { + "drilldown" : "Ulrich Rieke", + "name" : "Ulrich Rieke", + "y" : 4 + }, + { + "y" : 3, + "name" : "W. Luis Mochan", + "drilldown" : "W. Luis Mochan" + }, + { + "y" : 2, + "name" : "Wanderdoc", + "drilldown" : "Wanderdoc" + } + ], + "colorByPoint" : 1, + "name" : "The Weekly Challenge - 278" + } + ], "legend" : { "enabled" : 0 }, - "xAxis" : { - "type" : "category" + "tooltip" : { + "headerFormat" : "{series.name}
", + "followPointer" : 1, + "pointFormat" : "{point.name}: {point.y:f}
" }, - "subtitle" : { - "text" : "[Champions: 34] Last updated at 2024-07-21 23:35:46 GMT" + "chart" : { + "type" : "column" }, "drilldown" : { "series" : [ { + "id" : "Alexander Karelas", "name" : "Alexander Karelas", "data" : [ [ "Perl", 2 ] - ], - "id" : "Alexander Karelas" + ] }, { - "id" : "Ali Moradi", "data" : [ [ "Perl", @@ -32,7 +225,8 @@ 1 ] ], - "name" : "Ali Moradi" + "name" : "Ali Moradi", + "id" : "Ali Moradi" }, { "data" : [ @@ -49,7 +243,6 @@ "id" : "Andrew Schneider" }, { - "id" : "Arne Sommer", "data" : [ [ "Raku", @@ -60,10 +253,12 @@ 1 ] ], + "id" : "Arne Sommer", "name" : "Arne Sommer" }, { "name" : "Athanasius", + "id" : "Athanasius", "data" : [ [ "Perl", @@ -73,38 +268,37 @@ "Raku", 2 ] - ], - "id" : "Athanasius" + ] }, { - "name" : "BarrOff", "data" : [ [ "Raku", 2 ] ], - "id" : "BarrOff" + "id" : "BarrOff", + "name" : "BarrOff" }, { - "name" : "Bob Lied", "data" : [ [ "Perl", 2 ] ], - "id" : "Bob Lied" + "id" : "Bob Lied", + "name" : "Bob Lied" }, { "name" : "Bruce Gray", + "id" : "Bruce Gray", "data" : [ [ "Raku", 2 ] - ], - "id" : "Bruce Gray" + ] }, { "data" : [ @@ -113,8 +307,8 @@ 2 ] ], - "name" : "Cheok-Yin Fung", - "id" : "Cheok-Yin Fung" + "id" : "Cheok-Yin Fung", + "name" : "Cheok-Yin Fung" }, { "data" : [ @@ -123,27 +317,27 @@ 2 ] ], - "name" : "Dave Jacoby", - "id" : "Dave Jacoby" + "id" : "Dave Jacoby", + "name" : "Dave Jacoby" }, { + "name" : "David Ferrone", "id" : "David Ferrone", "data" : [ [ "Perl", 2 ] - ], - "name" : "David Ferrone" + ] }, { - "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] ], + "id" : "E. Choroba", "name" : "E. Choroba" }, { @@ -153,12 +347,10 @@ 2 ] ], - "name" : "Feng Chang", - "id" : "Feng Chang" + "id" : "Feng Chang", + "name" : "Feng Chang" }, { - "id" : "Jaldhar H. Vyas", - "name" : "Jaldhar H. Vyas", "data" : [ [ "Perl", @@ -172,17 +364,19 @@ "Blog", 1 ] - ] + ], + "name" : "Jaldhar H. Vyas", + "id" : "Jaldhar H. Vyas" }, { - "id" : "Jan Krnavek", - "name" : "Jan Krnavek", "data" : [ [ "Raku", 2 ] - ] + ], + "name" : "Jan Krnavek", + "id" : "Jan Krnavek" }, { "data" : [ @@ -199,28 +393,26 @@ "id" : "Jorg Sommrey" }, { + "id" : "Kjetil Skotheim", + "name" : "Kjetil Skotheim", "data" : [ [ "Perl", 2 ] - ], - "name" : "Kjetil Skotheim", - "id" : "Kjetil Skotheim" + ] }, { - "id" : "Lance Wicks", - "name" : "Lance Wicks", "data" : [ [ "Perl", 1 ] - ] + ], + "id" : "Lance Wicks", + "name" : "Lance Wicks" }, { - "id" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -234,9 +426,12 @@ "Blog", 2 ] - ] + ], + "id" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld" }, { + "id" : "Luca Ferrari", "name" : "Luca Ferrari", "data" : [ [ @@ -247,18 +442,17 @@ "Blog", 9 ] - ], - "id" : "Luca Ferrari" + ] }, { + "id" : "Mariano Ortega", "name" : "Mariano Ortega", "data" : [ [ "Perl", 2 ] - ], - "id" : "Mariano Ortega" + ] }, { "id" : "Mark Anderson", @@ -271,8 +465,8 @@ ] }, { - "id" : "Matthew Neleigh", "name" : "Matthew Neleigh", + "id" : "Matthew Neleigh", "data" : [ [ "Perl", @@ -281,8 +475,6 @@ ] }, { - "id" : "Packy Anderson", - "name" : "Packy Anderson", "data" : [ [ "Perl", @@ -296,11 +488,11 @@ "Blog", 1 ] - ] + ], + "id" : "Packy Anderson", + "name" : "Packy Anderson" }, { - "id" : "Peter Campbell Smith", - "name" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -310,20 +502,23 @@ "Blog", 1 ] - ] + ], + "id" : "Peter Campbell Smith", + "name" : "Peter Campbell Smith" }, { + "name" : "Peter Meszaros", "id" : "Peter Meszaros", "data" : [ [ "Perl", 2 ] - ], - "name" : "Peter Meszaros" + ] }, { "id" : "Reinier Maliepaard", + "name" : "Reinier Maliepaard", "data" : [ [ "Perl", @@ -333,11 +528,9 @@ "Blog", 1 ] - ], - "name" : "Reinier Maliepaard" + ] }, { - "id" : "Robbie Hatley", "data" : [ [ "Perl", @@ -348,17 +541,18 @@ 1 ] ], - "name" : "Robbie Hatley" + "name" : "Robbie Hatley", + "id" : "Robbie Hatley" }, { - "id" : "Robert Ransbottom", "data" : [ [ "Raku", 2 ] ], - "name" : "Robert Ransbottom" + "name" : "Robert Ransbottom", + "id" : "Robert Ransbottom" }, { "data" : [ @@ -375,8 +569,18 @@ 1 ] ], - "name" : "Roger Bell_West", - "id" : "Roger Bell_West" + "id" : "Roger Bell_West", + "name" : "Roger Bell_West" + }, + { + "id" : "Santiago Leyva", + "name" : "Santiago Leyva", + "data" : [ + [ + "Perl", + 2 + ] + ] }, { "id" : "Thomas Kohler", @@ -393,7 +597,6 @@ ] }, { - "id" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -404,6 +607,7 @@ 2 ] ], + "id" : "Ulrich Rieke", "name" : "Ulrich Rieke" }, { @@ -421,218 +625,29 @@ ] }, { + "name" : "Wanderdoc", + "id" : "Wanderdoc", "data" : [ [ "Perl", 2 ] - ], - "name" : "Wanderdoc", - "id" : "Wanderdoc" + ] } ] }, "title" : { "text" : "The Weekly Challenge - 278" }, + "xAxis" : { + "type" : "category" + }, + "subtitle" : { + "text" : "[Champions: 35] Last updated at 2024-07-22 08:25:24 GMT" + }, "yAxis" : { "title" : { "text" : "Total Solutions" } - }, - "series" : [ - { - "colorByPoint" : 1, - "name" : "The Weekly Challenge - 278", - "data" : [ - { - "drilldown" : "Alexander Karelas", - "name" : "Alexander Karelas", - "y" : 2 - }, - { - "name" : "Ali Moradi", - "y" : 3, - "drilldown" : "Ali Moradi" - }, - { - "y" : 3, - "name" : "Andrew Schneider", - "drilldown" : "Andrew Schneider" - }, - { - "name" : "Arne Sommer", - "y" : 3, - "drilldown" : "Arne Sommer" - }, - { - "y" : 4, - "name" : "Athanasius", - "drilldown" : "Athanasius" - }, - { - "drilldown" : "BarrOff", - "name" : "BarrOff", - "y" : 2 - }, - { - "y" : 2, - "name" : "Bob Lied", - "drilldown" : "Bob Lied" - }, - { - "y" : 2, - "name" : "Bruce Gray", - "drilldown" : "Bruce Gray" - }, - { - "y" : 2, - "name" : "Cheok-Yin Fung", - "drilldown" : "Cheok-Yin Fung" - }, - { - "y" : 2, - "name" : "Dave Jacoby", - "drilldown" : "Dave Jacoby" - }, - { - "y" : 2, - "name" : "David Ferrone", - "drilldown" : "David Ferrone" - }, - { - "name" : "E. Choroba", - "y" : 2, - "drilldown" : "E. Choroba" - }, - { - "drilldown" : "Feng Chang", - "name" : "Feng Chang", - "y" : 2 - }, - { - "y" : 5, - "name" : "Jaldhar H. Vyas", - "drilldown" : "Jaldhar H. Vyas" - }, - { - "drilldown" : "Jan Krnavek", - "y" : 2, - "name" : "Jan Krnavek" - }, - { - "name" : "Jorg Sommrey", - "y" : 3, - "drilldown" : "Jorg Sommrey" - }, - { - "drilldown" : "Kjetil Skotheim", - "y" : 2, - "name" : "Kjetil Skotheim" - }, - { - "drilldown" : "Lance Wicks", - "name" : "Lance Wicks", - "y" : 1 - }, - { - "name" : "Laurent Rosenfeld", - "y" : 6, - "drilldown" : "Laurent Rosenfeld" - }, - { - "drilldown" : "Luca Ferrari", - "y" : 11, - "name" : "Luca Ferrari" - }, - { - "drilldown" : "Mariano Ortega", - "name" : "Mariano Ortega", - "y" : 2 - }, - { - "drilldown" : "Mark Anderson", - "y" : 2, - "name" : "Mark Anderson" - }, - { - "y" : 2, - "name" : "Matthew Neleigh", - "drilldown" : "Matthew Neleigh" - }, - { - "drilldown" : "Packy Anderson", - "name" : "Packy Anderson", - "y" : 5 - }, - { - "drilldown" : "Peter Campbell Smith", - "y" : 3, - "name" : "Peter Campbell Smith" - }, - { - "name" : "Peter Meszaros", - "y" : 2, - "drilldown" : "Peter Meszaros" - }, - { - "name" : "Reinier Maliepaard", - "y" : 3, - "drilldown" : "Reinier Maliepaard" - }, - { - "name" : "Robbie Hatley", - "y" : 3, - "drilldown" : "Robbie Hatley" - }, - { - "drilldown" : "Robert Ransbottom", - "name" : "Robert Ransbottom", - "y" : 2 - }, - { - "drilldown" : "Roger Bell_West", - "name" : "Roger Bell_West", - "y" : 5 - }, - { - "name" : "Thomas Kohler", - "y" : 4, - "drilldown" : "Thomas Kohler" - }, - { - "drilldown" : "Ulrich Rieke", - "y" : 4, - "name" : "Ulrich Rieke" - }, - { - "name" : "W. Luis Mochan", - "y" : 3, - "drilldown" : "W. Luis Mochan" - }, - { - "y" : 2, - "name" : "Wanderdoc", - "drilldown" : "Wanderdoc" - } - ] - } - ], - "chart" : { - "type" : "column" - }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - }, - "borderWidth" : 0 - } - }, - "tooltip" : { - "pointFormat" : "{point.name}: {point.y:f}
", - "headerFormat" : "{series.name}
", - "followPointer" : 1 } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 956ea0871a..344b8f1c0d 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,24 +1,9 @@ { - "chart" : { - "type" : "column" - }, - "tooltip" : { - "pointFormat" : "{point.y:.0f}" + "legend" : { + "enabled" : "false" }, "series" : [ { - "dataLabels" : { - "color" : "#FFFFFF", - "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" - }, - "rotation" : -90, - "y" : 10, - "format" : "{point.y:.0f}", - "align" : "right", - "enabled" : "true" - }, "data" : [ [ "Blog", @@ -26,38 +11,53 @@ ], [ "Perl", - 14395 + 14397 ], [ "Raku", 8332 ] ], - "name" : "Contributions" + "name" : "Contributions", + "dataLabels" : { + "align" : "right", + "rotation" : -90, + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + }, + "color" : "#FFFFFF", + "y" : 10, + "enabled" : "true", + "format" : "{point.y:.0f}" + } } ], "yAxis" : { + "min" : 0, "title" : { "text" : null - }, - "min" : 0 - }, - "title" : { - "text" : "The Weekly Challenge Contributions [2019 - 2024]" + } }, "subtitle" : { - "text" : "Last updated at 2024-07-21 23:35:46 GMT" + "text" : "Last updated at 2024-07-22 08:25:24 GMT" }, "xAxis" : { "labels" : { "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" } }, "type" : "category" }, - "legend" : { - "enabled" : "false" + "title" : { + "text" : "The Weekly Challenge Contributions [2019 - 2024]" + }, + "chart" : { + "type" : "column" + }, + "tooltip" : { + "pointFormat" : "{point.y:.0f}" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 24d7026c29..b60566bbcf 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,1417 +1,23 @@ { - "tooltip" : { - "followPointer" : "true", - "headerFormat" : "", - "pointFormat" : "Challenge {point.name}: {point.y:f}
" + "subtitle" : { + "text" : "Click the columns to drilldown the language breakdown. Last updated at 2024-07-22 08:25:24 GMT" }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } + "yAxis" : { + "title" : { + "text" : "Total Solutions" } }, "chart" : { "type" : "column" }, - "series" : [ - { - "colorByPoint" : "true", - "data" : [ - { - "name" : "#001", - "y" : 165, - "drilldown" : "001" - }, - { - "drilldown" : "002", - "name" : "#002", - "y" : 133 - }, - { - "name" : "#003", - "y" : 91, - "drilldown" : "003" - }, - { - "drilldown" : "004", - "name" : "#004", - "y" : 106 - }, - { - "name" : "#005", - "y" : 82, - "drilldown" : "005" - }, - { - "y" : 63, - "name" : "#006", - "drilldown" : "006" - }, - { - "drilldown" : "007", - "y" : 71, - "name" : "#007" - }, - { - "y" : 82, - "name" : "#008", - "drilldown" : "008" - }, - { - "name" : "#009", - "y" : 79, - "drilldown" : "009" - }, - { - "drilldown" : "010", - "y" : 69, - "name" : "#010" - }, - { - "y" : 86, - "name" : "#011", - "drilldown" : "011" - }, - { - "y" : 90, - "name" : "#012", - "drilldown" : "012" - }, - { - "name" : "#013", - "y" : 85, - "drilldown" : "013" - }, - { - "drilldown" : "014", - "y" : 98, - "name" : "#014" - }, - { - "drilldown" : "015", - "y" : 95, - "name" : "#015" - }, - { - "y" : 75, - "name" : "#016", - "drilldown" : "016" - }, - { - "name" : "#017", - "y" : 83, - "drilldown" : "017" - }, - { - "y" : 82, - "name" : "#018", - "drilldown" : "018" - }, - { - "name" : "#019", - "y" : 101, - "drilldown" : "019" - }, - { - "y" : 100, - "name" : "#020", - "drilldown" : "020" - }, - { - "drilldown" : "021", - "name" : "#021", - "y" : 72 - }, - { - "drilldown" : "022", - "name" : "#022", - "y" : 72 - }, - { - "name" : "#023", - "y" : 88, - "drilldown" : "023" - }, - { - "y" : 77, - "name" : "#024", - "drilldown" : "024" - }, - { - "drilldown" : "025", - "name" : "#025", - "y" : 62 - }, - { - "y" : 75, - "name" : "#026", - "drilldown" : "026" - }, - { - "y" : 64, - "name" : "#027", - "drilldown" : "027" - }, - { - "drilldown" : "028", - "name" : "#028", - "y" : 82 - }, - { - "drilldown" : "029", - "y" : 83, - "name" : "#029" - }, - { - "name" : "#030", - "y" : 120, - "drilldown" : "030" - }, - { - "name" : "#031", - "y" : 93, - "drilldown" : "031" - }, - { - "drilldown" : "032", - "name" : "#032", - "y" : 97 - }, - { - "drilldown" : "033", - "name" : "#033", - "y" : 113 - }, - { - "drilldown" : "034", - "name" : "#034", - "y" : 70 - }, - { - "name" : "#035", - "y" : 68, - "drilldown" : "035" - }, - { - "name" : "#036", - "y" : 70, - "drilldown" : "036" - }, - { - "drilldown" : "037", - "name" : "#037", - "y" : 70 - }, - { - "y" : 74, - "name" : "#038", - "drilldown" : "038" - }, - { - "name" : "#039", - "y" : 68, - "drilldown" : "039" - }, - { - "drilldown" : "040", - "y" : 77, - "name" : "#040" - }, - { - "name" : "#041", - "y" : 80, - "drilldown" : "041" - }, - { - "drilldown" : "042", - "name" : "#042", - "y" : 98 - }, - { - "drilldown" : "043", - "name" : "#043", - "y" : 72 - }, - { - "drilldown" : "044", - "y" : 90, - "name" : "#044" - }, - { - "name" : "#045", - "y" : 102, - "drilldown" : "045" - }, - { - "drilldown" : "046", - "y" : 93, - "name" : "#046" - }, - { - "drilldown" : "047", - "y" : 88, - "name" : "#047" - }, - { - "drilldown" : "048", - "name" : "#048", - "y" : 112 - }, - { - "y" : 93, - "name" : "#049", - "drilldown" : "049" - }, - { - "drilldown" : "050", - "y" : 104, - "name" : "#050" - }, - { - "name" : "#051", - "y" : 95, - "drilldown" : "051" - }, - { - "drilldown" : "052", - "name" : "#052", - "y" : 93 - }, - { - "drilldown" : "053", - "y" : 105, - "name" : "#053" - }, - { - "drilldown" : "054", - "name" : "#054", - "y" : 107 - }, - { - "name" : "#055", - "y" : 92, - "drilldown" : "055" - }, - { - "y" : 104, - "name" : "#056", - "drilldown" : "056" - }, - { - "drilldown" : "057", - "name" : "#057", - "y" : 86 - }, - { - "drilldown" : "058", - "y" : 71, - "name" : "#058" - }, - { - "name" : "#059", - "y" : 93, - "drilldown" : "059" - }, - { - "y" : 89, - "name" : "#060", - "drilldown" : "060" - }, - { - "drilldown" : "061", - "name" : "#061", - "y" : 85 - }, - { - "drilldown" : "062", - "y" : 62, - "name" : "#062" - }, - { - "drilldown" : "063", - "y" : 93, - "name" : "#063" - }, - { - "drilldown" : "064", - "name" : "#064", - "y" : 84 - }, - { - "drilldown" : "065", - "name" : "#065", - "y" :