From f748d4e18be236953c23f293a38b82c57d540b85 Mon Sep 17 00:00:00 2001 From: Lubos Kolouch Date: Fri, 24 May 2024 15:01:59 +0200 Subject: Challenge 270 LK Perl Python --- challenge-270/lubos-kolouch/perl/ch-1.pl | 34 ++++++++++++++ challenge-270/lubos-kolouch/perl/ch-2.pl | 74 ++++++++++++++++++++++++++++++ challenge-270/lubos-kolouch/python/ch-1.py | 44 ++++++++++++++++++ challenge-270/lubos-kolouch/python/ch-2.py | 57 +++++++++++++++++++++++ 4 files changed, 209 insertions(+) create mode 100644 challenge-270/lubos-kolouch/perl/ch-1.pl create mode 100644 challenge-270/lubos-kolouch/perl/ch-2.pl create mode 100644 challenge-270/lubos-kolouch/python/ch-1.py create mode 100644 challenge-270/lubos-kolouch/python/ch-2.py diff --git a/challenge-270/lubos-kolouch/perl/ch-1.pl b/challenge-270/lubos-kolouch/perl/ch-1.pl new file mode 100644 index 0000000000..aeee1e3e99 --- /dev/null +++ b/challenge-270/lubos-kolouch/perl/ch-1.pl @@ -0,0 +1,34 @@ +use strict; +use warnings; +use List::Util qw(all); + +sub num_special_positions { + my ($matrix) = @_; + my $rows = scalar(@$matrix); + my $cols = scalar( @{ $matrix->[0] } ); + my $special_count = 0; + + for my $i ( 0 .. $rows - 1 ) { + for my $j ( 0 .. $cols - 1 ) { + if ( $matrix->[$i][$j] == 1 ) { + my $row_check = all { $_ == 0 } + @{ $matrix->[$i] }[ 0 .. $j - 1, $j + 1 .. $cols - 1 ]; + my $col_check = all { $_ == 0 } + map { $matrix->[$_][$j] } grep { $_ != $i } 0 .. $rows - 1; + if ( $row_check && $col_check ) { + $special_count++; + } + } + } + } + + return $special_count; +} + +# Example 1 +my $matrix1 = [ [ 1, 0, 0 ], [ 0, 0, 1 ], [ 1, 0, 0 ] ]; +print num_special_positions($matrix1) == 1 ? "Pass\n" : "Fail\n"; + +# Example 2 +my $matrix2 = [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]; +print num_special_positions($matrix2) == 3 ? "Pass\n" : "Fail\n"; diff --git a/challenge-270/lubos-kolouch/perl/ch-2.pl b/challenge-270/lubos-kolouch/perl/ch-2.pl new file mode 100644 index 0000000000..519759ae8c --- /dev/null +++ b/challenge-270/lubos-kolouch/perl/ch-2.pl @@ -0,0 +1,74 @@ +#!/usr/bin/perl +use strict; +use warnings FATAL => 'all'; + +sub min_cost_to_equal_elements { + my ($ints_ref, $x, $y) = @_; + my @ints = @$ints_ref; + + my $min_cost = "inf"; + my $max_val = max(@ints); + my $min_val = min(@ints); + + print "Initial array: (@ints)\n"; + print "Cost for Level 1 (x): $x\n"; + print "Cost for Level 2 (y): $y\n"; + + for my $target ($min_val .. $max_val) { + my $cost = 0; + print "\nTrying to make all elements equal to: $target\n"; + + for my $num (@ints) { + my $diff = abs($target - $num); + print "Difference for element $num to target $target: $diff\n"; + + my $cost_addition; + if ($y < 2 * $x) { + my $level_2_ops = int($diff / 2); + my $level_1_ops = $diff % 2; + $cost_addition = ($level_2_ops * $y) + ($level_1_ops * $x); + print "Using Level 2 and Level 1. Cost to adjust $num to $target: $cost_addition\n"; + } else { + $cost_addition = $diff * $x; + print "Using only Level 1. Cost to adjust $num to $target: $cost_addition\n"; + } + + $cost += $cost_addition; + } + + print "Total cost to make all elements $target: $cost\n"; + $min_cost = $cost if $cost < $min_cost; + } + + return $min_cost; +} + +sub max { + my @array = @_; + my $max = $array[0]; + foreach (@array) { + $max = $_ if $_ > $max; + } + return $max; +} + +sub min { + my @array = @_; + my $min = $array[0]; + foreach (@array) { + $min = $_ if $_ < $min; + } + return $min; +} + +# Example 1 +my @ints1 = (4, 1); +my $x1 = 3; +my $y1 = 2; +print "Minimum cost: " . min_cost_to_equal_elements(\@ints1, $x1, $y1) . "\n"; # Expected Output: 9 + +# Example 2 +my @ints2 = (2, 3, 3, 3, 5); +my $x2 = 2; +my $y2 = 1; +print "Minimum cost: " . min_cost_to_equal_elements(\@ints2, $x2, $y2) . "\n"; # Expected Output: 6 diff --git a/challenge-270/lubos-kolouch/python/ch-1.py b/challenge-270/lubos-kolouch/python/ch-1.py new file mode 100644 index 0000000000..08a785afbd --- /dev/null +++ b/challenge-270/lubos-kolouch/python/ch-1.py @@ -0,0 +1,44 @@ +""" Perl Weekly Challenge 270 LK Task 1 Python """ + +from typing import List + + +def num_special_positions(matrix: List[List[int]]) -> int: + """ + num_special_positions A position (i, j) is called special if $matrix[i][j] == 1 and all other elements in the row i and column j are 0. + + Args: + matrix (List[List[int]]): input matrix + + Returns: + int: count of special positions + """ + + rows = len(matrix) + cols = len(matrix[0]) + + def is_special(i: int, j: int) -> bool: + for x in range(rows): + if x != i and matrix[x][j] == 1: + return False + for y in range(cols): + if y != j and matrix[i][y] == 1: + return False + return True + + special_count = 0 + for i in range(rows): + for j in range(cols): + if matrix[i][j] == 1 and is_special(i, j): + special_count += 1 + + return special_count + + +# Example 1 +matrix1 = [[1, 0, 0], [0, 0, 1], [1, 0, 0]] +assert num_special_positions(matrix1) == 1 + +# Example 2 +matrix2 = [[1, 0, 0], [0, 1, 0], [0, 0, 1]] +assert num_special_positions(matrix2) == 3 diff --git a/challenge-270/lubos-kolouch/python/ch-2.py b/challenge-270/lubos-kolouch/python/ch-2.py new file mode 100644 index 0000000000..23a2d5062a --- /dev/null +++ b/challenge-270/lubos-kolouch/python/ch-2.py @@ -0,0 +1,57 @@ +def min_cost_to_equal_elements(ints, x, y): + min_cost = float("inf") + max_val = max(ints) + min_val = min(ints) + + print(f"Initial array: {ints}") + print(f"Cost for Level 1 (x): {x}") + print(f"Cost for Level 2 (y): {y}") + + # Try making all elements equal to every value between min_val and max_val + for target in range(min_val, max_val + 1): + cost = 0 + print(f"\nTrying to make all elements equal to: {target}") + + for num in ints: + diff = abs(target - num) + print(f"Difference for element {num} to target {target}: {diff}") + + # Calculate cost using level 2 operations first, then level 1 if needed + if y < 2 * x: + # Using Level 2 operations where possible + level_2_ops = diff // 2 + level_1_ops = diff % 2 + cost_addition = (level_2_ops * y) + (level_1_ops * x) + print( + f"Using Level 2 and Level 1. Cost to adjust {num} to {target}: {cost_addition}" + ) + else: + # Using only Level 1 operations + cost_addition = diff * x + print( + f"Using only Level 1. Cost to adjust {num} to {target}: {cost_addition}" + ) + + cost += cost_addition + + print(f"Total cost to make all elements {target}: {cost}") + min_cost = min(min_cost, cost) + + return min_cost + + +# Example 1 +ints1 = [4, 1] +x1 = 3 +y1 = 2 +print( + f"Minimum cost: {min_cost_to_equal_elements(ints1, x1, y1)}" +) # Expected Output: 9 + +# Example 2 +ints2 = [2, 3, 3, 3, 5] +x2 = 2 +y2 = 1 +print( + f"Minimum cost: {min_cost_to_equal_elements(ints2, x2, y2)}" +) # Expected Output: 6 -- cgit From 64b7a92b3d1c569cf25d5d49633ad3217fac99d8 Mon Sep 17 00:00:00 2001 From: "Jaldhar H. Vyas" Date: Tue, 10 Sep 2024 23:52:43 -0400 Subject: Challenge 285 by Jaldhar H. Vyas. --- challenge-285/jaldhar-h-vyas/blog.txt | 1 + challenge-285/jaldhar-h-vyas/perl/ch-1.pl | 25 ++++++++++++++++++++++ challenge-285/jaldhar-h-vyas/perl/ch-2.pl | 32 ++++++++++++++++++++++++++++ challenge-285/jaldhar-h-vyas/raku/ch-1.sh | 3 +++ challenge-285/jaldhar-h-vyas/raku/ch-2.raku | 33 +++++++++++++++++++++++++++++ 5 files changed, 94 insertions(+) create mode 100644 challenge-285/jaldhar-h-vyas/blog.txt create mode 100755 challenge-285/jaldhar-h-vyas/perl/ch-1.pl create mode 100755 challenge-285/jaldhar-h-vyas/perl/ch-2.pl create mode 100755 challenge-285/jaldhar-h-vyas/raku/ch-1.sh create mode 100755 challenge-285/jaldhar-h-vyas/raku/ch-2.raku diff --git a/challenge-285/jaldhar-h-vyas/blog.txt b/challenge-285/jaldhar-h-vyas/blog.txt new file mode 100644 index 0000000000..3a342f4330 --- /dev/null +++ b/challenge-285/jaldhar-h-vyas/blog.txt @@ -0,0 +1 @@ +https://www.braincells.com/perl/2024/09/perl_weekly_challenge_week_285.html diff --git a/challenge-285/jaldhar-h-vyas/perl/ch-1.pl b/challenge-285/jaldhar-h-vyas/perl/ch-1.pl new file mode 100755 index 0000000000..48f35569c3 --- /dev/null +++ b/challenge-285/jaldhar-h-vyas/perl/ch-1.pl @@ -0,0 +1,25 @@ +#!/usr/bin/perl +use v5.38; + +sub setDifference($arr1, $arr2) { + my %difference = map { $_ => 0 } @{$arr1}; + + for my $elem (@{$arr2}) { + if (exists $difference{$elem}) { + $difference{$elem}++; + } + } + + return sort grep { !$difference{$_} } keys %difference; +} + +my @first; +my @second; + +for my $arg (@ARGV) { + @_ = split /\s+/, $arg; + push @first, $_[0]; + push @second, $_[1]; +} + +say join q{ }, setDifference(\@second, \@first); \ No newline at end of file diff --git a/challenge-285/jaldhar-h-vyas/perl/ch-2.pl b/challenge-285/jaldhar-h-vyas/perl/ch-2.pl new file mode 100755 index 0000000000..f394ead681 --- /dev/null +++ b/challenge-285/jaldhar-h-vyas/perl/ch-2.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl +use v5.38; +no warnings qw/ recursion /; +use constant PENNY => 1; +use constant NICKEL => 5; +use constant DIME => 10; +use constant QUARTER => 25; +use constant HALFDOLLAR => 50; + +sub changeCombinations($amount, $largestCoin){ + state @coins=(PENNY, NICKEL, DIME, QUARTER, HALFDOLLAR); + if ($largestCoin > $amount) { + return 0; + } + + if ($largestCoin == $amount) { + return 1; + } + + my $total; + + for my $coin (grep {$_ <= $largestCoin} @coins) { + $total += changeCombinations($amount - $largestCoin, $coin); + } + + return $total; +} + +my ($amount) = @ARGV; +my $largestCoin = HALFDOLLAR; + +say changeCombinations($amount + $largestCoin, $largestCoin) diff --git a/challenge-285/jaldhar-h-vyas/raku/ch-1.sh b/challenge-285/jaldhar-h-vyas/raku/ch-1.sh new file mode 100755 index 0000000000..4e779662a6 --- /dev/null +++ b/challenge-285/jaldhar-h-vyas/raku/ch-1.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +raku -e 'my @a=@*ARGS.words.pairup;(@a.map({$_.value})∖@a.map({$_.key})).keys.join.say' "$@" \ No newline at end of file diff --git a/challenge-285/jaldhar-h-vyas/raku/ch-2.raku b/challenge-285/jaldhar-h-vyas/raku/ch-2.raku new file mode 100755 index 0000000000..6c53fe4b65 --- /dev/null +++ b/challenge-285/jaldhar-h-vyas/raku/ch-2.raku @@ -0,0 +1,33 @@ +#!/usr/bin/raku + +constant PENNY = 1; +constant NICKEL = 5; +constant DIME = 10; +constant QUARTER = 25; +constant HALFDOLLAR = 50; + +sub changeCombinations($amount, $largestCoin){ + constant @coins = (HALFDOLLAR, QUARTER, DIME, NICKEL, PENNY); + + if $largestCoin > $amount { + return 0; + } + + if $largestCoin == $amount { + return 1; + } + + my $total; + + for @coins.grep({ $_ <= $largestCoin }) -> $coin { + $total += changeCombinations($amount - $largestCoin, $coin); + } + + return $total; +} + +sub MAIN( + Int $amount +) { + say changeCombinations($amount + HALFDOLLAR, HALFDOLLAR); +} \ No newline at end of file -- cgit From 8a29bdf6a6c4343c59a11ae7cb1d92dbbecffa05 Mon Sep 17 00:00:00 2001 From: Paulo Custodio Date: Wed, 11 Sep 2024 21:37:26 +0100 Subject: Add Python solution to challenge 057 --- challenge-057/paulo-custodio/python/ch-1.py | 88 +++++++++++++++++++++++++++++ challenge-057/paulo-custodio/python/ch-2.py | 34 +++++++++++ 2 files changed, 122 insertions(+) create mode 100644 challenge-057/paulo-custodio/python/ch-1.py create mode 100644 challenge-057/paulo-custodio/python/ch-2.py diff --git a/challenge-057/paulo-custodio/python/ch-1.py b/challenge-057/paulo-custodio/python/ch-1.py new file mode 100644 index 0000000000..f5ef6b8cc9 --- /dev/null +++ b/challenge-057/paulo-custodio/python/ch-1.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python3 + +# Challenge 057 +# +# TASK #1 › Invert Tree +# You are given a full binary tree of any height, similar to the one below: +# +# +# +# Write a script to invert the tree, by mirroring the children of every node, +# from left to right. The expected output from the tree above would be: +# +# +# +# The input can be any sensible machine-readable binary tree format of your +# choosing, and the output should be the same format. +# +# BONUS +# In addition to the above, you may wish to pretty-print your binary tree in a +# human readable text-based format similar to the following: +# +# 1 +# / \ +# 3 2 +# / \ / \ +# 7 6 5 4 + +import fileinput +import re +import sys + +class Node: + def __init__(self, value): + self.value = value + self.left = None + self.right = None + + def __repr__(self): + return "Node(value: {}, left: {}, right: {})" \ + .format(self.value, self.left, self.right) + +def read_input(): + lines = [] + for line in fileinput.input(): + lines.append(line) + return lines + +def parse_subtree(lines, row, col): + def ch(row, col): + if row < 0 or row >= len(lines) or \ + col < 0 or col >= len(lines[row]): + return ' ' + else: + return lines[row][col] + + tree = Node(int(lines[row][col])) + if ch(row + 1, col - 1) == '/': + tree.left = parse_subtree(lines, row + 2, col - 2) + if ch(row + 1, col + 1) == '\\': + tree.right = parse_subtree(lines, row + 2, col + 2) + + return tree + +def parse_tree(lines): + found = re.search(r'^[ ]+\d', lines[0]) + col = found.span()[1] - 1 + return parse_subtree(lines, 0, col) + +def invert_tree(tree): + if tree: + tree.left, tree.right = tree.right, tree.left + invert_tree(tree.left) + invert_tree(tree.right) + +def dump_tree(tree): + if tree: + print(tree.value, end='') + if tree.left or tree.right: + print("(", end='') + dump_tree(tree.left) + print("|", end='') + dump_tree(tree.right) + print(")", end='') + +tree = parse_tree(read_input()) +invert_tree(tree) +dump_tree(tree) + diff --git a/challenge-057/paulo-custodio/python/ch-2.py b/challenge-057/paulo-custodio/python/ch-2.py new file mode 100644 index 0000000000..5f833663b5 --- /dev/null +++ b/challenge-057/paulo-custodio/python/ch-2.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Challenge 057 +# +# TASK #2 › Shortest Unique Prefix +# Write a script to find the shortest unique prefix for each each word in the +# given list. The prefixes will not necessarily be of the same length. +# +# Sample Input +# [ "alphabet", "book", "carpet", "cadmium", "cadeau", "alpine" ] +# Expected Output +# [ "alph", "b", "car", "cadm", "cade", "alpi" ] + +import re +import sys + +def shortest_prefix1(word, words): + for i in range(1, len(word)): + prefix = word[:i] + found = 0 + for x in words: + if re.search(r'^'+prefix, x): + found += 1 + if found == 1: + return prefix + return word + +def shortest_prefix(words): + prefixes = [] + for word in words: + prefixes.append(shortest_prefix1(word, words)) + return prefixes + +print(" ".join(shortest_prefix(sys.argv[1:]))) -- cgit From eb98e39e73f94883aa8975576dcf1bd7b30db182 Mon Sep 17 00:00:00 2001 From: Mohammad Sajid Anwar Date: Thu, 12 Sep 2024 15:14:05 +0100 Subject: - Added solutions by Ulrich Rieke. --- challenge-286/ulrich-rieke/cpp/ch-1.cpp | 43 ++ challenge-286/ulrich-rieke/cpp/ch-2.cpp | 49 ++ challenge-286/ulrich-rieke/haskell/ch-1.hs | 17 + challenge-286/ulrich-rieke/haskell/ch-2.hs | 17 + challenge-286/ulrich-rieke/perl/ch-1.pl | 20 + challenge-286/ulrich-rieke/perl/ch-2.pl | 29 ++ challenge-286/ulrich-rieke/raku/ch-1.raku | 5 + challenge-286/ulrich-rieke/raku/ch-2.raku | 23 + challenge-286/ulrich-rieke/rust/ch-1.rs | 25 + challenge-286/ulrich-rieke/rust/ch-2.rs | 30 ++ stats/pwc-current.json | 201 ++++---- stats/pwc-language-breakdown-2019.json | 330 ++++++------- stats/pwc-language-breakdown-2020.json | 382 +++++++-------- stats/pwc-language-breakdown-2021.json | 758 ++++++++++++++--------------- stats/pwc-language-breakdown-2022.json | 712 +++++++++++++-------------- stats/pwc-language-breakdown-2023.json | 422 ++++++++-------- stats/pwc-language-breakdown-2024.json | 304 ++++++------ stats/pwc-language-breakdown-summary.json | 54 +- stats/pwc-leaders.json | 750 ++++++++++++++-------------- stats/pwc-summary-1-30.json | 104 ++-- stats/pwc-summary-121-150.json | 90 ++-- stats/pwc-summary-151-180.json | 88 ++-- stats/pwc-summary-181-210.json | 102 ++-- stats/pwc-summary-211-240.json | 110 ++--- stats/pwc-summary-241-270.json | 114 ++--- stats/pwc-summary-271-300.json | 106 ++-- stats/pwc-summary-301-330.json | 94 ++-- stats/pwc-summary-31-60.json | 108 ++-- stats/pwc-summary-61-90.json | 120 ++--- stats/pwc-summary-91-120.json | 130 ++--- stats/pwc-summary.json | 48 +- stats/pwc-yearly-language-summary.json | 146 +++--- 32 files changed, 2906 insertions(+), 2625 deletions(-) create mode 100755 challenge-286/ulrich-rieke/cpp/ch-1.cpp create mode 100755 challenge-286/ulrich-rieke/cpp/ch-2.cpp create mode 100755 challenge-286/ulrich-rieke/haskell/ch-1.hs create mode 100755 challenge-286/ulrich-rieke/haskell/ch-2.hs create mode 100755 challenge-286/ulrich-rieke/perl/ch-1.pl create mode 100755 challenge-286/ulrich-rieke/perl/ch-2.pl create mode 100755 challenge-286/ulrich-rieke/raku/ch-1.raku create mode 100755 challenge-286/ulrich-rieke/raku/ch-2.raku create mode 100755 challenge-286/ulrich-rieke/rust/ch-1.rs create mode 100755 challenge-286/ulrich-rieke/rust/ch-2.rs diff --git a/challenge-286/ulrich-rieke/cpp/ch-1.cpp b/challenge-286/ulrich-rieke/cpp/ch-1.cpp new file mode 100755 index 0000000000..7bc70c9a1c --- /dev/null +++ b/challenge-286/ulrich-rieke/cpp/ch-1.cpp @@ -0,0 +1,43 @@ +#include +#include +#include +#include +#include +#include + +std::vector split( const std::string & text , + const char delimiter ) { + std::istringstream istr { text } ; + std::vector tokens ; + std::string word ; + while ( std::getline( istr , word , delimiter ) ) { + if ( word.length( ) > 0 ) { + tokens.push_back( word ) ; + } + } + return tokens ; +} + +int main( ) { + std::ifstream infile( "challenge286.cpp" ) ; + std::vector allWords ; + if ( infile.is_open( ) ) { + std::string line ; + while ( infile ) { + std::getline( infile , line ) ; + if ( ! line.empty( ) ) { + std::vector tokens { split( line , ' ' ) } ; + for ( auto s : tokens ) + allWords.push_back( s ) ; + } + } + } + infile.close( ) ; + int len = allWords.size( ) ; + std::random_device rd ; + std::mt19937 gen( rd( ) ) ; + std::uniform_int_distribution<> distri(0 , len - 1 ) ; + int pos = distri( gen ) ; + std::cout << allWords[pos] << '\n' ; + return 0 ; +} diff --git a/challenge-286/ulrich-rieke/cpp/ch-2.cpp b/challenge-286/ulrich-rieke/cpp/ch-2.cpp new file mode 100755 index 0000000000..7b1579b314 --- /dev/null +++ b/challenge-286/ulrich-rieke/cpp/ch-2.cpp @@ -0,0 +1,49 @@ +#include +#include +#include +#include +#include + +//routine for splitting a string at a given delimiter +std::vector split( const std::string & text , const char + delimiter ) { + std::vector tokens ; + std::istringstream istr { text } ; + std::string word ; + while ( std::getline( istr, word , delimiter )) { + tokens.push_back( word ) ; + } + return tokens ; +} + +int main( ) { + std::cout << "Enter 2 ^ n integers, where n is a positive integer!\n" ; + std::string line ; + std::getline( std::cin , line ) ; + auto tokens = split( line , ' ' ) ; + std::vector numbers ; + for ( auto s : tokens ) + numbers.push_back( std::stoi( s ) ) ; + bool last_was_min = false ;//did we determine the minimum last time ? + while ( numbers.size( ) > 1 ) { + std::vector> allPairs ;// all neighbouring pairs + for ( int i = 0 ; i < numbers.size( ) - 1 ; i += 2 ) { + allPairs.push_back( std::make_pair( numbers[i] , numbers[i + 1] )) ; + } + std::vector intermediate ; //for the minima and maxima + for ( auto it = allPairs.begin( ) ; it != allPairs.end( ) ; it++ ) { + if ( last_was_min ) { + intermediate.push_back( std::max( it->first , it->second ) ) ; + last_was_min = false ; //toggle the boolean value + } + else { + intermediate.push_back( std::min( it->first , it->second ) ) ; + last_was_min = true ; + } + } + numbers = intermediate ; + intermediate.clear( ) ; + } + std::cout << *numbers.begin( ) << '\n' ; + return 0 ; +} diff --git a/challenge-286/ulrich-rieke/haskell/ch-1.hs b/challenge-286/ulrich-rieke/haskell/ch-1.hs new file mode 100755 index 0000000000..a24d918173 --- /dev/null +++ b/challenge-286/ulrich-rieke/haskell/ch-1.hs @@ -0,0 +1,17 @@ +module Challenge286 + where +import System.Random +import Data.List ( (!!) ) + +pickWord :: [String] -> String +pickWord words = words !! pos + where + gen = mkStdGen 137 + pos = fst $ uniformR ( 0 :: Int , length words - 1 :: Int ) gen + +main :: IO ( ) +main = do + allLines <- readFile "Challenge286.hs" + let allTheWords = words allLines + relevantWords = filter ( not . null ) allTheWords + print $ pickWord relevantWords diff --git a/challenge-286/ulrich-rieke/haskell/ch-2.hs b/challenge-286/ulrich-rieke/haskell/ch-2.hs new file mode 100755 index 0000000000..db350ca355 --- /dev/null +++ b/challenge-286/ulrich-rieke/haskell/ch-2.hs @@ -0,0 +1,17 @@ +module Challenge286_2 + where +import Data.List.Split ( chunksOf ) ; + +solution :: [Int] -> Int +solution list = head $ until ( (== 1 ) . length ) step list + where + step :: [Int] -> [Int] + step someList = map (\p -> if (fst p ) then min ( head $ snd p ) ( last $ snd + p ) else max ( head $ snd p ) ( last $ snd p ) ) $ zip ( cycle [True , + False] ) (chunksOf 2 someList) + +main :: IO ( ) +main = do + putStrLn "Enter 2 ^ n integers where n is a positive integer!" + numberstrings <- getLine + print $ solution $ map read $ words numberstrings diff --git a/challenge-286/ulrich-rieke/perl/ch-1.pl b/challenge-286/ulrich-rieke/perl/ch-1.pl new file mode 100755 index 0000000000..aeba026e89 --- /dev/null +++ b/challenge-286/ulrich-rieke/perl/ch-1.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; + +my @allWords ; +my $fh ; +open ( $fh , "< Challenge286.pl") or die "can't open file!" ; +my @lines = <$fh> ; +close( $fh ) ; +for my $line( @lines ) { + if ( $line ) { + my @words = split( /\s+/ , $line ) ; + map { push( @allWords , $_ ) } @words ; + } +} +my $len = scalar( @allWords ) ; +srand( time( )) ; +my $pos = int( rand( $len ) ) ; +say $allWords[ $pos ] ; diff --git a/challenge-286/ulrich-rieke/perl/ch-2.pl b/challenge-286/ulrich-rieke/perl/ch-2.pl new file mode 100755 index 0000000000..8ba8400e06 --- /dev/null +++ b/challenge-286/ulrich-rieke/perl/ch-2.pl @@ -0,0 +1,29 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; +use List::Util qw ( pairs min max ) ; + +say "Enter 2 ^ n integers , where n is a positive integer!" ; +my $line = ; +chomp $line ; +#I do no input checking here... +my @numbers = split( /\s+/ , $line ) ; +my $last_was_min = 0 ;#did we determine the minimum last time, if not , 0! +while ( scalar( @numbers ) > 1 ) { + my @pairs = pairs( @numbers ) ; + my @intermediate ; #for the minima and maxima + for my $pair ( @pairs ) { + if ( $last_was_min ) { #we now have to find the maximum + push( @intermediate , max( @$pair ) ) ; + $last_was_min = 0 ; #toggle the boolean value + } + else { #the other way round + push( @intermediate , min( @$pair ) ) ; + $last_was_min = 1 ; + } + } + @numbers = @intermediate ; + @intermediate = ( ) ; +} +say $numbers[0] ; diff --git a/challenge-286/ulrich-rieke/raku/ch-1.raku b/challenge-286/ulrich-rieke/raku/ch-1.raku new file mode 100755 index 0000000000..ca150d9b41 --- /dev/null +++ b/challenge-286/ulrich-rieke/raku/ch-1.raku @@ -0,0 +1,5 @@ +use v6 ; + +my $code = "Challenge286.raku".IO.slurp ; +my @words = $code.words ; +say @words.pick ; diff --git a/challenge-286/ulrich-rieke/raku/ch-2.raku b/challenge-286/ulrich-rieke/raku/ch-2.raku new file mode 100755 index 0000000000..ba7c8122d2 --- /dev/null +++ b/challenge-286/ulrich-rieke/raku/ch-2.raku @@ -0,0 +1,23 @@ +use v6 ; + +say "Enter 2 ^ n many integers, where n is a positive integer!" ; +my $line = $*IN.get ; +my @numbers = $line.words.map( {.Int} ) ; +my $last_was_min = False ; #did we determine the minimum last time ? +while ( @numbers.elems > 1 ) { + my @pairs = @numbers.rotor( 2 ) ; + my @intermediate ; #for the minima and maxima of neighbouring pairs + for @pairs -> $pair { + if ( $last_was_min ) { #we must find the maximum + @intermediate.push( $pair.max ) ; + $last_was_min = False ; #toggle the boolean value + } + else { + @intermediate.push( $pair.min ) ; + $last_was_min = True ; + } + } + @numbers = @intermediate ; + @intermediate = ( ) ; +} +say @numbers[0] ; diff --git a/challenge-286/ulrich-rieke/rust/ch-1.rs b/challenge-286/ulrich-rieke/rust/ch-1.rs new file mode 100755 index 0000000000..2f8e025067 --- /dev/null +++ b/challenge-286/ulrich-rieke/rust/ch-1.rs @@ -0,0 +1,25 @@ +use std::io::{self , BufRead , BufReader} ; +use std::fs::File ; +use rand ; + +fn main() -> io::Result<()>{ + let path = "main.rs" ; + let source_file = File::open( path )? ; + let reader = BufReader::new( source_file ) ; + let mut all_words : Vec = Vec::new( ) ; + for line in reader.lines( ) { + let codeline = line.unwrap( ) ; + if codeline.len( ) > 0 { + let codewords : &str = codeline.as_str( ) ; + codewords.split_whitespace( ).for_each( | s | { + let str = s.into( ) ; + all_words.push( str ) ; + } ) ; + } + } + let len = all_words.len( ) ; + let selected : u32 = rand::random::( ) ; + let select_pos : usize = (selected as usize) % len ; + println!("{:?}" , all_words[select_pos] ) ; + Ok(() ) +} diff --git a/challenge-286/ulrich-rieke/rust/ch-2.rs b/challenge-286/ulrich-rieke/rust/ch-2.rs new file mode 100755 index 0000000000..4c34f0c644 --- /dev/null +++ b/challenge-286/ulrich-rieke/rust/ch-2.rs @@ -0,0 +1,30 @@ +use std::{io , cmp} ; + +fn main() { + println!("Enter an number of integers( there must be a 2 exponent of them!"); + let mut inline : String = String::new( ) ; + io::stdin( ).read_line( &mut inline ).unwrap( ) ; + let entered_line : &str = inline.as_str( ).trim( ) ; + let mut numbers : Vec = entered_line.split_whitespace( ).map( |s| + s.parse::( ).unwrap( ) ).collect( ) ; + while numbers.len( ) > 1 { + let mut last_was_min : bool = false ; + let slice = &numbers[..] ; + let mut chu = slice.chunks( 2 ) ; + let mut intermediate : Vec = Vec::new( ) ; + while let Some( p ) = chu.next( ) { + if last_was_min { + let maxi = cmp::max( p[0] , p[1] ) ; + intermediate.push( maxi ) ; + last_was_min = false ; + } + else { + let mini = cmp::min( p[0] , p[1] ) ; + intermediate.push( mini ) ; + last_was_min = true ; + } + } + numbers = intermediate ; + } + println!("{}" , numbers[0] ) ; +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index b98e26e793..37622400fb 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,46 +1,39 @@ { - "title" : { - "text" : "The Weekly Challenge - 286" - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } - } - }, "legend" : { "enabled" : 0 }, - "chart" : { - "type" : "column" + "title" : { + "text" : "The Weekly Challenge - 286" + }, + "tooltip" : { + "pointFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "{series.name}
", + "followPointer" : 1 }, "drilldown" : { "series" : [ { - "id" : "Alexander Karelas", + "name" : "Alexander Karelas", "data" : [ [ "Perl", 1 ] ], - "name" : "Alexander Karelas" + "id" : "Alexander Karelas" }, { + "id" : "Cheok-Yin Fung", "data" : [ [ "Perl", 1 ] ], - "id" : "Cheok-Yin Fung", "name" : "Cheok-Yin Fung" }, { - "name" : "David Ferrone", + "id" : "David Ferrone", "data" : [ [ "Perl", @@ -51,39 +44,40 @@ 1 ] ], - "id" : "David Ferrone" + "name" : "David Ferrone" }, { + "id" : "E. Choroba", + "name" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ], - "id" : "E. Choroba", - "name" : "E. Choroba" + ] }, { - "name" : "Feng Chang", + "id" : "Feng Chang", "data" : [ [ "Raku", 2 ] ], - "id" : "Feng Chang" + "name" : "Feng Chang" }, { + "id" : "Kjetil Skotheim", "name" : "Kjetil Skotheim", "data" : [ [ "Perl", 2 ] - ], - "id" : "Kjetil Skotheim" + ] }, { + "name" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -98,22 +92,21 @@ 2 ] ], - "id" : "Laurent Rosenfeld", - "name" : "Laurent Rosenfeld" + "id" : "Laurent Rosenfeld" }, { - "id" : "Matthew Neleigh", "data" : [ [ "Perl", 2 ] ], - "name" : "Matthew Neleigh" + "name" : "Matthew Neleigh", + "id" : "Matthew Neleigh" }, { - "name" : "Niels van Dijke", "id" : "Niels van Dijke", + "name" : "Niels van Dijke", "data" : [ [ "Perl", @@ -146,11 +139,10 @@ 2 ] ], - "id" : "Paulo Custodio", - "name" : "Paulo Custodio" + "name" : "Paulo Custodio", + "id" : "Paulo Custodio" }, { - "name" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -161,31 +153,35 @@ 1 ] ], + "name" : "Peter Campbell Smith", "id" : "Peter Campbell Smith" }, { + "id" : "Peter Meszaros", + "name" : "Peter Meszaros", "data" : [ [ "Perl", 2 ] - ], - "id" : "Peter Meszaros", - "name" : "Peter Meszaros" + ] }, { + "name" : "Peter Pentchev", "data" : [ [ "Perl", 2 + ], + [ + "Blog", + 1 ] ], - "id" : "Peter Pentchev", - "name" : "Peter Pentchev" + "id" : "Peter Pentchev" }, { "name" : "Robbie Hatley", - "id" : "Robbie Hatley", "data" : [ [ "Perl", @@ -195,11 +191,10 @@ "Blog", 1 ] - ] + ], + "id" : "Robbie Hatley" }, { - "name" : "Roger Bell_West", - "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -209,10 +204,11 @@ "Raku", 1 ] - ] + ], + "name" : "Roger Bell_West", + "id" : "Roger Bell_West" }, { - "name" : "Thomas Kohler", "id" : "Thomas Kohler", "data" : [ [ @@ -223,10 +219,10 @@ "Blog", 2 ] - ] + ], + "name" : "Thomas Kohler" }, { - "name" : "Torgny Lyon", "id" : "Torgny Lyon", "data" : [ [ @@ -237,9 +233,25 @@ "Blog", 1 ] + ], + "name" : "Torgny Lyon" + }, + { + "id" : "Ulrich Rieke", + "name" : "Ulrich Rieke", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] ] }, { + "id" : "W. Luis Mochan", "name" : "W. Luis Mochan", "data" : [ [ @@ -250,23 +262,12 @@ "Blog", 1 ] - ], - "id" : "W. Luis Mochan" + ] } ] }, "subtitle" : { - "text" : "[Champions: 19] Last updated at 2024-09-11 16:31:49 GMT" - }, - "tooltip" : { - "pointFormat" : "{point.name}: {point.y:f}
", - "headerFormat" : "{series.name}
", - "followPointer" : 1 - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } + "text" : "[Champions: 20] Last updated at 2024-09-12 14:13:36 GMT" }, "series" : [ { @@ -274,19 +275,19 @@ "name" : "The Weekly Challenge - 286", "data" : [ { - "name" : "Alexander Karelas", "drilldown" : "Alexander Karelas", + "name" : "Alexander Karelas", "y" : 1 }, { "name" : "Cheok-Yin Fung", - "drilldown" : "Cheok-Yin Fung", - "y" : 1 + "y" : 1, + "drilldown" : "Cheok-Yin Fung" }, { "drilldown" : "David Ferrone", - "y" : 3, - "name" : "David Ferrone" + "name" : "David Ferrone", + "y" : 3 }, { "name" : "E. Choroba", @@ -299,39 +300,39 @@ "drilldown" : "Feng Chang" }, { + "name" : "Kjetil Skotheim", "y" : 2, - "drilldown" : "Kjetil Skotheim", - "name" : "Kjetil Skotheim" + "drilldown" : "Kjetil Skotheim" }, { - "drilldown" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld", "y" : 6, - "name" : "Laurent Rosenfeld" + "drilldown" : "Laurent Rosenfeld" }, { - "y" : 2, "drilldown" : "Matthew Neleigh", - "name" : "Matthew Neleigh" + "name" : "Matthew Neleigh", + "y" : 2 }, { "y" : 2, - "drilldown" : "Niels van Dijke", - "name" : "Niels van Dijke" + "name" : "Niels van Dijke", + "drilldown" : "Niels van Dijke" }, { - "name" : "Packy Anderson", "y" : 5, + "name" : "Packy Anderson", "drilldown" : "Packy Anderson" }, { - "y" : 2, "drilldown" : "Paulo Custodio", - "name" : "Paulo Custodio" + "name" : "Paulo Custodio", + "y" : 2 }, { + "name" : "Peter Campbell Smith", "y" : 3, - "drilldown" : "Peter Campbell Smith", - "name" : "Peter Campbell Smith" + "drilldown" : "Peter Campbell Smith" }, { "drilldown" : "Peter Meszaros", @@ -340,38 +341,60 @@ }, { "name" : "Peter Pentchev", - "y" : 2, + "y" : 3, "drilldown" : "Peter Pentchev" }, { - "drilldown" : "Robbie Hatley", "y" : 3, - "name" : "Robbie Hatley" + "name" : "Robbie Hatley", + "drilldown" : "Robbie Hatley" }, { "drilldown" : "Roger Bell_West", - "y" : 2, - "name" : "Roger Bell_West" + "name" : "Roger Bell_West", + "y" : 2 }, { - "name" : "Thomas Kohler", + "drilldown" : "Thomas Kohler", "y" : 4, - "drilldown" : "Thomas Kohler" + "name" : "Thomas Kohler" }, { "y" : 3, - "drilldown" : "Torgny Lyon", - "name" : "Torgny Lyon" + "name" : "Torgny Lyon", + "drilldown" : "Torgny Lyon" + }, + { + "y" : 4, + "name" : "Ulrich Rieke", + "drilldown" : "Ulrich Rieke" }, { "drilldown" : "W. Luis Mochan", - "y" : 3, - "name" : "W. Luis Mochan" + "name" : "W. Luis Mochan", + "y" : 3 } ] } ], + "plotOptions" : { + "series" : { + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 + } + }, "xAxis" : { "type" : "category" + }, + "chart" : { + "type" : "column" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } } } diff --git a/stats/pwc-language-breakdown-2019.json b/stats/pwc-language-breakdown-2019.json index 676c06a8ce..cd11b07f77 100644 --- a/stats/pwc-language-breakdown-2019.json +++ b/stats/pwc-language-breakdown-2019.json @@ -1,65 +1,70 @@ { - "xAxis" : { - "type" : "category" + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "chart" : { + "type" : "column" }, "series" : [ { - "colorByPoint" : "true", "name" : "The Weekly Challenge Languages", + "colorByPoint" : "true", "data" : [ { - "name" : "041", "drilldown" : "041", + "name" : "041", "y" : 80 }, { - "name" : "040", "y" : 77, + "name" : "040", "drilldown" : "040" }, { - "name" : "039", "drilldown" : "039", + "name" : "039", "y" : 68 }, { - "y" : 74, "drilldown" : "038", - "name" : "038" + "name" : "038", + "y" : 74 }, { - "name" : "037", "drilldown" : "037", + "name" : "037", "y" : 70 }, { + "name" : "036", "y" : 70, - "drilldown" : "036", - "name" : "036" + "drilldown" : "036" }, { - "drilldown" : "035", "y" : 68, - "name" : "035" + "name" : "035", + "drilldown" : "035" }, { + "drilldown" : "034", "name" : "034", - "y" : 70, - "drilldown" : "034" + "y" : 70 }, { - "y" : 113, "drilldown" : "033", + "y" : 113, "name" : "033" }, { "drilldown" : "032", - "y" : 97, - "name" : "032" + "name" : "032", + "y" : 97 }, { - "name" : "031", "y" : 93, + "name" : "031", "drilldown" : "031" }, { @@ -68,79 +73,79 @@ "drilldown" : "030" }, { + "y" : 83, "name" : "029", - "drilldown" : "029", - "y" : 83 + "drilldown" : "029" }, { "name" : "028", - "drilldown" : "028", - "y" : 82 + "y" : 82, + "drilldown" : "028" }, { - "y" : 64, "drilldown" : "027", + "y" : 64, "name" : "027" }, { "drilldown" : "026", - "y" : 75, - "name" : "026" + "name" : "026", + "y" : 75 }, { "drilldown" : "025", - "y" : 62, - "name" : "025" + "name" : "025", + "y" : 62 }, { - "name" : "024", "y" : 77, + "name" : "024", "drilldown" : "024" }, { "y" : 88, - "drilldown" : "023", - "name" : "023" + "name" : "023", + "drilldown" : "023" }, { + "y" : 72, "name" : "022", - "drilldown" : "022", - "y" : 72 + "drilldown" : "022" }, { - "name" : "021", "y" : 72, + "name" : "021", "drilldown" : "021" }, { - "drilldown" : "020", + "name" : "020", "y" : 100, - "name" : "020" + "drilldown" : "020" }, { - "drilldown" : "019", "y" : 101, - "name" : "019" + "name" : "019", + "drilldown" : "019" }, { + "name" : "018", "y" : 82, - "drilldown" : "018", - "name" : "018" + "drilldown" : "018" }, { - "drilldown" : "017", "y" : 83, - "name" : "017" + "name" : "017", + "drilldown" : "017" }, { - "drilldown" : "016", "y" : 75, - "name" : "016" + "name" : "016", + "drilldown" : "016" }, { + "y" : 95, "name" : "015", - "drilldown" : "015", - "y" : 95 + "drilldown" : "015" }, { "name" : "014", @@ -148,44 +153,44 @@ "drilldown" : "014" }, { - "y" : 85, "drilldown" : "013", - "name" : "013" + "name" : "013", + "y" : 85 }, { "drilldown" : "012", - "y" : 90, - "name" : "012" + "name" : "012", + "y" : 90 }, { "name" : "011", - "drilldown" : "011", - "y" : 86 + "y" : 86, + "drilldown" : "011" }, { "y" : 69, - "drilldown" : "010", - "name" : "010" + "name" : "010", + "drilldown" : "010" }, { + "drilldown" : "009", "name" : "009", - "y" : 79, - "drilldown" : "009" + "y" : 79 }, { - "name" : "008", "drilldown" : "008", - "y" : 82 + "y" : 82, + "name" : "008" }, { "y" : 71, - "drilldown" : "007", - "name" : "007" + "name" : "007", + "drilldown" : "007" }, { + "drilldown" : "006", "name" : "006", - "y" : 63, - "drilldown" : "006" + "y" : 63 }, { "drilldown" : "005", @@ -193,62 +198,44 @@ "name" : "005" }, { - "name" : "004", "drilldown" : "004", + "name" : "004", "y" : 106 }, { - "name" : "003", + "drilldown" : "003", "y" : 91, - "drilldown" : "003" + "name" : "003" }, { - "drilldown" : "002", + "name" : "002", "y" : 133, - "name" : "002" + "drilldown" : "002" }, { - "drilldown" : "001", "y" : 165, - "name" : "001" + "name" : "001", + "drilldown" : "001" } ] } ], - "tooltip" : { - "pointFormat" : "Challenge {point.name}: {point.y:f}
", - "headerFormat" : "", - "followPointer" : "true" - }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } - }, "plotOptions" : { "series" : { + "borderWidth" : 0, "dataLabels" : { "format" : "{point.y}", "enabled" : 1 - }, - "borderWidth" : 0 + } } }, - "legend" : { - "enabled" : "false" - }, - "title" : { - "text" : "The Weekly Challenge Language" - }, - "chart" : { - "type" : "column" - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2024-09-11 16:31:49 GMT" + "xAxis" : { + "type" : "category" }, "drilldown" : { "series" : [ { + "id" : "041", "data" : [ [ "Perl", @@ -263,11 +250,11 @@ 9 ] ], - "id" : "041", "name" : "041" }, { "id" : "040", + "name" : "040", "data" : [ [ "Perl", @@ -281,10 +268,10 @@ "Blog", 10 ] - ], - "name" : "040" + ] }, { + "id" : "039", "name" : "039", "data" : [ [ @@ -299,11 +286,10 @@ "Blog", 12 ] - ], - "id" : "039" + ] }, { - "id" : "038", + "name" : "038", "data" : [ [ "Perl", @@ -318,9 +304,11 @@ 12 ] ], - "name" : "038" + "id" : "038" }, { + "id" : "037", + "name" : "037", "data" : [ [ "Perl", @@ -334,12 +322,9 @@ "Blog", 9 ] - ], - "id" : "037", - "name" : "037" + ] }, { - "name" : "036", "data" : [ [ "Perl", @@ -354,10 +339,10 @@ 11 ] ], + "name" : "036", "id" : "036" }, { - "name" : "035", "data" : [ [ "Perl", @@ -372,11 +357,12 @@ 9 ] ], + "name" : "035", "id" : "035" }, { - "name" : "034", "id" : "034", + "name" : "034", "data" : [ [ "Perl", @@ -393,6 +379,7 @@ ] }, { + "id" : "033", "data" : [ [ "Perl", @@ -407,12 +394,9 @@ 10 ] ], - "id" : "033", "name" : "033" }, { - "name" : "032", - "id" : "032", "data" : [ [ "Perl", @@ -426,9 +410,12 @@ "Blog", 10 ] - ] + ], + "name" : "032", + "id" : "032" }, { + "id" : "031", "name" : "031", "data" : [ [ @@ -443,11 +430,9 @@ "Blog", 9 ] - ], - "id" : "031" + ] }, { - "name" : "030", "data" : [ [ "Perl", @@ -462,10 +447,10 @@ 10 ] ], + "name" : "030", "id" : "030" }, { - "id" : "029", "data" : [ [ "Perl", @@ -480,10 +465,12 @@ 12 ] ], - "name" : "029" + "name" : "029", + "id" : "029" }, { "id" : "028", + "name" : "028", "data" : [ [ "Perl", @@ -497,12 +484,10 @@ "Blog", 9 ] - ], - "name" : "028" + ] }, { "name" : "027", - "id" : "027", "data" : [ [ "Perl", @@ -516,10 +501,10 @@ "Blog", 9 ] - ] + ], + "id" : "027" }, { - "name" : "026", "id" : "026", "data" : [ [ @@ -534,10 +519,12 @@ "Blog", 10 ] - ] + ], + "name" : "026" }, { "id" : "025", + "name" : "025", "data" : [ [ "Perl", @@ -551,11 +538,11 @@ "Blog", 12 ] - ], - "name" : "025" + ] }, { "id" : "024", + "name" : "024", "data" : [ [ "Perl", @@ -569,11 +556,9 @@ "Blog", 11 ] - ], - "name" : "024" + ] }, { - "id" : "023", "data" : [ [ "Perl", @@ -588,9 +573,11 @@ 12 ] ], - "name" : "023" + "name" : "023", + "id" : "023" }, { + "name" : "022", "data" : [ [ "Perl", @@ -605,12 +592,9 @@ 10 ] ], - "id" : "022", - "name" : "022" + "id" : "022" }, { - "name" : "021", - "id" : "021", "data" : [ [ "Perl", @@ -624,9 +608,12 @@ "Blog", 10 ] - ] + ], + "name" : "021", + "id" : "021" }, { + "id" : "020", "data" : [ [ "Perl", @@ -641,11 +628,9 @@ 13 ] ], - "id" : "020", "name" : "020" }, { - "id" : "019", "data" : [ [ "Perl", @@ -660,9 +645,12 @@ 13 ] ], - "name" : "019" + "name" : "019", + "id" : "019" }, { + "id" : "018", + "name" : "018", "data" : [ [ "Perl", @@ -676,13 +664,11 @@ "Blog", 14 ] - ], - "id" : "018", - "name" : "018" + ] }, { - "name" : "017", "id" : "017", + "name" : "017", "data" : [ [ "Perl", @@ -699,6 +685,7 @@ ] }, { + "id" : "016", "data" : [ [ "Perl", @@ -713,10 +700,10 @@ 13 ] ], - "id" : "016", "name" : "016" }, { + "id" : "015", "name" : "015", "data" : [ [ @@ -731,12 +718,9 @@ "Blog", 15 ] - ], - "id" : "015" + ] }, { - "name" : "014", - "id" : "014", "data" : [ [ "Perl", @@ -750,9 +734,13 @@ "Blog", 15 ] - ] + ], + "name" : "014", + "id" : "014" }, { + "id" : "013", + "name" : "013", "data" : [ [ "Perl", @@ -766,12 +754,9 @@ "Blog", 13 ] - ], - "id" : "013", - "name" : "013" + ] }, { - "name" : "012", "data" : [ [ "Perl", @@ -786,9 +771,11 @@ 11 ] ], + "name" : "012", "id" : "012" }, { + "id" : "011", "name" : "011", "data" : [ [ @@ -803,8 +790,7 @@ "Blog", 10 ] - ], - "id" : "011" + ] }, { "data" : [ @@ -821,8 +807,8 @@ 11 ] ], - "id" : "010", - "name" : "010" + "name" : "010", + "id" : "010" }, { "id" : "009", @@ -843,6 +829,7 @@ "name" : "009" }, { + "id" : "008", "data" : [ [ "Perl", @@ -857,7 +844,6 @@ 12 ] ], - "id" : "008", "name" : "008" }, { @@ -875,11 +861,11 @@ 10 ] ], - "id" : "007", - "name" : "007" + "name" : "007", + "id" : "007" }, { - "id" : "006", + "name" : "006", "data" : [ [ "Perl", @@ -894,9 +880,10 @@ 7 ] ], - "name" : "006" + "id" : "006" }, { + "id" : "005", "data" : [ [ "Perl", @@ -911,11 +898,10 @@ 12 ] ], - "id" : "005", "name" : "005" }, { - "name" : "004", + "id" : "004", "data" : [ [ "Perl", @@ -930,10 +916,9 @@ 10 ] ], - "id" : "004" + "name" : "004" }, { - "id" : "003", "data" : [ [ "Perl", @@ -948,11 +933,12 @@ 9 ] ], - "name" : "003" + "name" : "003", + "id" : "003" }, { - "name" : "002", "id" : "002", + "name" : "002", "data" : [ [ "Perl", @@ -970,7 +956,6 @@ }, { "name" : "001", - "id" : "001", "data" : [ [ "Perl", @@ -984,8 +969,23 @@ "Blog", 12 ] - ] + ], + "id" : "001" } ] + }, + "subtitle" : { + "text" : "Click the columns to drilldown the language breakdown. Last updated at 2024-09-12 14:13:36 GMT" + }, + "tooltip" : { + "pointFormat" : "Challenge {point.name}: {point.y:f}
", + "followPointer" : "true", + "headerFormat" : "" + }, + "title" : { + "text" : "The Weekly Challenge Language" + }, + "legend" : { + "enabled" : "false" } } diff --git a/stats/pwc-language-breakdown-2020.json b/stats/pwc-language-breakdown-2020.json index e50af0a677..f4a8e5e18c 100644 --- a/stats/pwc-language-breakdown-2020.json +++ b/stats/pwc-language-breakdown-2020.json @@ -1,28 +1,20 @@ { - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } - }, "legend" : { "enabled" : "false" }, + "tooltip" : { + "pointFormat" : "Challenge {point.name}: {point.y:f}
", + "followPointer" : "true", + "headerFormat" : "" + }, "title" : { "text" : "The Weekly Challenge Language" }, - "chart" : { - "type" : "column" - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2024-09-11 16:31:49 GMT" - }, "drilldown" : { "series" : [ { + "id" : "093", + "name" : "093", "data" : [ [ "Perl", @@ -36,9 +28,7 @@ "Blog", 16 ] - ], - "id" : "093", - "name" : "093" + ] }, { "data" : [ @@ -55,12 +45,11 @@ 16 ] ], - "id" : "092", - "name" : "092" + "name" : "092", + "id" : "092" }, { "name" : "091", - "id" : "091", "data" : [ [ "Perl", @@ -74,10 +63,11 @@ "Blog", 16 ] - ] + ], + "id" : "091" }, { - "name" : "090", + "id" : "090", "data" : [ [ "Perl", @@ -92,11 +82,11 @@ 17 ] ], - "id" : "090" + "name" : "090" }, { - "name" : "089", "id" : "089", + "name" : "089", "data" : [ [ "Perl", @@ -131,8 +121,8 @@ "id" : "088" }, { - "name" : "087", "id" : "087", + "name" : "087", "data" : [ [ "Perl", @@ -149,6 +139,8 @@ ] }, { + "id" : "086", + "name" : "086", "data" : [ [ "Perl", @@ -162,13 +154,11 @@ "Blog", 15 ] - ], - "id" : "086", - "name" : "086" + ] }, { - "name" : "085", "id" : "085", + "name" : "085", "data" : [ [ "Perl", @@ -185,7 +175,6 @@ ] }, { - "id" : "084", "data" : [ [ "Perl", @@ -200,11 +189,12 @@ 12 ] ], - "name" : "084" + "name" : "084", + "id" : "084" }, { - "name" : "083", "id" : "083", + "name" : "083", "data" : [ [ "Perl", @@ -239,7 +229,7 @@ "id" : "082" }, { - "name" : "081", + "id" : "081", "data" : [ [ "Perl", @@ -254,9 +244,11 @@ 15 ] ], - "id" : "081" + "name" : "081" }, { + "id" : "080", + "name" : "080", "data" : [ [ "Perl", @@ -270,9 +262,7 @@ "Blog", 16 ] - ], - "id" : "080", - "name" : "080" + ] }, { "data" : [ @@ -289,12 +279,11 @@ 17 ] ], -