aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2024-05-14 14:25:40 +0100
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2024-05-14 14:25:40 +0100
commitb7b89632947bf2c7f64b981a96a7e23b36d7f9bd (patch)
treea7870717f945f97f056e0b7225e15121ab8346b1
parent3cf0a1b043c8f6c098e57675cacc11d3210df8c2 (diff)
downloadperlweeklychallenge-club-b7b89632947bf2c7f64b981a96a7e23b36d7f9bd.tar.gz
perlweeklychallenge-club-b7b89632947bf2c7f64b981a96a7e23b36d7f9bd.tar.bz2
perlweeklychallenge-club-b7b89632947bf2c7f64b981a96a7e23b36d7f9bd.zip
- Added solutions by Eric Cheung.
- Added solutions by Ulrich Rieke. - Added solutions by Laurent Rosenfeld. - Added solutions by E. Choroba. - Added solutions by Mark Anderson. - Added solutions by Feng Chang. - Added solutions by PokGoPun. - Added solutions by Peter Campbell Smith. - Added solutions by Peter Meszaros. - Added solutions by W. Luis Mochan. - Added solutions by David Ferrone. - Added solutions by Niels van Dijke. - Added solutions by Arne Sommer. - Added solutions by Dave Jacoby. - Added solutions by Robbie Hatley. - Added solutions by Lubos Kolouch. - Added solutions by Asher Harvey-Smith.
-rwxr-xr-xchallenge-269/eric-cheung/python/ch-1.py29
-rwxr-xr-xchallenge-269/eric-cheung/python/ch-2.py15
-rw-r--r--challenge-269/laurent-rosenfeld/blog.txt1
-rw-r--r--challenge-269/laurent-rosenfeld/blog1.txt1
-rw-r--r--challenge-269/laurent-rosenfeld/perl/ch-1.pl14
-rw-r--r--challenge-269/laurent-rosenfeld/perl/ch-2.pl21
-rw-r--r--challenge-269/laurent-rosenfeld/raku/ch-1.raku10
-rw-r--r--challenge-269/laurent-rosenfeld/raku/ch-2.raku17
-rwxr-xr-xchallenge-269/perlboy1967/perl/ch-1.pl (renamed from challenge-269/perlboy1967/perl/ch1.pl)0
-rwxr-xr-xchallenge-269/perlboy1967/perl/ch-2.pl (renamed from challenge-269/perlboy1967/perl/ch2.pl)0
-rwxr-xr-xchallenge-269/ulrich-rieke/cpp/ch-1.cpp48
-rwxr-xr-xchallenge-269/ulrich-rieke/cpp/ch-2.cpp48
-rwxr-xr-xchallenge-269/ulrich-rieke/haskell/ch-1.hs19
-rwxr-xr-xchallenge-269/ulrich-rieke/haskell/ch-2.hs19
-rwxr-xr-xchallenge-269/ulrich-rieke/perl/ch-1.pl26
-rwxr-xr-xchallenge-269/ulrich-rieke/perl/ch-2.pl26
-rwxr-xr-xchallenge-269/ulrich-rieke/raku/ch-1.raku22
-rwxr-xr-xchallenge-269/ulrich-rieke/raku/ch-2.raku22
-rwxr-xr-xchallenge-269/ulrich-rieke/rust/ch-1.rs16
-rwxr-xr-xchallenge-269/ulrich-rieke/rust/ch-2.rs31
-rw-r--r--stats/pwc-challenge-267.json289
-rw-r--r--stats/pwc-challenge-268.json646
-rw-r--r--stats/pwc-current.json492
-rw-r--r--stats/pwc-language-breakdown-summary.json50
-rw-r--r--stats/pwc-language-breakdown.json3711
-rw-r--r--stats/pwc-leaders.json464
-rw-r--r--stats/pwc-summary-1-30.json120
-rw-r--r--stats/pwc-summary-121-150.json116
-rw-r--r--stats/pwc-summary-151-180.json46
-rw-r--r--stats/pwc-summary-181-210.json28
-rw-r--r--stats/pwc-summary-211-240.json28
-rw-r--r--stats/pwc-summary-241-270.json42
-rw-r--r--stats/pwc-summary-271-300.json120
-rw-r--r--stats/pwc-summary-301-330.json38
-rw-r--r--stats/pwc-summary-31-60.json108
-rw-r--r--stats/pwc-summary-61-90.json114
-rw-r--r--stats/pwc-summary-91-120.json36
-rw-r--r--stats/pwc-summary.json86
38 files changed, 3829 insertions, 3090 deletions
diff --git a/challenge-269/eric-cheung/python/ch-1.py b/challenge-269/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..eaf14a1911
--- /dev/null
+++ b/challenge-269/eric-cheung/python/ch-1.py
@@ -0,0 +1,29 @@
+
+from itertools import combinations
+
+def GetBitWiseOR (arrInput):
+
+ nResult = 0
+ for rLoop in arrInput:
+ nResult = nResult | rLoop
+ return nResult
+
+## arrInt = [1, 2, 3, 4, 5] ## Example 1
+## arrInt = [2, 3, 8, 16] ## Example 2
+arrInt = [1, 2, 5, 7, 9] ## Example 3
+
+bIsEven = False
+
+for nLoop in range(2, len(arrInt) + 1):
+
+ arrCombList = combinations(arrInt, nLoop)
+
+ for arrLoop in list(arrCombList):
+ if GetBitWiseOR (arrLoop) % 2 == 0:
+ bIsEven = True
+ break
+
+ if bIsEven:
+ break
+
+print (bIsEven)
diff --git a/challenge-269/eric-cheung/python/ch-2.py b/challenge-269/eric-cheung/python/ch-2.py
new file mode 100755
index 0000000000..bb95583826
--- /dev/null
+++ b/challenge-269/eric-cheung/python/ch-2.py
@@ -0,0 +1,15 @@
+
+## arrInt = [2, 1, 3, 4, 5] ## Example 1
+## arrInt = [3, 2, 4] ## Example 2
+arrInt = [5, 4, 3 ,8] ## Example 3
+
+arrOut_01 = [arrInt[0]]
+arrOut_02 = [arrInt[1]]
+
+for nLoop in arrInt[2:]:
+ if arrOut_01[-1] > arrOut_02[-1]:
+ arrOut_01.append(nLoop)
+ else:
+ arrOut_02.append(nLoop)
+
+print (arrOut_01 + arrOut_02)
diff --git a/challenge-269/laurent-rosenfeld/blog.txt b/challenge-269/laurent-rosenfeld/blog.txt
new file mode 100644
index 0000000000..166cba5523
--- /dev/null
+++ b/challenge-269/laurent-rosenfeld/blog.txt
@@ -0,0 +1 @@
+https://blogs.perl.org/users/laurent_r/2024/05/perl-weekly-challenge-269-bitwise-or.html
diff --git a/challenge-269/laurent-rosenfeld/blog1.txt b/challenge-269/laurent-rosenfeld/blog1.txt
new file mode 100644
index 0000000000..47742131ba
--- /dev/null
+++ b/challenge-269/laurent-rosenfeld/blog1.txt
@@ -0,0 +1 @@
+https://blogs.perl.org/users/laurent_r/2024/05/perl-weekly-challenge-269-distribute-elements.html
diff --git a/challenge-269/laurent-rosenfeld/perl/ch-1.pl b/challenge-269/laurent-rosenfeld/perl/ch-1.pl
new file mode 100644
index 0000000000..5f5cde3cbf
--- /dev/null
+++ b/challenge-269/laurent-rosenfeld/perl/ch-1.pl
@@ -0,0 +1,14 @@
+use strict;
+use warnings;
+use feature 'say';
+
+sub bitwise_or {
+ my @evens = grep { $_ % 2 == 0} @_;
+ return scalar @evens >= 2 ? "True" : "False";
+}
+
+my @tests = ([1, 2, 3, 4, 5], [2, 3, 8, 16], [1, 2, 5, 7, 9]);
+for my $test (@tests) {
+ printf "%-12s => ", "@$test";
+ say bitwise_or @$test;
+}
diff --git a/challenge-269/laurent-rosenfeld/perl/ch-2.pl b/challenge-269/laurent-rosenfeld/perl/ch-2.pl
new file mode 100644
index 0000000000..dc9486c58c
--- /dev/null
+++ b/challenge-269/laurent-rosenfeld/perl/ch-2.pl
@@ -0,0 +1,21 @@
+use strict;
+use warnings;
+use feature 'say';
+
+sub distribute_elements {
+ my @arr1 = shift;
+ my @arr2 = shift;
+ for my $item (@_) {
+ if ($arr1[-1] > $arr2[-1]) {
+ push @arr1, $item;
+ } else {
+ push @arr2, $item;
+ }
+ }
+ return "@arr1 @arr2";
+}
+my @tests = ( [<2 1 3 4 5>], [<3 2 4>], [<5 4 3 8>] );
+for my $test (@tests) {
+ printf "%-10s => ", "@$test";
+ say distribute_elements @$test;
+}
diff --git a/challenge-269/laurent-rosenfeld/raku/ch-1.raku b/challenge-269/laurent-rosenfeld/raku/ch-1.raku
new file mode 100644
index 0000000000..81789f1d09
--- /dev/null
+++ b/challenge-269/laurent-rosenfeld/raku/ch-1.raku
@@ -0,0 +1,10 @@
+sub bitwise-or (@in) {
+ my @evens = grep { $_ %% 2 }, @in;
+ return @evens.elems >= 2 ?? True !! False;
+}
+
+my @tests = (1, 2, 3, 4, 5), (2, 3, 8, 16), (1, 2, 5, 7, 9);
+for @tests -> @test {
+ printf "%-12s => ", "@test[]";
+ say bitwise-or @test;
+}
diff --git a/challenge-269/laurent-rosenfeld/raku/ch-2.raku b/challenge-269/laurent-rosenfeld/raku/ch-2.raku
new file mode 100644
index 0000000000..045f2ee595
--- /dev/null
+++ b/challenge-269/laurent-rosenfeld/raku/ch-2.raku
@@ -0,0 +1,17 @@
+sub distribute-elements (@in is copy) {
+ my @arr1 = shift @in;
+ my @arr2 = shift @in;
+ for @in -> $item {
+ if @arr1[*-1] > @arr2[*-1] {
+ push @arr1, $item;
+ } else {
+ push @arr2, $item;
+ }
+ }
+ return (@arr1, @arr2).flat;
+}
+my @tests = <2 1 3 4 5>, <3 2 4>, <5 4 3 8>;
+for @tests -> @test {
+ printf "%-10s => ", "@test[]";
+ say distribute-elements @test;
+}
diff --git a/challenge-269/perlboy1967/perl/ch1.pl b/challenge-269/perlboy1967/perl/ch-1.pl
index a35c6e2afe..a35c6e2afe 100755
--- a/challenge-269/perlboy1967/perl/ch1.pl
+++ b/challenge-269/perlboy1967/perl/ch-1.pl
diff --git a/challenge-269/perlboy1967/perl/ch2.pl b/challenge-269/perlboy1967/perl/ch-2.pl
index f1bc72b785..f1bc72b785 100755
--- a/challenge-269/perlboy1967/perl/ch2.pl
+++ b/challenge-269/perlboy1967/perl/ch-2.pl
diff --git a/challenge-269/ulrich-rieke/cpp/ch-1.cpp b/challenge-269/ulrich-rieke/cpp/ch-1.cpp
new file mode 100755
index 0000000000..f7fcee5fc2
--- /dev/null
+++ b/challenge-269/ulrich-rieke/cpp/ch-1.cpp
@@ -0,0 +1,48 @@
+#include <iostream>
+#include <string>
+#include <ranges>
+#include <string_view>
+#include <algorithm>
+#include <list>
+#include <iterator>
+#include <vector>
+
+int main( ) {
+ std::cout << "Enter some distinct integers, separated by blanks!\n" ;
+ std::string line ;
+ std::getline( std::cin , line ) ;
+ std::vector<std::string> numberstrings ;
+ char delimiter = ' ' ;
+ auto split = line | std::views::split( delimiter ) ;
+ for ( const auto & subrange : split ) {
+ std::string numstring( &*subrange.begin( ) , std::ranges::distance(
+ subrange ) ) ;
+ numberstrings.push_back( numstring ) ;
+ }
+ std::list<int> numbers , arr1 , arr2 ;
+ for ( auto s : numberstrings )
+ numbers.push_back( std::stoi( s ) ) ;
+ int first = numbers.front( ) ;
+ arr1.push_back( first ) ;
+ numbers.pop_front( ) ;
+ first = numbers.front( ) ;
+ arr2.push_back( first ) ;
+ numbers.pop_front( ) ;
+ while ( ! numbers.empty( ) ) {
+ first = numbers.front( ) ;
+ if ( arr1.back( ) > arr2.back( ) ) {
+ arr1.push_back( first ) ;
+ }
+ else {
+ arr2.push_back( first ) ;
+ }
+ numbers.pop_front( ) ;
+ }
+ for ( int i : arr2 )
+ arr1.push_back( i ) ;
+ std::cout << "( " ;
+ std::copy( arr1.begin( ) , arr1.end( ) , std::ostream_iterator<int>(
+ std::cout , " " )) ;
+ std::cout << ")\n" ;
+ return 0 ;
+}
diff --git a/challenge-269/ulrich-rieke/cpp/ch-2.cpp b/challenge-269/ulrich-rieke/cpp/ch-2.cpp
new file mode 100755
index 0000000000..f7fcee5fc2
--- /dev/null
+++ b/challenge-269/ulrich-rieke/cpp/ch-2.cpp
@@ -0,0 +1,48 @@
+#include <iostream>
+#include <string>
+#include <ranges>
+#include <string_view>
+#include <algorithm>
+#include <list>
+#include <iterator>
+#include <vector>
+
+int main( ) {
+ std::cout << "Enter some distinct integers, separated by blanks!\n" ;
+ std::string line ;
+ std::getline( std::cin , line ) ;
+ std::vector<std::string> numberstrings ;
+ char delimiter = ' ' ;
+ auto split = line | std::views::split( delimiter ) ;
+ for ( const auto & subrange : split ) {
+ std::string numstring( &*subrange.begin( ) , std::ranges::distance(
+ subrange ) ) ;
+ numberstrings.push_back( numstring ) ;
+ }
+ std::list<int> numbers , arr1 , arr2 ;
+ for ( auto s : numberstrings )
+ numbers.push_back( std::stoi( s ) ) ;
+ int first = numbers.front( ) ;
+ arr1.push_back( first ) ;
+ numbers.pop_front( ) ;
+ first = numbers.front( ) ;
+ arr2.push_back( first ) ;
+ numbers.pop_front( ) ;
+ while ( ! numbers.empty( ) ) {
+ first = numbers.front( ) ;
+ if ( arr1.back( ) > arr2.back( ) ) {
+ arr1.push_back( first ) ;
+ }
+ else {
+ arr2.push_back( first ) ;
+ }
+ numbers.pop_front( ) ;
+ }
+ for ( int i : arr2 )
+ arr1.push_back( i ) ;
+ std::cout << "( " ;
+ std::copy( arr1.begin( ) , arr1.end( ) , std::ostream_iterator<int>(
+ std::cout , " " )) ;
+ std::cout << ")\n" ;
+ return 0 ;
+}
diff --git a/challenge-269/ulrich-rieke/haskell/ch-1.hs b/challenge-269/ulrich-rieke/haskell/ch-1.hs
new file mode 100755
index 0000000000..6d161ff77d
--- /dev/null
+++ b/challenge-269/ulrich-rieke/haskell/ch-1.hs
@@ -0,0 +1,19 @@
+module Challenge269_2
+ where
+import Data.List ( (!!) )
+
+solution :: [Int] -> [Int]
+solution list = part1 ++ part2
+ where
+ (part1 , part2) = foldl myCombiner ([list !! 0] , [list !! 1 ] )
+ ( drop 2 list )
+ where
+ myCombiner :: ([Int] , [Int] ) -> Int -> ([Int] , [Int])
+ myCombiner ( arr1 , arr2 ) number = if last arr1 > last arr2 then
+ (arr1 ++ [number] , arr2 ) else (arr1 , arr2 ++ [number])
+
+main :: IO ( )
+main = do
+ putStrLn "Enter some distinct integers separated by blanks!"
+ numberstrings <- getLine
+ print $ solution $ map read $ words numberstrings
diff --git a/challenge-269/ulrich-rieke/haskell/ch-2.hs b/challenge-269/ulrich-rieke/haskell/ch-2.hs
new file mode 100755
index 0000000000..6d161ff77d
--- /dev/null
+++ b/challenge-269/ulrich-rieke/haskell/ch-2.hs
@@ -0,0 +1,19 @@
+module Challenge269_2
+ where
+import Data.List ( (!!) )
+
+solution :: [Int] -> [Int]
+solution list = part1 ++ part2
+ where
+ (part1 , part2) = foldl myCombiner ([list !! 0] , [list !! 1 ] )
+ ( drop 2 list )
+ where
+ myCombiner :: ([Int] , [Int] ) -> Int -> ([Int] , [Int])
+ myCombiner ( arr1 , arr2 ) number = if last arr1 > last arr2 then
+ (arr1 ++ [number] , arr2 ) else (arr1 , arr2 ++ [number])
+
+main :: IO ( )
+main = do
+ putStrLn "Enter some distinct integers separated by blanks!"
+ numberstrings <- getLine
+ print $ solution $ map read $ words numberstrings
diff --git a/challenge-269/ulrich-rieke/perl/ch-1.pl b/challenge-269/ulrich-rieke/perl/ch-1.pl
new file mode 100755
index 0000000000..43d774518a
--- /dev/null
+++ b/challenge-269/ulrich-rieke/perl/ch-1.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl ;
+use strict ;
+use warnings ;
+use feature 'say' ;
+
+say "Enter some distinct integers, separated by blanks!" ;
+my $line = <STDIN> ;
+chomp( $line ) ;
+my @numbers = split( /\s+/ , $line ) ;
+my @arr1 ;
+my @arr2 ;
+my @removed = splice( @numbers , 0 , 1 ) ;
+push( @arr1 , $removed[ 0 ] ) ;
+@removed = splice( @numbers , 0 , 1 ) ;
+push( @arr2, $removed[ 0 ] ) ;
+while ( @numbers ) {
+ @removed = splice( @numbers, 0 , 1 ) ;
+ if ( $arr1[-1] > $arr2[-1] ) {
+ push( @arr1 , $removed[ 0 ] ) ;
+ }
+ else {
+ push( @arr2 , $removed[ 0 ] ) ;
+ }
+}
+push( @arr1 , @arr2 ) ;
+say "(" . join( ',' , @arr1 ) . ")" ;
diff --git a/challenge-269/ulrich-rieke/perl/ch-2.pl b/challenge-269/ulrich-rieke/perl/ch-2.pl
new file mode 100755
index 0000000000..43d774518a
--- /dev/null
+++ b/challenge-269/ulrich-rieke/perl/ch-2.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl ;
+use strict ;
+use warnings ;
+use feature 'say' ;
+
+say "Enter some distinct integers, separated by blanks!" ;
+my $line = <STDIN> ;
+chomp( $line ) ;
+my @numbers = split( /\s+/ , $line ) ;
+my @arr1 ;
+my @arr2 ;
+my @removed = splice( @numbers , 0 , 1 ) ;
+push( @arr1 , $removed[ 0 ] ) ;
+@removed = splice( @numbers , 0 , 1 ) ;
+push( @arr2, $removed[ 0 ] ) ;
+while ( @numbers ) {
+ @removed = splice( @numbers, 0 , 1 ) ;
+ if ( $arr1[-1] > $arr2[-1] ) {
+ push( @arr1 , $removed[ 0 ] ) ;
+ }
+ else {
+ push( @arr2 , $removed[ 0 ] ) ;
+ }
+}
+push( @arr1 , @arr2 ) ;
+say "(" . join( ',' , @arr1 ) . ")" ;
diff --git a/challenge-269/ulrich-rieke/raku/ch-1.raku b/challenge-269/ulrich-rieke/raku/ch-1.raku
new file mode 100755
index 0000000000..cd1238fe56
--- /dev/null
+++ b/challenge-269/ulrich-rieke/raku/ch-1.raku
@@ -0,0 +1,22 @@
+use v6 ;
+
+say "Enter some distinct integers, separated by blanks!" ;
+my $line = $*IN.get ;
+my @numbers = $line.words.map( {.Int} ) ;
+my @arr1 ;
+my @arr2 ;
+my @removed = @numbers.splice( 0 , 1 ) ;
+@arr1.push( @removed[ 0 ] ) ;
+@removed = @numbers.splice( 0 , 1 ) ;
+@arr2.push( @removed[ 0 ] ) ;
+while ( @numbers ) {
+ @removed = @numbers.splice( 0 , 1 ) ;
+ if ( @arr1[*-1] > @arr2[*-1] ) {
+ @arr1.push( @removed[0] ) ;
+ }
+ else {
+ @arr2.push( @removed[0] ) ;
+ }
+}
+@arr1.push( @arr2 ) ;
+say "(" ~ @arr1.join( ',' ) ~ ")" ;
diff --git a/challenge-269/ulrich-rieke/raku/ch-2.raku b/challenge-269/ulrich-rieke/raku/ch-2.raku
new file mode 100755
index 0000000000..cd1238fe56
--- /dev/null
+++ b/challenge-269/ulrich-rieke/raku/ch-2.raku
@@ -0,0 +1,22 @@
+use v6 ;
+
+say "Enter some distinct integers, separated by blanks!" ;
+my $line = $*IN.get ;
+my @numbers = $line.words.map( {.Int} ) ;
+my @arr1 ;
+my @arr2 ;
+my @removed = @numbers.splice( 0 , 1 ) ;
+@arr1.push( @removed[ 0 ] ) ;
+@removed = @numbers.splice( 0 , 1 ) ;
+@arr2.push( @removed[ 0 ] ) ;
+while ( @numbers ) {
+ @removed = @numbers.splice( 0 , 1 ) ;
+ if ( @arr1[*-1] > @arr2[*-1] ) {
+ @arr1.push( @removed[0] ) ;
+ }
+ else {
+ @arr2.push( @removed[0] ) ;
+ }
+}
+@arr1.push( @arr2 ) ;
+say "(" ~ @arr1.join( ',' ) ~ ")" ;
diff --git a/challenge-269/ulrich-rieke/rust/ch-1.rs b/challenge-269/ulrich-rieke/rust/ch-1.rs
new file mode 100755
index 0000000000..3a05aef938
--- /dev/null
+++ b/challenge-269/ulrich-rieke/rust/ch-1.rs
@@ -0,0 +1,16 @@
+use std::io ;
+
+fn main() {
+ println!("Enter some integers, separated by blanks!");
+ let mut inline : String = String::new( ) ;
+ io::stdin( ).read_line( &mut inline ).unwrap( ) ;
+ let entered_line : &str = &*inline ;
+ let numbers : Vec<i32> = entered_line.trim( ).split_whitespace( ).
+ map( | s | s.parse::<i32>( ).unwrap( ) ).collect( ) ;
+ //the bitwise or of 2 numbers ends in a 0 in its binary representation
+ //if they are both even. So the question amounts to checking whether
+ //there are at least 2 even numbers in the array
+ let result : bool = numbers.into_iter( ).filter( | n | n % 2 == 0 )
+ .count( ) >= 2 ;
+ println!("{}" , result ) ;
+}
diff --git a/challenge-269/ulrich-rieke/rust/ch-2.rs b/challenge-269/ulrich-rieke/rust/ch-2.rs
new file mode 100755
index 0000000000..8f998cd646
--- /dev/null
+++ b/challenge-269/ulrich-rieke/rust/ch-2.rs
@@ -0,0 +1,31 @@
+use std::io ;
+
+fn main() {
+ println!("Enter some distinct integers, separated by blanks!");
+ let mut inline : String = String::new( ) ;
+ io::stdin( ).read_line( &mut inline ).unwrap( ) ;
+ let entered_line : &str = &*inline ;
+ let mut numbers : Vec<i32> = entered_line.trim( ).split_whitespace( ).
+ map( | s | s.parse::<i32>( ).unwrap( ) ).collect( ) ;
+ let mut arr1 : Vec<i32> = Vec::new( ) ;
+ let mut arr2 : Vec<i32> = Vec::new( ) ;
+ let mut first : i32 = numbers.remove( 0 ) ;
+ arr1.push( first ) ;
+ first = numbers.remove( 0 ) ;
+ arr2.push( first ) ;
+ while numbers.len( ) > 0 {
+ let len1 = arr1.len( ) ;
+ let len2 = arr2.len( ) ;
+ first = numbers.remove( 0 ) ;
+ if arr1[len1 - 1] > arr2[len2 - 1] {
+ arr1.push( first ) ;
+ }
+ else {
+ arr2.push( first ) ;
+ }
+ }
+ for i in arr2 {
+ arr1.push( i ) ;
+ }
+ println!("{:?}" , arr1 ) ;
+}
diff --git a/stats/pwc-challenge-267.json b/stats/pwc-challenge-267.json
index 1202c517ae..e522398ee0 100644
--- a/stats/pwc-challenge-267.json
+++ b/stats/pwc-challenge-267.json
@@ -1,33 +1,33 @@
{
- "plotOptions" : {
- "series" : {
- "borderWidth" : 0,
- "dataLabels" : {
- "format" : "{point.y}",
- "enabled" : 1
- }
- }
+ "xAxis" : {
+ "type" : "category"
},
- "yAxis" : {
- "title" : {
- "text" : "Total Solutions"
- }
+ "legend" : {
+ "enabled" : 0
+ },
+ "title" : {
+ "text" : "The Weekly Challenge - 267"
+ },
+ "tooltip" : {
+ "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>",
+ "followPointer" : 1,
+ "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>"
},
"drilldown" : {
"series" : [
{
- "id" : "Adam Russell",
- "name" : "Adam Russell",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "name" : "Adam Russell",
+ "id" : "Adam Russell"
},
{
- "name" : "Arne Sommer",
"id" : "Arne Sommer",
+ "name" : "Arne Sommer",
"data" : [
[
"Raku",
@@ -40,6 +40,7 @@
]
},
{
+ "name" : "Athanasius",
"data" : [
[
"Perl",
@@ -50,11 +51,9 @@
2
]
],
- "id" : "Athanasius",
- "name" : "Athanasius"
+ "id" : "Athanasius"
},
{
- "id" : "BarrOff",
"name" : "BarrOff",
"data" : [
[
@@ -65,7 +64,8 @@
"Raku",
1
]
- ]
+ ],
+ "id" : "BarrOff"
},
{
"data" : [
@@ -78,58 +78,58 @@
1
]
],
- "id" : "Bob Lied",
- "name" : "Bob Lied"
+ "name" : "Bob Lied",
+ "id" : "Bob Lied"
},
{
- "id" : "Bruce Gray",
- "name" : "Bruce Gray",
"data" : [
[
"Raku",
2
]
- ]
+ ],
+ "name" : "Bruce Gray",
+ "id" : "Bruce Gray"
},
{
+ "name" : "Dave Jacoby",
"data" : [
[
"Perl",
2
]
],
- "name" : "Dave Jacoby",
"id" : "Dave Jacoby"
},
{
"name" : "David Ferrone",
- "id" : "David Ferrone",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "id" : "David Ferrone"
},
{
- "id" : "E. Choroba",
- "name" : "E. Choroba",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "name" : "E. Choroba",
+ "id" : "E. Choroba"
},
{
"name" : "Feng Chang",
- "id" : "Feng Chang",
"data" : [
[
"Raku",
2
]
- ]
+ ],
+ "id" : "Feng Chang"
},
{
"data" : [
@@ -146,18 +146,18 @@
1
]
],
- "id" : "Jaldhar H. Vyas",
- "name" : "Jaldhar H. Vyas"
+ "name" : "Jaldhar H. Vyas",
+ "id" : "Jaldhar H. Vyas"
},
{
"id" : "Jan Krnavek",
- "name" : "Jan Krnavek",
"data" : [
[
"Raku",
2
]
- ]
+ ],
+ "name" : "Jan Krnavek"
},
{
"data" : [
@@ -170,20 +170,22 @@
1
]
],
- "id" : "Jorg Sommrey",
- "name" : "Jorg Sommrey"
+ "name" : "Jorg Sommrey",
+ "id" : "Jorg Sommrey"
},
{
- "id" : "Lance Wicks",
"name" : "Lance Wicks",
"data" : [
[
"Perl",
1
]
- ]
+ ],
+ "id" : "Lance Wicks"
},
{
+ "id" : "Laurent Rosenfeld",
+ "name" : "Laurent Rosenfeld",
"data" : [
[
"Perl",
@@ -197,13 +199,20 @@
"Blog",
2
]
+ ]
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ]
],
- "name" : "Laurent Rosenfeld",
- "id" : "Laurent Rosenfeld"
+ "name" : "Lubos Kolouch",
+ "id" : "Lubos Kolouch"
},
{
"name" : "Luca Ferrari",
- "id" : "Luca Ferrari",
"data" : [
[
"Raku",
@@ -213,26 +222,27 @@
"Blog",
9
]
- ]
+ ],
+ "id" : "Luca Ferrari"
},
{
- "name" : "Mark Anderson",
"id" : "Mark Anderson",
"data" : [
[
"Raku",
2
]
- ]
+ ],
+ "name" : "Mark Anderson"
},
{
+ "name" : "Matthew Neleigh",
"data" : [
[
"Perl",
2
]
],
- "name" : "Matthew Neleigh",
"id" : "Matthew Neleigh"
},
{
@@ -250,14 +260,14 @