From a29c794b1595866a50612d3dccd5a1b1255f9217 Mon Sep 17 00:00:00 2001 From: Conor Hoekstra Date: Mon, 19 Aug 2024 09:13:38 -0400 Subject: :sparkles: Week 283 in BQN --- challenge-283/conor-hoekstra/ch-1.bqn | 10 ++++++++++ challenge-283/conor-hoekstra/ch-2.bqn | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 challenge-283/conor-hoekstra/ch-1.bqn create mode 100644 challenge-283/conor-hoekstra/ch-2.bqn diff --git a/challenge-283/conor-hoekstra/ch-1.bqn b/challenge-283/conor-hoekstra/ch-1.bqn new file mode 100644 index 0000000000..b2d34a6efe --- /dev/null +++ b/challenge-283/conor-hoekstra/ch-1.bqn @@ -0,0 +1,10 @@ +# For up to date code: +# https://github.com/codereport/bqn-code/blob/main/pwc/283-1.bqn + +UniqueNumber ← ⊑·/1=·≠¨⊔ + +# Tests +•Show UniqueNumber ⟨3, 3, 1⟩ # 1 +•Show UniqueNumber ⟨3, 2, 4, 2, 4⟩ # 3 +•Show UniqueNumber ⟨1⟩ # 1 +•Show UniqueNumber ⟨4, 3, 1, 1, 1, 4⟩ # 3 diff --git a/challenge-283/conor-hoekstra/ch-2.bqn b/challenge-283/conor-hoekstra/ch-2.bqn new file mode 100644 index 0000000000..492b67033b --- /dev/null +++ b/challenge-283/conor-hoekstra/ch-2.bqn @@ -0,0 +1,8 @@ +# For up to date code: +# https://github.com/codereport/bqn-code/blob/main/pwc/283-2.bqn + +DigitCountValue ← (+˝(=⌜⟜↕≠))⊸≡ + +# Tests +•Show DigitCountValue ⟨1, 2, 1, 0⟩ # 1 +•Show DigitCountValue ⟨0, 3, 0⟩ # 0 -- cgit From 65a75b949d58591e22bad80c8e3c33b77cd946f9 Mon Sep 17 00:00:00 2001 From: Simon Green Date: Sun, 25 Aug 2024 21:14:42 +1000 Subject: sgreen solutions to challenge 283 --- challenge-283/sgreen/README.md | 4 ++-- challenge-283/sgreen/blog.txt | 1 + challenge-283/sgreen/perl/ch-1.pl | 29 +++++++++++++++++++++++++++++ challenge-283/sgreen/perl/ch-2.pl | 28 ++++++++++++++++++++++++++++ challenge-283/sgreen/python/ch-1.py | 31 +++++++++++++++++++++++++++++++ challenge-283/sgreen/python/ch-2.py | 28 ++++++++++++++++++++++++++++ challenge-283/sgreen/python/test.py | 21 +++++++++++++++++++++ 7 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 challenge-283/sgreen/blog.txt create mode 100755 challenge-283/sgreen/perl/ch-1.pl create mode 100755 challenge-283/sgreen/perl/ch-2.pl create mode 100755 challenge-283/sgreen/python/ch-1.py create mode 100755 challenge-283/sgreen/python/ch-2.py create mode 100755 challenge-283/sgreen/python/test.py diff --git a/challenge-283/sgreen/README.md b/challenge-283/sgreen/README.md index eff69133e3..a1791d3a25 100644 --- a/challenge-283/sgreen/README.md +++ b/challenge-283/sgreen/README.md @@ -1,3 +1,3 @@ -# The Weekly Challenge 282 +# The Weekly Challenge 283 -Blog: [Good keys](https://dev.to/simongreennet/good-keys-2elk) +Blog: [Weekly Challenge 283](https://dev.to/simongreennet/weekly-challenge-283-102h) diff --git a/challenge-283/sgreen/blog.txt b/challenge-283/sgreen/blog.txt new file mode 100644 index 0000000000..883e2d2ae4 --- /dev/null +++ b/challenge-283/sgreen/blog.txt @@ -0,0 +1 @@ +https://dev.to/simongreennet/weekly-challenge-283-102h \ No newline at end of file diff --git a/challenge-283/sgreen/perl/ch-1.pl b/challenge-283/sgreen/perl/ch-1.pl new file mode 100755 index 0000000000..7a69bc8d06 --- /dev/null +++ b/challenge-283/sgreen/perl/ch-1.pl @@ -0,0 +1,29 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use feature 'say'; +use experimental 'signatures'; + +sub main (@ints) { + # Calculate the frequency of each integer + my %freq = (); + foreach my $int (@ints) { + $freq{$int}++; + } + + # Get the integers that appear only once + my @only_once = grep { $freq{$_} == 1 } keys %freq; + + if ( $#only_once == 0 ) { + say $only_once[0]; + } + elsif ( $#only_once == -1 ) { + say 'No values only appear once'; + } + else { + say 'More than one value appears once'; + } +} + +main(@ARGV); \ No newline at end of file diff --git a/challenge-283/sgreen/perl/ch-2.pl b/challenge-283/sgreen/perl/ch-2.pl new file mode 100755 index 0000000000..709644de65 --- /dev/null +++ b/challenge-283/sgreen/perl/ch-2.pl @@ -0,0 +1,28 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use feature 'say'; +use experimental 'signatures'; + +sub main (@ints) { + # Calculate the frequency of each integer + my %freq = (); + foreach my $int (@ints) { + $freq{$int}++; + } + + while ( my ( $idx, $value ) = each(@ints) ) { + # Check the index only appear value number of times + if ( ( $freq{$idx} // 0 ) != $value ) { + say 'false'; + return; + } + } + + # Checks pass + say 'true'; + +} + +main(@ARGV); \ No newline at end of file diff --git a/challenge-283/sgreen/python/ch-1.py b/challenge-283/sgreen/python/ch-1.py new file mode 100755 index 0000000000..7f5ed66cd7 --- /dev/null +++ b/challenge-283/sgreen/python/ch-1.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 + +from collections import Counter +import sys + + +def unique_number(ints: list) -> int: + # Calculate the frequency of each integer + freq = Counter(ints) + + # Get the integers that appear only once + only_once = [i for i in freq if freq[i] == 1] + + if len(only_once) == 1: + return only_once[0] + + if len(only_once) == 0: + raise ValueError('No values only appear once') + + raise ValueError('More than one value appears once') + + +def main(): + # Convert input into integers + array = [int(n) for n in sys.argv[1:]] + result = unique_number(array) + print(result) + + +if __name__ == '__main__': + main() diff --git a/challenge-283/sgreen/python/ch-2.py b/challenge-283/sgreen/python/ch-2.py new file mode 100755 index 0000000000..978ad41f6d --- /dev/null +++ b/challenge-283/sgreen/python/ch-2.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 + +from collections import Counter +import sys + + +def digit_count_value(ints: list) -> bool: + # Calculate the frequency of each integer + freq = Counter(ints) + + for idx, value in enumerate(ints): + # Check the index only appear value number of times + if freq[idx] != value: + return False + + # Checks pass + return True + + +def main(): + # Convert input into integers + array = [int(n) for n in sys.argv[1:]] + result = digit_count_value(array) + print('true' if result else 'false') + + +if __name__ == '__main__': + main() diff --git a/challenge-283/sgreen/python/test.py b/challenge-283/sgreen/python/test.py new file mode 100755 index 0000000000..9073c9d954 --- /dev/null +++ b/challenge-283/sgreen/python/test.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 + +import unittest +ch_1 = __import__('ch-1') +ch_2 = __import__('ch-2') + + +class TestClass(unittest.TestCase): + def test_ch_1(self): + self.assertEqual(ch_1.unique_number([3, 3, 1]), 1) + self.assertEqual(ch_1.unique_number([3, 2, 4, 2, 4]), 3) + self.assertEqual(ch_1.unique_number([1]), 1) + self.assertEqual(ch_1.unique_number([4, 3, 1, 1, 1, 4]), 3) + + def test_ch_2(self): + self.assertTrue(ch_2.digit_count_value([1, 2, 1, 0])) + self.assertFalse(ch_2.digit_count_value([0, 3, 0])) + + +if __name__ == '__main__': + unittest.main() -- cgit From cfb7f3b892498401d646b71549523f9851d1c669 Mon Sep 17 00:00:00 2001 From: Michael Manring Date: Mon, 26 Aug 2024 15:06:02 +1000 Subject: pwc284 solution in python --- challenge-284/pokgopun/python/ch-1.py | 52 ++++++++++++++++++++++++++++ challenge-284/pokgopun/python/ch-2.py | 65 +++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 challenge-284/pokgopun/python/ch-1.py create mode 100644 challenge-284/pokgopun/python/ch-2.py diff --git a/challenge-284/pokgopun/python/ch-1.py b/challenge-284/pokgopun/python/ch-1.py new file mode 100644 index 0000000000..61bbde927e --- /dev/null +++ b/challenge-284/pokgopun/python/ch-1.py @@ -0,0 +1,52 @@ +### https://theweeklychallenge.org/blog/perl-weekly-challenge-284/ +""" + +Task 1: Lucky Integer + +Submitted by: [40]Mohammad Sajid Anwar + __________________________________________________________________ + + You are given an array of integers, @ints. + + Write a script to find the lucky integer if found otherwise return -1. + If there are more than one then return the largest. + + A lucky integer is an integer that has a frequency in the array + equal to its value. + +Example 1 + +Input: @ints = (2, 2, 3, 4) +Output: 2 + +Example 2 + +Input: @ints = (1, 2, 2, 3, 3, 3) +Output: 3 + +Example 3 + +Input: @ints = (1, 1, 1, 3) +Output: -1 + +Task 2: Relative Sort +""" +### solution by pokgopun@gmail.com + +def li(ints: tuple): + return max( + e if e==ints.count(e) else -1 for e in ints + ) + +import unittest + +class TestLi(unittest.TestCase): + def test(self): + for inpt, otpt in { + (2, 2, 3, 4): 2, + (1, 2, 2, 3, 3, 3): 3, + (1, 1, 1, 3): -1, + }.items(): + self.assertEqual(li(inpt),otpt) + +unittest.main() diff --git a/challenge-284/pokgopun/python/ch-2.py b/challenge-284/pokgopun/python/ch-2.py new file mode 100644 index 0000000000..e686014180 --- /dev/null +++ b/challenge-284/pokgopun/python/ch-2.py @@ -0,0 +1,65 @@ +### https://theweeklychallenge.org/blog/perl-weekly-challenge-284/ +""" + +Task 2: Relative Sort + +Submitted by: [41]Mohammad Sajid Anwar + __________________________________________________________________ + + You are given two list of integers, @list1 and @list2. The elements in + the @list2 are distinct and also in the @list1. + + Write a script to sort the elements in the @list1 such that the + relative order of items in @list1 is same as in the @list2. Elements + that is missing in @list2 should be placed at the end of @list1 in + ascending order. + +Example 1 + +Input: @list1 = (2, 3, 9, 3, 1, 4, 6, 7, 2, 8, 5) + @list2 = (2, 1, 4, 3, 5, 6) +Ouput: (2, 2, 1, 4, 3, 3, 5, 6, 7, 8, 9) + +Example 2 + +Input: @list1 = (3, 3, 4, 6, 2, 4, 2, 1, 3) + @list2 = (1, 3, 2) +Ouput: (1, 3, 3, 3, 2, 2, 4, 4, 6) + +Example 3 + +Input: @list1 = (3, 0, 5, 0, 2, 1, 4, 1, 1) + @list2 = (1, 0, 3, 2) +Ouput: (1, 1, 1, 0, 0, 3, 2, 4, 5) + __________________________________________________________________ + + Last date to submit the solution 23:59 (UK Time) Sunday 1st September + 2024. + __________________________________________________________________ + +SO WHAT DO YOU THINK ? +""" +### solution by pokgopun@gmail.com + +def rs(ints1, ints2): + dct = dict() + l = len(ints2) + for i in range(l): + dct[ints2[i]] = i + mn = min(set(ints1).difference(set(ints2))) + return tuple( + sorted(ints1,key=lambda x: dct.get(x, l+x-mn)) + ) + +import unittest + +class TestRs(unittest.TestCase): + def test(self): + for (ints1,ints2), ints in { + ((2, 3, 9, 3, 1, 4, 6, 7, 2, 8, 5), (2, 1, 4, 3, 5, 6)): (2, 2, 1, 4, 3, 3, 5, 6, 7, 8, 9), + ((3, 3, 4, 6, 2, 4, 2, 1, 3), (1, 3, 2)): (1, 3, 3, 3, 2, 2, 4, 4, 6), + ((3, 0, 5, 0, 2, 1, 4, 1, 1), (1, 0, 3, 2)): (1, 1, 1, 0, 0, 3, 2, 4, 5), + }.items(): + self.assertEqual(rs(ints1,ints2),ints) + +unittest.main() -- cgit From a40dac93f845522904666a1e9d8215d0444a3807 Mon Sep 17 00:00:00 2001 From: Michael Manring Date: Mon, 26 Aug 2024 17:45:08 +1000 Subject: pwc284 solution in go --- challenge-284/pokgopun/go/ch-1.go | 72 +++++++++++++++++++++++++++++ challenge-284/pokgopun/go/ch-2.go | 97 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 challenge-284/pokgopun/go/ch-1.go create mode 100644 challenge-284/pokgopun/go/ch-2.go diff --git a/challenge-284/pokgopun/go/ch-1.go b/challenge-284/pokgopun/go/ch-1.go new file mode 100644 index 0000000000..bd728ae2c0 --- /dev/null +++ b/challenge-284/pokgopun/go/ch-1.go @@ -0,0 +1,72 @@ +//# https://theweeklychallenge.org/blog/perl-weekly-challenge-284/ +/*# + +Task 1: Lucky Integer + +Submitted by: [40]Mohammad Sajid Anwar + __________________________________________________________________ + + You are given an array of integers, @ints. + + Write a script to find the lucky integer if found otherwise return -1. + If there are more than one then return the largest. + + A lucky integer is an integer that has a frequency in the array + equal to its value. + +Example 1 + +Input: @ints = (2, 2, 3, 4) +Output: 2 + +Example 2 + +Input: @ints = (1, 2, 2, 3, 3, 3) +Output: 3 + +Example 3 + +Input: @ints = (1, 1, 1, 3) +Output: -1 + +Task 2: Relative Sort +#*/ +//# solution by pokgopun@gmail.com + +package main + +import ( + "io" + "os" + + "github.com/google/go-cmp/cmp" +) + +type ints []int + +func (is ints) lckI() int { + m := make(map[int]int) + for _, v := range is { + m[v]++ + } + r := -1 + for k, v := range m { + if k == v { + r = max(r, k) + } + } + return r +} + +func main() { + for _, data := range []struct { + input ints + output int + }{ + {ints{2, 2, 3, 4}, 2}, + {ints{1, 2, 2, 3, 3, 3}, 3}, + {ints{1, 1, 1, 3}, -1}, + } { + io.WriteString(os.Stdout, cmp.Diff(data.input.lckI(), data.output)) // blank if ok, otherwise show the difference + } +} diff --git a/challenge-284/pokgopun/go/ch-2.go b/challenge-284/pokgopun/go/ch-2.go new file mode 100644 index 0000000000..6197bb2696 --- /dev/null +++ b/challenge-284/pokgopun/go/ch-2.go @@ -0,0 +1,97 @@ +//# https://theweeklychallenge.org/blog/perl-weekly-challenge-284/ +/*# + +Task 2: Relative Sort + +Submitted by: [41]Mohammad Sajid Anwar + __________________________________________________________________ + + You are given two list of integers, @list1 and @list2. The elements in + the @list2 are distinct and also in the @list1. + + Write a script to sort the elements in the @list1 such that the + relative order of items in @list1 is same as in the @list2. Elements + that is missing in @list2 should be placed at the end of @list1 in + ascending order. + +Example 1 + +Input: @list1 = (2, 3, 9, 3, 1, 4, 6, 7, 2, 8, 5) + @list2 = (2, 1, 4, 3, 5, 6) +Ouput: (2, 2, 1, 4, 3, 3, 5, 6, 7, 8, 9) + +Example 2 + +Input: @list1 = (3, 3, 4, 6, 2, 4, 2, 1, 3) + @list2 = (1, 3, 2) +Ouput: (1, 3, 3, 3, 2, 2, 4, 4, 6) + +Example 3 + +Input: @list1 = (3, 0, 5, 0, 2, 1, 4, 1, 1) + @list2 = (1, 0, 3, 2) +Ouput: (1, 1, 1, 0, 0, 3, 2, 4, 5) + __________________________________________________________________ + + Last date to submit the solution 23:59 (UK Time) Sunday 1st September + 2024. + __________________________________________________________________ + +SO WHAT DO YOU THINK ? +#*/ +//# solution by pokgopun@gmail.com + +package main + +import ( + "cmp" + "io" + "os" + "slices" + + gcmp "github.com/google/go-cmp/cmp" +) + +type ints []int + +func (is ints) breakDiff(is2 ints) (r1, r2 ints) { + m := make(map[int]bool) + for _, v := range is2 { + if !m[v] { + m[v] = true + } + } + for _, v := range is { + if m[v] { + r1 = append(r1, v) + } else { + r2 = append(r2, v) + } + } + return r1, r2 +} + +func (is ints) rs(is2 ints) ints { + m := make(map[int]int) + for i, v := range is2 { + m[v] = i + } + r1, r2 := is.breakDiff(is2) + slices.SortFunc(r1, func(a, b int) int { + return cmp.Compare(m[a], m[b]) + }) + slices.Sort(r2) + return append(r1, r2...) +} + +func main() { + for _, data := range []struct { + ints1, ints2, output ints + }{ + {ints{2, 3, 9, 3, 1, 4, 6, 7, 2, 8, 5}, ints{2, 1, 4, 3, 5, 6}, ints{2, 2, 1, 4, 3, 3, 5, 6, 7, 8, 9}}, + {ints{3, 3, 4, 6, 2, 4, 2, 1, 3}, ints{1, 3, 2}, ints{1, 3, 3, 3, 2, 2, 4, 4, 6}}, + {ints{3, 0, 5, 0, 2, 1, 4, 1, 1}, ints{1, 0, 3, 2}, ints{1, 1, 1, 0, 0, 3, 2, 4, 5}}, + } { + io.WriteString(os.Stdout, gcmp.Diff(data.ints1.rs(data.ints2), data.output)) // blank if ok, otherwise show the difference + } +} -- cgit From 6ad8221654117a59ed52986f88e2574c692948b5 Mon Sep 17 00:00:00 2001 From: Niels van Dijke Date: Mon, 26 Aug 2024 09:20:02 +0000 Subject: w284 - Task 1 & 2 --- challenge-284/perlboy1967/perl/ch1.pl | 41 +++++++++++++++++++++++++++++ challenge-284/perlboy1967/perl/ch2.pl | 49 +++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100755 challenge-284/perlboy1967/perl/ch1.pl create mode 100755 challenge-284/perlboy1967/perl/ch2.pl diff --git a/challenge-284/perlboy1967/perl/ch1.pl b/challenge-284/perlboy1967/perl/ch1.pl new file mode 100755 index 0000000000..c0b5b28105 --- /dev/null +++ b/challenge-284/perlboy1967/perl/ch1.pl @@ -0,0 +1,41 @@ +#!/bin/perl + +=pod + +The Weekly Challenge - 284 +- L + +Author: Niels 'PerlBoy' van Dijke + +Task 1: Lucky Integer +Submitted by: Mohammad Sajid Anwar + +You are given an array of integers, @ints. + +Write a script to find the lucky integer if found otherwise return -1. If there are more +than one then return the largest. + +|| A lucky integer is an integer that has a frequency in the array equal to its value. + +=cut + +use v5.32; +use feature qw(signatures); +no warnings qw(experimental::signatures); +use common::sense; + +use Test2::V0 qw(-no_srand); + +use List::Util qw(max); + +sub luckyInteger (@ints) { + my %f; $f{$_}++ for (@ints); + my @l = (-1,grep { $f{$_} == $_ } keys %f); + max(@l); +} + +is(luckyInteger(2,2,3,4),2,'Example 1'); +is(luckyInteger(1,2,2,3,3,3),3,'Example 2'); +is(luckyInteger(1,1,1,3),-1,'Example 3'); + +done_testing; diff --git a/challenge-284/perlboy1967/perl/ch2.pl b/challenge-284/perlboy1967/perl/ch2.pl new file mode 100755 index 0000000000..0a28f39c23 --- /dev/null +++ b/challenge-284/perlboy1967/perl/ch2.pl @@ -0,0 +1,49 @@ +#!/bin/perl + +=pod + +The Weekly Challenge - 284 +- L + +Author: Niels 'PerlBoy' van Dijke + +Task 2: Relative Sort +Submitted by: Mohammad Sajid Anwar + +You are given two list of integers, @list1 and @list2. The elements in the @list2 are +distinct and also in the @list1. + +Write a script to sort the elements in the @list1 such that the relative order of items +in @list1 is same as in the @list2. Elements that is missing in @list2 should be placed +at the end of @list1 in ascending order. + +=cut + +use v5.32; +use feature qw(signatures); +no warnings qw(experimental::signatures); +use common::sense; + +use Test2::V0 qw(-no_srand); + +use List::MoreUtils qw(indexes); + +sub relativeSort :prototype(\@\@) ($arL1,$arL2) { + my @r; + my @l = @$arL1; + for my $l2 (@$arL2) { + push(@r,splice(@l,$_,1)) for (reverse sort {$a <=> $b} indexes {$_ == $l2} @l); + } + push(@r,sort {$a <=> $b} @l); + [@r]; +} + +is(relativeSort(@{[2,3,9,3,1,4,6,7,2,8,5]},@{[2,1,4,3,5,6]}), + [2,2,1,4,3,3,5,6,7,8,9],'Example 1'); +is(relativeSort(@{[3,3,4,6,2,4,2,1,3]},@{[1,3,2]}), + [1,3,3,3,2,2,4,4,6],'Example 2'); +is(relativeSort(@{[3,0,5,0,2,1,4,1,1]},@{[1,0,3,2]}), + [1,1,1,0,0,3,2,4,5],'Example 3'); + +done_testing; + -- cgit From 06903ea7e4a345a61e95cfa590d7d558e1d00fc6 Mon Sep 17 00:00:00 2001 From: Niels van Dijke Date: Mon, 26 Aug 2024 09:23:03 +0000 Subject: remove "reverse" on task 2 --- challenge-284/perlboy1967/perl/ch2.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenge-284/perlboy1967/perl/ch2.pl b/challenge-284/perlboy1967/perl/ch2.pl index 0a28f39c23..2d7eee15df 100755 --- a/challenge-284/perlboy1967/perl/ch2.pl +++ b/challenge-284/perlboy1967/perl/ch2.pl @@ -32,7 +32,7 @@ sub relativeSort :prototype(\@\@) ($arL1,$arL2) { my @r; my @l = @$arL1; for my $l2 (@$arL2) { - push(@r,splice(@l,$_,1)) for (reverse sort {$a <=> $b} indexes {$_ == $l2} @l); + push(@r,splice(@l,$_,1)) for (sort {$b <=> $a} indexes {$_ == $l2} @l); } push(@r,sort {$a <=> $b} @l); [@r]; -- cgit From 9945f7086c0e3383a200f4c7578d505096705107 Mon Sep 17 00:00:00 2001 From: Niels van Dijke Date: Mon, 26 Aug 2024 09:28:01 +0000 Subject: Remove helper variable on task 1 --- challenge-284/perlboy1967/perl/ch1.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/challenge-284/perlboy1967/perl/ch1.pl b/challenge-284/perlboy1967/perl/ch1.pl index c0b5b28105..d747e83e42 100755 --- a/challenge-284/perlboy1967/perl/ch1.pl +++ b/challenge-284/perlboy1967/perl/ch1.pl @@ -30,8 +30,7 @@ use List::Util qw(max); sub luckyInteger (@ints) { my %f; $f{$_}++ for (@ints); - my @l = (-1,grep { $f{$_} == $_ } keys %f); - max(@l); + max(-1,grep { $f{$_} == $_ } keys %f); } is(luckyInteger(2,2,3,4),2,'Example 1'); -- cgit From be9df65194dde74bb7f0d9736d0336b47430bcbd Mon Sep 17 00:00:00 2001 From: Paulo Custodio Date: Mon, 26 Aug 2024 10:13:29 +0100 Subject: Whitespace --- challenge-248/paulo-custodio/perl/ch-1.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/challenge-248/paulo-custodio/perl/ch-1.pl b/challenge-248/paulo-custodio/perl/ch-1.pl index 503126e926..b99dce5818 100644 --- a/challenge-248/paulo-custodio/perl/ch-1.pl +++ b/challenge-248/paulo-custodio/perl/ch-1.pl @@ -7,7 +7,8 @@ # # You are given a string and a character in the given string. # -# Write a script to return an array of integers of size same as length of the given string such that: +# Write a script to return an array of integers of size same as length of +# the given string such that: # # distance[i] is the distance from index i to the closest occurence of # the given character in the given string. -- cgit From 7e7689b2bc6ea77f92d427c91e194caebe1d10a7 Mon Sep 17 00:00:00 2001 From: Paulo Custodio Date: Mon, 26 Aug 2024 10:51:57 +0100 Subject: Add Perl solution to challenge 284 --- challenge-248/paulo-custodio/perl/ch-1.pl | 2 +- challenge-284/paulo-custodio/Makefile | 2 ++ challenge-284/paulo-custodio/README | 1 + challenge-284/paulo-custodio/perl/ch-1.pl | 39 +++++++++++++++++++++++++ challenge-284/paulo-custodio/perl/ch-2.pl | 46 ++++++++++++++++++++++++++++++ challenge-284/paulo-custodio/t/test-1.yaml | 15 ++++++++++ challenge-284/paulo-custodio/t/test-2.yaml | 15 ++++++++++ 7 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 challenge-284/paulo-custodio/Makefile create mode 100644 challenge-284/paulo-custodio/README create mode 100644 challenge-284/paulo-custodio/perl/ch-1.pl create mode 100644 challenge-284/paulo-custodio/perl/ch-2.pl create mode 100644 challenge-284/paulo-custodio/t/test-1.yaml create mode 100644 challenge-284/paulo-custodio/t/test-2.yaml diff --git a/challenge-248/paulo-custodio/perl/ch-1.pl b/challenge-248/paulo-custodio/perl/ch-1.pl index b99dce5818..021e65777a 100644 --- a/challenge-248/paulo-custodio/perl/ch-1.pl +++ b/challenge-248/paulo-custodio/perl/ch-1.pl @@ -7,7 +7,7 @@ # # You are given a string and a character in the given string. # -# Write a script to return an array of integers of size same as length of +# Write a script to return an array of integers of size same as length of # the given string such that: # # distance[i] is the distance from index i to the closest occurence of diff --git a/challenge-284/paulo-custodio/Makefile b/challenge-284/paulo-custodio/Makefile new file mode 100644 index 0000000000..c3c762d746 --- /dev/null +++ b/challenge-284/paulo-custodio/Makefile @@ -0,0 +1,2 @@ +all: + perl ../../challenge-001/paulo-custodio/test.pl diff --git a/challenge-284/paulo-custodio/README b/challenge-284/paulo-custodio/README new file mode 100644 index 0000000000..87dc0b2fbd --- /dev/null +++ b/challenge-284/paulo-custodio/README @@ -0,0 +1 @@ +Solution by Paulo Custodio diff --git a/challenge-284/paulo-custodio/perl/ch-1.pl b/challenge-284/paulo-custodio/perl/ch-1.pl new file mode 100644 index 0000000000..09f0564364 --- /dev/null +++ b/challenge-284/paulo-custodio/perl/ch-1.pl @@ -0,0 +1,39 @@ +#!/usr/bin/env perl + +# Challenge 284 +# +# Task 1: Lucky Integer +# Submitted by: Mohammad Sajid Anwar +# +# You are given an array of integers, @ints. +# +# Write a script to find the lucky integer if found otherwise return -1. If +# there are more than one then return the largest. +# +# A lucky integer is an integer that has a frequency in the array equal to +# its value. +# +# Example 1 +# +# Input: @ints = (2, 2, 3, 4) +# Output: 2 +# +# Example 2 +# +# Input: @ints = (1, 2, 2, 3, 3, 3) +# Output: 3 +# +# Example 3 +# +# Input: @ints = (1, 1, 1, 3) +# Output: -1 + +use Modern::Perl; + +my @ints = @ARGV; +my %count; +$count{$_}++ for @ints; +my @lucky = + sort {$b <=> $a} + grep {$_ == $count{$_}} @ints; +say !@lucky ? -1 : $lucky[0]; diff --git a/challenge-284/paulo-custodio/perl/ch-2.pl b/challenge-284/paulo-custodio/perl/ch-2.pl new file mode 100644 index 0000000000..6bb9662a88 --- /dev/null +++ b/challenge-284/paulo-custodio/perl/ch-2.pl @@ -0,0 +1,46 @@ +#!/usr/bin/env perl + +# Challenge 284 +# +# Task 2: Relative Sort +# Submitted by: Mohammad Sajid Anwar +# +# You are given two list of integers, @list1 and @list2. The elements in the +# @list2 are distinct and also in the @list1. +# +# Write a script to sort the elements in the @list1 such that the relative +# order of items in @list1 is same as in the @list2. Elements that is missing +# in @list2 should be placed at the end of @list1 in ascending order. +# Example 1 +# +# Input: @list1 = (2, 3, 9, 3, 1, 4, 6, 7, 2, 8, 5) +# @list2 = (2, 1, 4, 3, 5, 6) +# Ouput: (2, 2, 1, 4, 3, 3, 5, 6, 7, 8, 9) +# +# Example 2 +# +# Input: @list1 = (3, 3, 4, 6, 2, 4, 2, 1, 3) +# @list2 = (1, 3, 2) +# Ouput: (1, 3, 3, 3, 2, 2, 4, 4, 6) +# +# Example 3 +# +# Input: @list1 = (3, 0, 5, 0, 2, 1, 4, 1, 1) +# @list2 = (1, 0, 3, 2) +# Ouput: (1, 1, 1, 0, 0, 3, 2, 4, 5) + +use Modern::Perl; +my $input = "@ARGV"; +my($list1, $list2) = split /,/, $input; +my @list1 = split ' ', $list1; +my @list2 = split ' ', $list2; + +my @output; +while (@list2) { + my $n = shift @list2; + push @output, grep {$_ == $n} @list1; + @list1 = grep {$_ != $n} @list1; +} +push @output, sort {$a <=> $b} @list1; + +say "@output"; diff --git a/challenge-284/paulo-custodio/t/test-1.yaml b/challenge-284/paulo-custodio/t/test-1.yaml new file mode 100644 index 0000000000..5feba9c238 --- /dev/null +++ b/challenge-284/paulo-custodio/t/test-1.yaml @@ -0,0 +1,15 @@ +- setup: + cleanup: + args: 2 2 3 4 + input: + output: 2 +- setup: + cleanup: + args: 1 2 2 3 3 3 + input: + output: 3 +- setup: + cleanup: + args: 1 1 1 3 + input: + output: -1 diff --git a/challenge-284/paulo-custodio/t/test-2.yaml b/challenge-284/paulo-custodio/t/test-2.yaml new file mode 100644 index 0000000000..f4d2db7f63 --- /dev/null +++ b/challenge-284/paulo-custodio/t/test-2.yaml @@ -0,0 +1,15 @@ +- setup: + cleanup: + args: 2 3 9 3 1 4 6 7 2 8 5 , 2 1 4 3 5 6 + input: + output: 2 2 1 4 3 3 5 6 7 8 9 +- setup: + cleanup: + args: 3 3 4 6 2 4 2 1 3 , 1 3 2 + input: + output: 1 3 3 3 2 2 4 4 6 +- setup: + cleanup: + args: 3 0 5 0 2 1 4 1 1 , 1 0 3 2 + input: + output: 1 1 1 0 0 3 2 4 5 -- cgit From fe6466f89808cc47db47045700c2ffced724dba9 Mon Sep 17 00:00:00 2001 From: Tymoteusz Moryto Date: Mon, 26 Aug 2024 12:13:19 +0200 Subject: added solutions to week 284 in Uiua --- challenge-284/pieviero/uiua/ch-1.ua | 4 ++++ challenge-284/pieviero/uiua/ch-2.ua | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 challenge-284/pieviero/uiua/ch-1.ua create mode 100644 challenge-284/pieviero/uiua/ch-2.ua diff --git a/challenge-284/pieviero/uiua/ch-1.ua b/challenge-284/pieviero/uiua/ch-1.ua new file mode 100644 index 0000000000..0dfc723144 --- /dev/null +++ b/challenge-284/pieviero/uiua/ch-1.ua @@ -0,0 +1,4 @@ +LuckyInteger ← ⍣(⊏⊢⊚)¯1⊸=°▽⊏⊸⍖ +LuckyInteger [2 2 3 4] +LuckyInteger [1 2 2 3 3 3] +LuckyInteger [1 1 1 3] diff --git a/challenge-284/pieviero/uiua/ch-2.ua b/challenge-284/pieviero/uiua/ch-2.ua new file mode 100644 index 0000000000..8830043994 --- /dev/null +++ b/challenge-284/pieviero/uiua/ch-2.ua @@ -0,0 +1,5 @@ +# this probably can be done better +RelativeSort ← ⊂:⊏⊸⍏⊙(⊏⍏◌⊸⍜⊂⊛:)∩▽⊙,¬.⊸∈⊸: +RelativeSort [2 3 9 3 1 4 6 7 2 8 5] [2 1 4 3 5 6] +RelativeSort [3 3 4 6 2 4 2 1 3] [1 3 2] +RelativeSort [3 0 5 0 2 1 4 1 1] [1 0 3 2] -- cgit From b702e4cb4824a9313869b6228e19bf96c27fa09a Mon Sep 17 00:00:00 2001 From: Mohammad Sajid Anwar Date: Mon, 26 Aug 2024 13:36:59 +0100 Subject: - Added solutions by Eric Cheung. - Added solutions by Simon Green. - Added solutions by PokGoPun. - Added solutions by Niels van Dijke. - Added solutions by Tymoteusz Moryto. - Added solutions by Feng Chang. --- challenge-284/eric-cheung/python/ch-1.py | 11 + challenge-284/eric-cheung/python/ch-2.py | 24 + challenge-284/perlboy1967/perl/ch-1.pl | 40 ++ challenge-284/perlboy1967/perl/ch-2.pl | 49 ++ challenge-284/perlboy1967/perl/ch1.pl | 40 -- challenge-284/perlboy1967/perl/ch2.pl | 49 -- stats/pwc-challenge-283.json | 657 +++++++++++++++++++++++++ stats/pwc-current.json | 644 ++----------------------- stats/pwc-language-breakdown-2019.json | 628 ++++++++++++------------ stats/pwc-language-breakdown-2020.json | 414 ++++++++-------- stats/pwc-language-breakdown-2021.json | 774 +++++++++++++++--------------- stats/pwc-language-breakdown-2022.json | 400 +++++++-------- stats/pwc-language-breakdown-2023.json | 774 +++++++++++++++--------------- stats/pwc-language-breakdown-2024.json | 559 ++++++++++----------- stats/pwc-language-breakdown-summary.json | 84 ++-- stats/pwc-leaders.json | 758 ++++++++++++++--------------- stats/pwc-summary-1-30.json | 36 +- stats/pwc-summary-121-150.json | 36 +- stats/pwc-summary-151-180.json | 94 ++-- stats/pwc-summary-181-210.json | 120 ++--- stats/pwc-summary-211-240.json | 104 ++-- stats/pwc-summary-241-270.json | 46 +- stats/pwc-summary-271-300.json | 50 +- stats/pwc-summary-301-330.json | 32 +- stats/pwc-summary-31-60.json | 46 +- stats/pwc-summary-61-90.json | 118 ++--- stats/pwc-summary-91-120.json | 48 +- stats/pwc-summary.json | 60 +-- stats/pwc-yearly-language-summary.json | 136 +++--- 29 files changed, 3493 insertions(+), 3338 deletions(-) create mode 100755 challenge-284/eric-cheung/python/ch-1.py create mode 100755 challenge-284/eric-cheung/python/ch-2.py create mode 100755 challenge-284/perlboy1967/perl/ch-1.pl create mode 100755 challenge-284/perlboy1967/perl/ch-2.pl delete mode 100755 challenge-284/perlboy1967/perl/ch1.pl delete mode 100755 challenge-284/perlboy1967/perl/ch2.pl create mode 100644 stats/pwc-challenge-283.json diff --git a/challenge-284/eric-cheung/python/ch-1.py b/challenge-284/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..a692fad3bf --- /dev/null +++ b/challenge-284/eric-cheung/python/ch-1.py @@ -0,0 +1,11 @@ + +## arrInts = [2, 2, 3, 4] ## Example 1 +## arrInts = [1, 2, 2, 3, 3, 3] ## Example 2 +arrInts = [1, 1, 1, 3] ## Example 3 + +arrLucky = [nLoop for nLoop in set(arrInts) if arrInts.count(nLoop) == nLoop] + +if len(arrLucky) == 0: + print (-1) +else: + print (max(arrLucky)) diff --git a/challenge-284/eric-cheung/python/ch-2.py b/challenge-284/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..9230393f83 --- /dev/null +++ b/challenge-284/eric-cheung/python/ch-2.py @@ -0,0 +1,24 @@ + +## Example 1 +## arrList_01 = [2, 3, 9, 3, 1, 4, 6, 7, 2, 8, 5] +## arrList_02 = [2, 1, 4, 3, 5, 6] + +## Example 2 +## arrList_01 = [3, 3, 4, 6, 2, 4, 2, 1, 3] +## arrList_02 = [1, 3, 2] + +## Example 3 +arrList_01 = [3, 0, 5, 0, 2, 1, 4, 1, 1] +arrList_02 = [1, 0, 3, 2] + +arrOutput = [] + +## Contain +for nLoop in arrList_02: + arrOutput = arrOutput + [nLoop] * arrList_01.count(nLoop) + +## Miss +for nLoop in [rLoop for rLoop in set(arrList_01) if rLoop not in arrList_02]: + arrOutput = arrOutput + [nLoop] * arrList_01.count(nLoop) + +print (arrOutput) diff --git a/challenge-284/perlboy1967/perl/ch-1.pl b/challenge-284/perlboy1967/perl/ch-1.pl new file mode 100755 index 0000000000..d747e83e42 --- /dev/null +++ b/challenge-284/perlboy1967/perl/ch-1.pl @@ -0,0 +1,40 @@ +#!/bin/perl + +=pod + +The Weekly Challenge - 284 +- L + +Author: Niels 'PerlBoy' van Dijke + +Task 1: Lucky Integer +Submitted by: Mohammad Sajid Anwar + +You are given an array of integers, @ints. + +Write a script to find the lucky integer if found otherwise return -1. If there are more +than one then return the largest. + +|| A lucky integer is an integer that has a frequency in the array equal to its value. + +=cut + +use v5.32; +use feature qw(signatures); +no warnings qw(experimental::signatures); +use common::sense; + +use Test2::V0 qw(-no_srand); + +use List::Util qw(max); + +sub luckyInteger (@ints) { + my %f; $f{$_}++ for (@ints); + max(-1,grep { $f{$_} == $_ } keys %f); +} + +is(luckyInteger(2,2,3,4),2,'Example 1'); +is(luckyInteger(1,2,2,3,3,3),3,'Example 2'); +is(luckyInteger(1,1,1,3),-1,'Example 3'); + +done_testing; diff --git a/challenge-284/perlboy1967/perl/ch-2.pl b/challenge-284/perlboy1967/perl/ch-2.pl new file mode 100755 index 0000000000..2d7eee15df --- /dev/null +++ b/challenge-284/perlboy1967/perl/ch-2.pl @@ -0,0 +1,49 @@ +#!/bin/perl + +=pod + +The Weekly Challenge - 284 +- L + +Author: Niels 'PerlBoy' van Dijke + +Task 2: Relative Sort +Submitted by: Mohammad Sajid Anwar + +You are given two list of integers, @list1 and @list2. The elements in the @list2 are +distinct and also in the @list1. + +Write a script to sort the elements in the @list1 such that the relative order of items +in @list1 is same as in the @list2. Elements that is missing in @list2 should be placed +at the end of @list1 in ascending order. + +=cut + +use v5.32; +use feature qw(signatures); +no warnings qw(experimental::signatures); +use common::sense; + +use Test2::V0 qw(-no_srand); + +use List::MoreUtils qw(indexes); + +sub relativeSort :prototype(\@\@) ($arL1,$arL2) { + my @r; + my @l = @$arL1; + for my $l2 (@$arL2) { + push(@r,splice(@l,$_,1)) for (sort {$b <=> $a} indexes {$_ == $l2} @l); + } + push(@r,sort {$a <=> $b} @l); + [@r]; +} + +is(relativeSort(@{[2,3,9,3,1,4,6,7,2,8,5]},@{[2,1,4,3,5,6]}), + [2,2,1,4,3,3,5,6,7,8,9],'Example 1'); +is(relativeSort(@{[3,3,4,6,2,4,2,1,3]},@{[1,3,2]}), + [1,3,3,3,2,2,4,4,6],'Example 2'); +is(relativeSort(@{[3,0,5,0,2,1,4,1,1]},@{[1,0,3,2]}), + [1,1,1,0,0,3,2,4,5],'Example 3'); + +done_testing; + diff --git a/challenge-284/perlboy1967/perl/ch1.pl b/challenge-284/perlboy1967/perl/ch1.pl deleted file mode 100755 index d747e83e42..0000000000 --- a/challenge-284/perlboy1967/perl/ch1.pl +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/perl - -=pod - -The Weekly Challenge - 284 -- L - -Author: Niels 'PerlBoy' van Dijke - -Task 1: Lucky Integer -Submitted by: Mohammad Sajid Anwar - -You are given an array of integers, @ints. - -Write a script to find the lucky integer if found otherwise return -1. If there are more -than one then return the largest. - -|| A lucky integer is an integer that has a frequency in the array equal to its value. - -=cut - -use v5.32; -use feature qw(signatures); -no warnings qw(experimental::signatures); -use common::sense; - -use Test2::V0 qw(-no_srand); - -use List::Util qw(max); - -sub luckyInteger (@ints) { - my %f; $f{$_}++ for (@ints); - max(-1,grep { $f{$_} == $_ } keys %f); -} - -is(luckyInteger(2,2,3,4),2,'Example 1'); -is(luckyInteger(1,2,2,3,3,3),3,'Example 2'); -is(luckyInteger(1,1,1,3),-1,'Example 3'); - -done_testing; diff --git a/challenge-284/perlboy1967/perl/ch2.pl b/challenge-284/perlboy1967/perl/ch2.pl deleted file mode 100755 index 2d7eee15df..0000000000 --- a/challenge-284/perlboy1967/perl/ch2.pl +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/perl - -=pod - -The Weekly Challenge - 284 -- L - -Author: Niels 'PerlBoy' van Dijke - -Task 2: Relative Sort -Submitted by: Mohammad Sajid Anwar - -You are given two list of integers, @list1 and @list2. The elements in the @list2 are -distinct and also in the @list1. - -Write a script to sort the elements in the @list1 such that the relative order of items -in @list1 is same as in the @list2. Elements that is missing in @list2 should be placed -at the end of @list1 in ascending order. - -=cut - -use v5.32; -use feature qw(signatures); -no warnings qw(experimental::signatures); -use common::sense; - -use Test2::V0 qw(-no_srand); - -use List::MoreUtils qw(indexes); - -sub relativeSort :prototype(\@\@) ($arL1,$arL2) { - my @r; - my @l = @$arL1; - for my $l2 (@$arL2) { - push(@r,splice(@l,$_,1)) for (sort {$b <=> $a} indexes {$_ == $l2} @l); - } - push(@r,sort {$a <=> $b} @l); - [@r]; -} - -is(relativeSort(@{[2,3,9,3,1,4,6,7,2,8,5]},@{[2,1,4,3,5,6]}), - [2,2,1,4,3,3,5,6,7,8,9],'Example 1'); -is(relativeSort(@{[3,3,4,6,2,4,2,1,3]},@{[1,3,2]}), - [1,3,3,3,2,2,4,4,6],'Example 2'); -is(relativeSort(@{[3,0,5,0,2,1,4,1,1]},@{[1,0,3,2]}), - [1,1,1,0,0,3,2,4,5],'Example 3'); - -done_testing; - diff --git a/stats/pwc-challenge-283.json b/stats/pwc-challenge-283.json new file mode 100644 index 0000000000..83999b9db6 --- /dev/null +++ b/stats/pwc-challenge-283.json @@ -0,0 +1,657 @@ +{ + "subtitle" : { + "text" : "[Champions: 35] Last updated at 2024-08-26 12:36:28 GMT" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + } + } + }, + "tooltip" : { + "followPointer" : 1, + "pointFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "{series.name}
" + }, + "drilldown" : { + "series" : [ + { + "id" : "Ali Moradi", + "name" : "Ali Moradi", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "name" : "Andrew Schneider", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Andrew Schneider" + }, + { + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Arne Sommer", + "id" : "Arne Sommer" + }, + { + "name" : "Athanasius", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "id" : "Athanasius" + }, + { + "data" : [ + [ + "Raku", + 1 + ] + ], + "name" : "BarrOff", + "id" : "BarrOff" + }, + { + "id" : "Bob Lied", + "name" : "Bob Lied", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Cheok-Yin Fung", + "id" : "Cheok-Yin Fung" + }, + { + "id" : "Dave Jacoby", + "name" : "Dave Jacoby", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "id" : "David Ferrone", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "David Ferrone" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "E. Choroba", + "id" : "E. Choroba" + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "name" : "Feng Chang", + "id" : "Feng Chang" + }, + { + "name" : "Jaldhar H. Vyas", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Jaldhar H. Vyas" + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "name" : "Jan Krnavek", + "id" : "Jan Krnavek" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Jorg Sommrey", + "id" : "Jorg Sommrey" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Kjetil Skotheim", + "id" : "Kjetil Skotheim" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ], + "name" : "Laurent Rosenfeld", + "id" : "Laurent Rosenfeld" + }, + { + "id" : "Mariano Ortega", + "name" : "Mariano Ortega", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "name" : "Mark Anderson", + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Mark Anderson" + }, + { + "name" : "Matthew Neleigh", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Matthew Neleigh" + }, + { + "name" : "Matthias Muth", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Matthias Muth" + }, + { + "id" : "Nelo Tovar", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Nelo Tovar" + }, + { + "id" : "Niels van Dijke", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Niels van Dijke" + }, + { + "id" : "Packy Anderson", + "name" : "Packy Anderson", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "id" : "Paulo Custodio", + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Paulo Custodio" + }, + { + "id" : "Peter Campbell Smith", + "name" : "Peter Campbell Smith", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "id" : "Peter Meszaros", + "name" : "Peter Meszaros", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "id" : "Reinier Maliepaard", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Reinier Maliepaard" + }, + { + "id" : "Robbie Hatley", + "name" : "Robbie Hatley", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "id" : "Robert Ransbottom", + "name" : "Robert Ransbottom", + "data" : [ + [ + "Raku", + 2 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Roger Bell_West", + "id" : "Roger Bell_West" + }, + { + "name" : "Simon Green", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Simon Green" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 2 + ] + ], + "name" : "Thomas Kohler", + "id" : "Thomas Kohler" + }, + { + "name" : "Ulrich Rieke", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "id" : "Ulrich Rieke" + }, + { + "id" : "W. Luis Mochan", + "name" : "W. Luis Mochan", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "name" : "Wanderdoc", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Wanderdoc" + } + ] + }, + "series" : [ + { + "name" : "The Weekly Challenge - 283", + "data" : [ + { + "drilldown" : "Ali Moradi", + "y" : 5, + "name" : "Ali Moradi" + }, + { + "name" : "Andrew Schneider", + "y" : 2, + "drilldown" : "Andrew Schneider" + }, + { + "y" : 3, + "drilldown" : "Arne Sommer", + "name" : "Arne Sommer" + }, + { + "name" : "Athanasius", + "y" : 4, + "drilldown" : "Athanasius" + }, + { + "name" : "BarrOff", + "y" : 1, + "drilldown" : "BarrOff" + }, + { + "y" : 2, + "drilldown" : "Bob Lied", + "name" : "Bob Lied" + }, + { + "name" : "Cheok-Yin Fung", + "drilldown" : "Cheok-Yin Fung", + "y" : 2 + }, + { + "drilldown" : "Dave Jacoby", + "y" : 2, + "name" : "Dave Jacoby" + }, + { + "name" : "David Ferrone", + "drilldown" : "David Ferrone", + "y" : 2 + }, + { + "name" : "E. Choroba", + "drilldown" : "E. Choroba", + "y" : 2 + }, + { + "y" : 2, + "drilldown" : "Feng Chang", + "name" : "Feng Chang" + }, + { + "drilldown" : "Jaldhar H. Vyas", + "y" : 5, + "name" : "Jaldhar H. Vyas" + }, + { + "y" : 2, + "drilldown" : "Jan Krnavek", + "name" : "Jan Krnavek" + }, + { + "y" : 3, + "drilldown" : "Jorg Sommrey", + "name" : "Jorg Sommrey" + }, + { + "y" : 2, + "drilldown" : "Kjetil Skotheim", + "name" : "Kjetil Skotheim" + }, + { + "drilldown" : "Laurent Rosenfeld", + "y" : 6, + "name" : "Laurent Rosenfeld" + }, + { + "name" : "Mariano Ortega", + "drilldown" : "Mariano Ortega", + "y" : 2 + }, + { + "name" : "Mark Anderson", + "y" : 2, + "drilldown" : "Mark Anderson" + }, + { + "y" : 2, + "drilldown" : "Matthew Neleigh", + "name" : "Matthew Neleigh" + }, + { + "name" : "Matthias Muth", + "y" : 3, + "drilldown" : "Matthias Muth" + }, + { + "drilldown" : "Nelo Tovar", + "y" : 2, + "name" : "Nelo Tovar" + }, + { + "name" : "Niels van Dijke", + "drilldown" : "Niels van Dijke", + "y" : 2 + }, + { + "y" : 5, + "drilldown" : "Packy Anderson", + "name" : "Packy Anderson" + }, + { + "name" : "Paulo Custodio", + "y" : 2, + "drilldown" : "Paulo Custodio" + }, + { + "drilldown" : "Peter Campbell Smith", + "y" : 3, + "name" : "Peter Campbell Smith" + }, + { + "drilldown" : "Peter Meszaros", + "y" : 2, + "name" : "Peter Meszaros" + }, + { + "name" : "Reinier Maliepaard", + "drilldown" : "Reinier Maliepaard", + "y" : 3 + }, + { + "name" : "Robbie Hatley", + "y" : 3, + "drilldown" : "Robbie Hatley" + }, + { + "name" : "Robert Ransbottom", + "y" : 2, + "drilldown" : "Robert Ransbottom" + }, + { + "name" : "Roger Bell_West", + "drilldown" : "Roger Bell_West", + "y" : 5 + }, + { + "y" : 3, + "drilldown" : "Simon Green", + "name" : "Simon Green" + }, + { + "y" : 4, + "drilldown" : "Thomas Kohler", + "name" : "Thomas Kohler" + }, + { + "y" : 4, + "drilldown" : "Ulrich Rieke", + "name" : "Ulrich Rieke" + }, + { + "name" : "W. Luis Mochan", + "y" : 3, + "drilldown" : "W. Luis Mochan" + }, + { + "name" : "Wanderdoc", + "drilldown" : "Wanderdoc", + "y" : 2 + } + ], + "colorByPoint" : 1 + } + ], + "legend" : { + "enabled" : 0 + }, + "title" : { + "text" : "The Weekly Challenge - 283" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "chart" : { + "type" : "column" + }, + "xAxis" : { + "type" : "category" + } +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 8186e854ec..b248e1e17c 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,638 +1,78 @@ { - "xAxis" : { - "type" : "category" + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + } + } + }, + "subtitle" : { + "text" : "[Champions: 2] Last updated at 2024-08-26 12:36:39 GMT" + }, + "series" : [ + { + "name" : "The Weekly Challenge - 284", + "data" : [ + { + "y" : 2, + "name" : "Feng Chang", + "drilldown" : "Feng Chang" + }, + { + "y" : 2, + "name" : "Niels van Dijke", + "drilldown" : "Niels van Dijke" + } + ], + "colorByPoint" : 1 + } + ], + "chart" : { + "type" : "column" + }, + "tooltip" : { + "pointFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "{series.name}
", + "followPointer" : 1 }, "drilldown" : { "series" : [ { - "id" : "Ali Moradi", - "name" : "Ali Moradi", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "name" : "Andrew Schneider", - "id" : "Andrew Schneider", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "name" : "Arne Sommer", - "id" : "Arne Sommer", - "data" : [ - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "name" : "Athanasius", - "id" : "Athanasius", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ] - }, - { - "data" : [ - [ - "Raku", - 1 - ] - ], - "name" : "BarrOff", - "id" : "BarrOff" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Bob Lied", - "name" : "Bob Lied" - }, - { - "name" : "Cheok-Yin Fung", - "id" : "Cheok-Yin Fung", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Dave Jacoby", - "name" : "Dave Jacoby" - }, - { - "name" : "David Ferrone", - "id" : "David Ferrone", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "E. Choroba", - "name" : "E. Choroba" - }, - { - "data" : [ - [ - "Raku", - 2 - ] - ], + "id" : "Feng Chang", "name" : "Feng Chang", - "id" : "Feng Chang" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Jaldhar H. Vyas", - "name" : "Jaldhar H. Vyas" - }, - { "data" : [ [ "Raku", 2 ] - ], - "id" : "Jan Krnavek", - "name" : "Jan Krnavek" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "name" : "Jorg Sommrey", - "id" : "Jorg Sommrey" - }, - { - "id" : "Kjetil Skotheim", - "name" : "Kjetil Skotheim", - "data" : [ - [ - "Perl", - 2 - ] ] }, { - "id" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 2 - ] - ] - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Mariano Ortega", - "name" : "Mariano Ortega" - }, - { - "id" : "Mark Anderson", - "name" : "Mark Anderson", - "data" : [ - [ - "Raku", - 2 - ] - ] - }, - { - "name" : "Matthew Neleigh", - "id" : "Matthew Neleigh", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "name" : "Matthias Muth", - "id" : "Matthias Muth", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Nelo Tovar", - "name" : "Nelo Tovar" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], "id" : "Niels van Dijke", - "name" : "Niels van Dijke" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "name" : "Packy Anderson", - "id" : "Packy Anderson" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Paulo Custodio", - "name" : "Paulo Custodio" - }, - { - "name" : "Peter Campbell Smith", - "id" : "Peter Campbell Smith", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "name" : "Peter Meszaros", - "id" : "Peter Meszaros", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Reinier Maliepaard", - "name" : "Reinier Maliepaard" - }, - { - "name" : "Robbie Hatley", - "id" : "Robbie Hatley", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "id" : "Robert Ransbottom", - "name" : "Robert Ransbottom", - "data" : [ - [ - "Raku", - 2 - ] - ] - }, - { - "id" : "Roger Bell_West", - "name" : "Roger Bell_West", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "id" : "Thomas Kohler", - "name" : "Thomas Kohler", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 2 - ] - ] - }, - { "data" : [ [ "Perl", 2 - ], - [ - "Raku", - 2 ] ], - "id" : "Ulrich Rieke", - "name" : "Ulrich Rieke" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "W. Luis Mochan", - "name" : "W. Luis Mochan" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "name" : "Wanderdoc", - "id" : "Wanderdoc" + "name" : "Niels van Dijke" } ] }, - "chart" : { - "type" : "column" - }, "legend" : { "enabled" : 0 }, - "series" : [ - { - "data" : [ - { - "name" : "Ali Moradi", - "drilldown" : "Ali Moradi", - "y" : 5 - }, - { - "y" : 2, - "drilldown" : "Andrew Schneider", - "name" : "Andrew Schneider" - }, - { - "drilldown" : "Arne Sommer", - "name" : "Arne Sommer", - "y" : 3 - }, - { - "y" : 4, - "name" : "Athanasius", -