From 076f607237207a664b5cbb8b525f1f91a7d43da9 Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Tue, 25 Aug 2020 20:03:13 +0800 Subject: use linux terminal instead of web interface --- challenge-075/cheok-yin-fung/java/histogram.class | Bin 0 -> 1020 bytes challenge-075/cheok-yin-fung/java/histogram.java | 47 ++++++++++++ challenge-075/cheok-yin-fung/perl/ch-1.pl | 59 ++++++++++++++ challenge-075/cheok-yin-fung/perl/ch-2.pl | 89 ++++++++++++++++++++++ challenge-075/cheok-yin-fung/python/ch-2.py | 88 +++++++++++++++++++++ 5 files changed, 283 insertions(+) create mode 100644 challenge-075/cheok-yin-fung/java/histogram.class create mode 100644 challenge-075/cheok-yin-fung/java/histogram.java create mode 100644 challenge-075/cheok-yin-fung/perl/ch-1.pl create mode 100644 challenge-075/cheok-yin-fung/perl/ch-2.pl create mode 100644 challenge-075/cheok-yin-fung/python/ch-2.py diff --git a/challenge-075/cheok-yin-fung/java/histogram.class b/challenge-075/cheok-yin-fung/java/histogram.class new file mode 100644 index 0000000000..5c03517559 Binary files /dev/null and b/challenge-075/cheok-yin-fung/java/histogram.class differ diff --git a/challenge-075/cheok-yin-fung/java/histogram.java b/challenge-075/cheok-yin-fung/java/histogram.java new file mode 100644 index 0000000000..78a29565b0 --- /dev/null +++ b/challenge-075/cheok-yin-fung/java/histogram.java @@ -0,0 +1,47 @@ +import java.util.Scanner; + +// not yet produce the "image" of histogram, 25th Aug + +public class histogram { + static public void main(String[] args) { + int maxarea = 0; + // int[] A = new int[] {3, 2, 3, 5, 7, 5}; + // int[] A = new int[] {2, 1, 4, 5, 3, 7}; + // int[] A = new int[] {1, 2, 3, 4, 5}; + Scanner scn = new Scanner(System.in); + System.out.println("Input number of items of the histogram:"); + int size = scn.nextInt(); + int[] A = new int[size]; + System.out.println("Input items of the histogram:"); + for (int k = 0; k < size; k++) { + A[k] = scn.nextInt(); + } + for (int winsize = 1; winsize <= A.length; winsize++) { + for (int i = 0; i+winsize-1 < A.length; i++) { + int area; + int minele = 128; + int[] Baby = new int[winsize]; + for (int j = 0; j < winsize; j++) { + Baby[j] = A[i+j]; + if (Baby[j] < minele) { + minele = Baby[j]; + } + } + area = winsize*minele; +// the followings need import java.util.Arrays and java.util.Collections +// List b = arrays.asList(ArrayUtils.toObject(Baby)); +// area = winsize*(Collections.min(b)); + if (area>maxarea) { + maxarea = area; + } + } + } + System.out.println(maxarea); + + } +} + + +// references: +// https://stackoverflow.com/questions/2795350/how-to-put-a-scanner-input-into-an-array-for-example-a-couple-of-numbers +// https://stackoverflow.com/questions/1484347/finding-the-max-min-value-in-an-array-of-primitives-using-java diff --git a/challenge-075/cheok-yin-fung/perl/ch-1.pl b/challenge-075/cheok-yin-fung/perl/ch-1.pl new file mode 100644 index 0000000000..53929b0a6e --- /dev/null +++ b/challenge-075/cheok-yin-fung/perl/ch-1.pl @@ -0,0 +1,59 @@ +#!/usr/bin/perl +# Perl Weekly Challenge #075 Task 1 Coins Sum +# task statement: +# You are given a set of coins @C, assuming you have +# infinite amount of each coin in the set. +# Write a script to find how many ways you make +# sum $S using the coins from the set @C. +# Usage: ch-1.pl $S @C +use strict; +use warnings; +#use Test::More tests => 3; +use Integer::Partition; + +sub subarray { + my @coins = @{$_[0]}; + my @partition = @{$_[1]}; + my $ans = 1; + my $psize = scalar @partition; + my %ecoins; + for (@coins) { + $ecoins{$_} = 1; + } + my $i = 0; + while ($ans && ($i < $psize)) { + $ans = $ans && exists $ecoins{$partition[$i]}; + $i++; + } + return $ans; +} + +sub main { + my ($sum, @coins) = @_; + my @out = (); + my $objIP = Integer::Partition->new($sum , {lexicographic => 1}); + while (my $p = $objIP->next) { + my @p_order = reverse @$p; + if (subarray(\@coins, \@p_order)) { + push @out, \@p_order; + print join ' ', @p_order; + print "\n"; + } + } + print "\n"; + return scalar @out; +} + +my $S; +my @C; + +if ($ARGV[1]) {$S = shift @ARGV; @C = @ARGV;} else {$S = 3; @C = (1,2);} + +print "total number of ways: ", main($S, @C); +print "\n"; + +=pod +ok main(6, 1, 2, 4) == 6, "test 1"; +ok main(5, 1, 2, 3, 5) == 6, "test 2"; +ok main(5, 1, 2, 3, 4, 5) == 7, "test 3"; +=cut diff --git a/challenge-075/cheok-yin-fung/perl/ch-2.pl b/challenge-075/cheok-yin-fung/perl/ch-2.pl new file mode 100644 index 0000000000..1660ce5c18 --- /dev/null +++ b/challenge-075/cheok-yin-fung/perl/ch-2.pl @@ -0,0 +1,89 @@ +#!/usr/bin/perl +# Perl Weekly Challenge #075 Task 2 Largest Rectangle Histogram +# Usage: ch-2.pl [ARRAY] +#use Test::Simple tests=>2; +use List::Util qw/max/; +use strict; +use warnings; + +my @A; + +if (@ARGV) {@A = @ARGV;} else {@A = (3, 2, 3, 5, 7, 5);} + +sub subtract1 { + my @in = @_; + my @temp = map { $_ != 0 ? $_-1 : 0 } @in; + return @temp; +} + +sub subtract_to_max { + my @in = @{$_[0]}; + my $MAX_ = max @in; + my @out = (\@in); + my @temp = @in; + for (1..$MAX_-1) { + @temp = subtract1 @temp; + my @newa = @temp; + unshift @out, \@newa; + } + return @out; +} + + +sub print_A { + my $MAX_ = max @A; + my $i = $MAX_; + for (subtract_to_max(\@A)) { + my @in = @{$_}; + print "$i "; + print join " ", map { $_ != 0 ? "#" : " " } @in; + print "\n"; + $i--; + } + print "_ " for @A; + print "_ \n "; + print join " ", @A; + print "\n"; +} + +sub lrh { + my @histogram = subtract_to_max(\@_); + my $length = scalar @_; + my %areas; + my $MAX_ = max @_; + + for my $i (0..$MAX_-1) { + my $j = 0; + my ($h, $t); #head, tail + while ($j < $length) { + if ($histogram[$i][$j] != 0) { + $h = $j; + for (my $k=$j ; ($k < $length) && ($histogram[$i][$k] != 0) ;$k++) { + $t = $k; + $j++; + } + } + if ( defined($h) && defined($t)) { if(!exists $areas{"$h,$t"}) { + $areas{"$h,$t"} = ($t-$h+1)*($MAX_-$i); + # MORE COMMENTS FOR THE FINAL VERSION + # print "line ", $MAX_-$i, ": [$h..$t]", "\n"; + # print " length * $MAX_-$i = ", $areas{"$h,$t"}; + # print "\n"; + }} + $j++; + + } + } + + return max values %areas; +} + +print_A; +print "\n"; +print lrh(@A); +print "\n"; + +=pod +ok ( lrh(2, 1, 4, 5, 3, 7) == 12 ), "example 1" ; +ok ( lrh(3, 2, 3, 5, 7, 5) == 15 ), "example 2" ; +=cut diff --git a/challenge-075/cheok-yin-fung/python/ch-2.py b/challenge-075/cheok-yin-fung/python/ch-2.py new file mode 100644 index 0000000000..c255971db0 --- /dev/null +++ b/challenge-075/cheok-yin-fung/python/ch-2.py @@ -0,0 +1,88 @@ +# Python3 +# Perl Weekly Challenge #075 Task 2 Largest Rectangle Histogram , Python script + +# A = [3, 2, 3, 5, 7, 5] +# A = [2, 1, 4, 3, 5, 7] +# A = [1, 2, 3, 4, 5] + + +length = int(input("Enter number of items of the histogram: \n")) +print("Enter items of the histogram with line breaks") +A = [] +for i in range(length): + A.append(int(input())) + +MAX_ = max(A) +#length = len(A) + +def subtract1(n): + if n > 0: + r = n-1 + else: + r = 0 + return r + +temp = A +temp.append(0) # put a zero at the end for ease + +histogram = [] +pair = [] +areas = [] + +for i in range(MAX_): + histogram.append(temp) + temp = list(map(subtract1, temp)) + +histogram = histogram[::-1] + + + +for i in range(MAX_): + j = 0 + while j < length: + if histogram[i][j] != 0: + h = j + k = j + while True: + t = k + j = j+1 + k = k+1 + if histogram[i][k] == 0: + break + if not([h,t] in pair): + areas.append( (t-h+1)*(MAX_-i) ) + pair.append([h,t]) + j = j+1 + histogram[i].pop(-1) #pop out the assisting zero + + +print("Answer:") +print(max(areas)) +print() + +def zeroornumsign(x): + if x > 0: + return "#" + else: + return " " + +def print_A(): + for i in range( MAX_ ): + print(MAX_-i, end=' ') + templine = list(map(zeroornumsign, histogram[i])); + for j in range(length): + print(templine[j], end=' ') + print() + print(' ', end='') + print("_ " * length) + print(' ', end='') + for i in range(length): + print(str(A[i]), end=' ') + print() + +print_A(); + +#references: +#https://www.csestack.org/unique-elements-from-list-in-python/ +#https://coderwall.com/p/q_rd1q/emulate-do-while-loop-in-python +#https://coderwall.com/p/uhskuq/reverse-array-in-python -- cgit From 3560a64821237620d87e517eaab67ca2dd94bb17 Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Tue, 25 Aug 2020 23:18:14 +0800 Subject: edit Python codes; thanks data-scientist Clare --- challenge-075/cheok-yin-fung/python/ch-2.py | 130 +++++++++++++--------------- 1 file changed, 60 insertions(+), 70 deletions(-) diff --git a/challenge-075/cheok-yin-fung/python/ch-2.py b/challenge-075/cheok-yin-fung/python/ch-2.py index c255971db0..a13f885563 100644 --- a/challenge-075/cheok-yin-fung/python/ch-2.py +++ b/challenge-075/cheok-yin-fung/python/ch-2.py @@ -1,74 +1,57 @@ # Python3 # Perl Weekly Challenge #075 Task 2 Largest Rectangle Histogram , Python script +# test cases: +# items = [3, 2, 3, 5, 7, 5] --> 15 +# items = [2, 1, 4, 3, 5, 7] --> 12 +# items = [1, 2, 3, 4, 5] --> 9 -# A = [3, 2, 3, 5, 7, 5] -# A = [2, 1, 4, 3, 5, 7] -# A = [1, 2, 3, 4, 5] - - -length = int(input("Enter number of items of the histogram: \n")) -print("Enter items of the histogram with line breaks") -A = [] -for i in range(length): - A.append(int(input())) - -MAX_ = max(A) -#length = len(A) - -def subtract1(n): - if n > 0: - r = n-1 - else: - r = 0 - return r - -temp = A -temp.append(0) # put a zero at the end for ease - -histogram = [] -pair = [] -areas = [] - -for i in range(MAX_): - histogram.append(temp) - temp = list(map(subtract1, temp)) - -histogram = histogram[::-1] - - - -for i in range(MAX_): - j = 0 - while j < length: - if histogram[i][j] != 0: - h = j - k = j - while True: - t = k - j = j+1 - k = k+1 - if histogram[i][k] == 0: - break - if not([h,t] in pair): - areas.append( (t-h+1)*(MAX_-i) ) - pair.append([h,t]) - j = j+1 - histogram[i].pop(-1) #pop out the assisting zero - - -print("Answer:") -print(max(areas)) -print() - -def zeroornumsign(x): - if x > 0: - return "#" - else: - return " " - -def print_A(): - for i in range( MAX_ ): - print(MAX_-i, end=' ') +def largest_rectangle_histogram(items): + max_item = max(items) + + subtract1 = lambda n: n-1 if n > 0 else 0 + + temp = items + temp = temp + [0] # put a zero at the end for ease + + histogram = [] + pair = [] + areas = [] + + for i in range(max_item): + histogram.append(temp) + temp = list(map(subtract1, temp)) + + histogram = histogram[::-1] + + + + for i in range(max_item): + j = 0 + while j < length: + if histogram[i][j] != 0: + h = j + k = j + while True: + t = k + j = j+1 + k = k+1 + if histogram[i][k] == 0: + break + if not([h,t] in pair): + areas.append( (t-h+1)*(max_item-i) ) + pair.append([h,t]) + j = j+1 + histogram[i].pop(-1) #pop out the assisting zero + + + print("Answer:") + print(max(areas)) + print() + + + zeroornumsign = lambda x: "#" if x > 0 else " " + for i in range( max_item ): + print(max_item-i, end=' ') templine = list(map(zeroornumsign, histogram[i])); for j in range(length): print(templine[j], end=' ') @@ -77,10 +60,17 @@ def print_A(): print("_ " * length) print(' ', end='') for i in range(length): - print(str(A[i]), end=' ') + print(str(items[i]), end=' ') print() -print_A(); + +if __name__ == "__main__": + length = int(input("Enter number of items of the histogram: \n")) + print("Enter items of the histogram with line breaks") + items = [] + for i in range(length): + items.append(int(input())) + largest_rectangle_histogram(items) #references: #https://www.csestack.org/unique-elements-from-list-in-python/ -- cgit From 2b008e13c55c5684b84b97a432644bdce52b2dac Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Wed, 26 Aug 2020 05:30:53 +0800 Subject: ch-1.py --- challenge-075/cheok-yin-fung/python/ch-1.py | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 challenge-075/cheok-yin-fung/python/ch-1.py diff --git a/challenge-075/cheok-yin-fung/python/ch-1.py b/challenge-075/cheok-yin-fung/python/ch-1.py new file mode 100644 index 0000000000..b933614797 --- /dev/null +++ b/challenge-075/cheok-yin-fung/python/ch-1.py @@ -0,0 +1,58 @@ +# Python3 +# Perl Weekly Challenge #075 Task 1 Coins Sum, Python script + +# coins = [1, 2, 3, 5] +# total = 5 +# --> len(arr_for_dp[total]) == 6 + +# coins = [1, 2, 3, 4, 5] +# total = 5 +# --> len(arr_for_dp[total]) == 7 + +def coins_sum(uinput): + userinput = list(uinput).copy() + total = userinput.pop(0) + coins = userinput + dp_range = [] + arr_for_dp = [ [] ] + + for i_ in range(total): + dp_range.append(i_ + 1) + + + j = 0 + for i in dp_range: + if i == coins[j]: + arr_for_dp.append([ [coins[j]] ]) + if j < len(coins)-1: + j = j+1 + else: + arr_for_dp.append([]) + + for i in dp_range: + for k in range(len(coins)): + if (i-coins[k] > 0): + for p in range(len(arr_for_dp[i-coins[k]])): + partition = arr_for_dp[i-coins[k]][p] + partition_p = list(partition).copy() + partition_p.append(coins[k]) + partition_p = sorted(partition_p) + if not(partition_p in arr_for_dp[i]): + arr_for_dp[i].append(list(partition_p).copy()) + + return arr_for_dp[total] + + +if __name__ == "__main__": + target = int(input("Enter the sum: \n")) + urinput = [target] + coins_sum_len = int(input("Enter number of varieties of coins:\n")) + print("Enter the value of coins with line breaks") + for i in range(coins_sum_len): + urinput.append(int(input())) + + ans = coins_sum( urinput ) + print("===================") + for item in ans: + print(item) + print("answer: ", len(ans)) -- cgit From adc3b4ab064e604f1e7d360e8ff3ad152dfaaa37 Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Wed, 26 Aug 2020 09:51:25 +0800 Subject: Java for Task 1 and clean up ch-2.pl --- challenge-075/cheok-yin-fung/java/coinssum.class | Bin 0 -> 1764 bytes challenge-075/cheok-yin-fung/java/coinssum.java | 90 +++++++++++++++++++++++ challenge-075/cheok-yin-fung/perl/ch-2.pl | 8 +- 3 files changed, 92 insertions(+), 6 deletions(-) create mode 100644 challenge-075/cheok-yin-fung/java/coinssum.class create mode 100644 challenge-075/cheok-yin-fung/java/coinssum.java diff --git a/challenge-075/cheok-yin-fung/java/coinssum.class b/challenge-075/cheok-yin-fung/java/coinssum.class new file mode 100644 index 0000000000..ed67045e6a Binary files /dev/null and b/challenge-075/cheok-yin-fung/java/coinssum.class differ diff --git a/challenge-075/cheok-yin-fung/java/coinssum.java b/challenge-075/cheok-yin-fung/java/coinssum.java new file mode 100644 index 0000000000..23a408fe5a --- /dev/null +++ b/challenge-075/cheok-yin-fung/java/coinssum.java @@ -0,0 +1,90 @@ +// # Perl Weekly Challenge #075 Task 1 Coins Sum, Java Program +// task statement: +// You are given a set of coins @C, assuming you have +// infinite amount of each coin in the set. +// Write a script to find how many ways you make +// sum $S using the coins from the set @C. + + +import java.util.Scanner; +import java.util.ArrayList; +import java.util.Vector; +import java.util.Collections; +import java.util.Arrays; + +public class coinssum { + static public void main(String[] args) { + // int[] coins = new int[] {1, 2, 4}; + // int total = 5; + + Scanner scn = new Scanner(System.in); + System.out.println("Input expected sum of coins:"); + int total = scn.nextInt(); + System.out.println("Input number of varieties of coins:"); + int size = scn.nextInt(); + int[] coins = new int[size]; + System.out.println("Input values of the coins:"); + for (int k = 0; k < size; k++) { + coins[k] = scn.nextInt(); + } + + + + ArrayList[] arr_for_dp = new ArrayList[total+1]; + + int j = 0; + for (int i=0; i <= total; i++) { + arr_for_dp[i] = new ArrayList(); + if (i == coins[j]) { + Vector temp = new Vector(); + temp.addElement(new Integer(coins[j])); + arr_for_dp[i].add( temp ); + if (j < coins.length-1) { + j++; + } + } + } + + for (int i=0; i<=total; i++) { + for (int k=0; k < coins.length; k++) { + if (i-coins[k] > 0) { + for (int p=0; p < arr_for_dp[i-coins[k]].size(); p++) { + Vector partition = arr_for_dp[i-coins[k]].get(p); + Vector partition_p = new Vector(); + partition_p = (Vector)partition.clone(); + partition_p.addElement(coins[k]); + Collections.sort(partition_p); + if ((!arr_for_dp[i].contains(partition_p))) { + arr_for_dp[i].add(partition_p); + } + + } + } + } + } + + + int ans = arr_for_dp[total].size(); + if ( ans > 0) { + for (int f=0; f Date: Thu, 27 Aug 2020 03:50:04 +0800 Subject: edit ch-1.py by advice from friend; complete histogram.java --- challenge-075/cheok-yin-fung/java/histogram.class | Bin 1020 -> 1852 bytes challenge-075/cheok-yin-fung/java/histogram.java | 37 ++++++++++++++++++++-- challenge-075/cheok-yin-fung/python/ch-1.py | 20 ++++++------ 3 files changed, 43 insertions(+), 14 deletions(-) diff --git a/challenge-075/cheok-yin-fung/java/histogram.class b/challenge-075/cheok-yin-fung/java/histogram.class index 5c03517559..83eefe0814 100644 Binary files a/challenge-075/cheok-yin-fung/java/histogram.class and b/challenge-075/cheok-yin-fung/java/histogram.class differ diff --git a/challenge-075/cheok-yin-fung/java/histogram.java b/challenge-075/cheok-yin-fung/java/histogram.java index 78a29565b0..cd5c66d844 100644 --- a/challenge-075/cheok-yin-fung/java/histogram.java +++ b/challenge-075/cheok-yin-fung/java/histogram.java @@ -1,10 +1,9 @@ import java.util.Scanner; -// not yet produce the "image" of histogram, 25th Aug - public class histogram { static public void main(String[] args) { int maxarea = 0; + int max_element = 0; // int[] A = new int[] {3, 2, 3, 5, 7, 5}; // int[] A = new int[] {2, 1, 4, 5, 3, 7}; // int[] A = new int[] {1, 2, 3, 4, 5}; @@ -15,6 +14,9 @@ public class histogram { System.out.println("Input items of the histogram:"); for (int k = 0; k < size; k++) { A[k] = scn.nextInt(); + if (A[k] > max_element) { + max_element = A[k]; + } } for (int winsize = 1; winsize <= A.length; winsize++) { for (int i = 0; i+winsize-1 < A.length; i++) { @@ -36,12 +38,41 @@ public class histogram { } } } - System.out.println(maxarea); + + System.out.println("\n"+maxarea + "\n"); + + // print the histogram + + for (int r = max_element; r > 0; r--) { + System.out.print(r+" "); + for (int k = 0; k < size; k++) { + char temp; + if (A[k] >= r) { + temp = '#'; + } else { + temp = ' '; + } + System.out.print(temp+" "); + } + + System.out.println(); + } + System.out.print("_ "); + for (int s = 0; s < size; s++) { + System.out.print("_ "); + } + System.out.println(); + System.out.print(" "); + for (int k = 0; k < size; k++) { + System.out.print(A[k]+" "); + } + System.out.println(); } } // references: +// textbook // https://stackoverflow.com/questions/2795350/how-to-put-a-scanner-input-into-an-array-for-example-a-couple-of-numbers // https://stackoverflow.com/questions/1484347/finding-the-max-min-value-in-an-array-of-primitives-using-java diff --git a/challenge-075/cheok-yin-fung/python/ch-1.py b/challenge-075/cheok-yin-fung/python/ch-1.py index b933614797..b38387f019 100644 --- a/challenge-075/cheok-yin-fung/python/ch-1.py +++ b/challenge-075/cheok-yin-fung/python/ch-1.py @@ -10,15 +10,14 @@ # --> len(arr_for_dp[total]) == 7 def coins_sum(uinput): - userinput = list(uinput).copy() + userinput = uinput total = userinput.pop(0) coins = userinput dp_range = [] arr_for_dp = [ [] ] - for i_ in range(total): - dp_range.append(i_ + 1) - + dp_range = list((range(1,total+1))) + print(dp_range) j = 0 for i in dp_range: @@ -34,23 +33,22 @@ def coins_sum(uinput): if (i-coins[k] > 0): for p in range(len(arr_for_dp[i-coins[k]])): partition = arr_for_dp[i-coins[k]][p] - partition_p = list(partition).copy() + partition_p = partition.copy() partition_p.append(coins[k]) partition_p = sorted(partition_p) if not(partition_p in arr_for_dp[i]): - arr_for_dp[i].append(list(partition_p).copy()) + arr_for_dp[i].append(partition_p.copy()) return arr_for_dp[total] if __name__ == "__main__": + urinput = []; target = int(input("Enter the sum: \n")) - urinput = [target] - coins_sum_len = int(input("Enter number of varieties of coins:\n")) - print("Enter the value of coins with line breaks") - for i in range(coins_sum_len): - urinput.append(int(input())) + set_of_coins = [int(x) for x in input("Enter the value of coins with spaces seperated:\n").split()] + urinput = [target] + set_of_coins; + print(urinput) ans = coins_sum( urinput ) print("===================") for item in ans: -- cgit From e416ce4a181c7f91caa4f5ca7a238374a2bc4a4f Mon Sep 17 00:00:00 2001 From: Lubos Kolouch Date: Fri, 28 Aug 2020 14:13:18 +0200 Subject: Challenge 075 Task 2 solutions LK Perl Python --- challenge-075/lubos-kolouch/perl/ch-2.pl | 71 ++++++++++++++++++++++++++++++ challenge-075/lubos-kolouch/python/ch-2.py | 62 ++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 challenge-075/lubos-kolouch/perl/ch-2.pl create mode 100644 challenge-075/lubos-kolouch/python/ch-2.py diff --git a/challenge-075/lubos-kolouch/perl/ch-2.pl b/challenge-075/lubos-kolouch/perl/ch-2.pl new file mode 100644 index 0000000000..bbf03742ba --- /dev/null +++ b/challenge-075/lubos-kolouch/perl/ch-2.pl @@ -0,0 +1,71 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use List::Util qw/max/; +use feature qw/say/; +# Perl Weekly challenge 075 Task 2 - Largest histogram + + +sub printHistogram { + my $histogram = shift; + + my $hist_max = max(@$histogram); + my $out_str; + + for my $i (reverse 1..$hist_max) { + $out_str = $i; + + for my $bar (@$histogram) { + $out_str .= $bar >= $i? '#' : ' ' + } + + say $out_str; + + } + + $out_str = '_'; + $out_str .= '_' x scalar @$histogram; + + say $out_str; + + $out_str = ' '; + $out_str .= $_ for (@$histogram); + + say $out_str; +} + +sub largestRectangle { + my $histogram = shift; + + my @stack; + my $max_area = 0; + my $index = 0; + + while ($index < scalar @$histogram) { + if ( (not @stack) or ($histogram->[$stack[-1]] <= $histogram->[$index]) ) { + push @stack, $index; + $index ++; + } else { + my $top_of_stack = pop @stack; + my $area = @stack ? $histogram->[$top_of_stack] * ($index - $stack[-1] - 1) : $index; + + $max_area = max($max_area, $area); + } + } + + while (@stack) { + my $top_of_stack = pop @stack; + my $area = @stack ? $histogram->[$top_of_stack] * ($index - $stack[-1] - 1) : $index; + + $max_area = max($max_area, $area); + } + printHistogram($histogram); + + return $max_area; +} + +use Test::More; + +is(largestRectangle([2, 1, 4, 5, 3, 7]), 12); +is(largestRectangle([3, 2, 3, 5, 7, 5]), 15); + diff --git a/challenge-075/lubos-kolouch/python/ch-2.py b/challenge-075/lubos-kolouch/python/ch-2.py new file mode 100644 index 0000000000..306bcae7c3 --- /dev/null +++ b/challenge-075/lubos-kolouch/python/ch-2.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +""" Perl Weekly challenge 075 Task 2 - Largest histogram """ + + +def printHistogram(histogram): + """ print the histogram """ + + hist_max = max(histogram) + + for i in range(hist_max, 0, -1): + my_str = str(i) + + for bar in histogram: + my_str += '#' if bar >= i else ' ' + + print(my_str) + + my_str = '_' + for _ in histogram: + my_str += '_' + + print(my_str) + + my_str = ' ' + for item in histogram: + my_str += str(item) + + print(my_str) + +def largestRectangle(histogram): + stack = list() + max_area = 0 + index = 0 + + while index < len(histogram): + if (not stack) or (histogram[stack[-1]] <= histogram[index]): + stack.append(index) + index += 1 + else: + top_of_stack = stack.pop() + area = (histogram[top_of_stack] * ((index - stack[-1] - 1) + if stack else index)) + + max_area = max(max_area, area) + + while stack: + + top_of_stack = stack.pop() + + area = (histogram[top_of_stack] * ((index - stack[-1] - 1) + if stack else index)) + + max_area = max(max_area, area) + + printHistogram(histogram) + + return max_area + + +assert largestRectangle([2, 1, 4, 5, 3, 7]) == 12 +assert largestRectangle([3, 2, 3, 5, 7, 5]) == 15 + -- cgit From 4e01dc493388e093a1b638b3001eb17fa86a16e0 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Fri, 28 Aug 2020 13:16:54 +0100 Subject: - Added solutions by Lubos Kolouch. --- stats/pwc-current.json | 332 ++++++------- stats/pwc-language-breakdown-summary.json | 60 +-- stats/pwc-language-breakdown.json | 544 +++++++++++----------- stats/pwc-leaders.json | 748 +++++++++++++++--------------- stats/pwc-summary-1-30.json | 126 ++--- stats/pwc-summary-121-150.json | 122 ++--- stats/pwc-summary-151-180.json | 54 +-- stats/pwc-summary-181-210.json | 42 +- stats/pwc-summary-31-60.json | 40 +- stats/pwc-summary-61-90.json | 126 ++--- stats/pwc-summary-91-120.json | 46 +- stats/pwc-summary.json | 410 ++++++++-------- 12 files changed, 1325 insertions(+), 1325 deletions(-) diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 6690fd16d5..6ed264c4d9 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,116 +1,227 @@ { - "plotOptions" : { - "series" : { - "dataLabels" : { - "format" : "{point.y}", - "enabled" : 1 - }, - "borderWidth" : 0 - } + "chart" : { + "type" : "column" }, - "subtitle" : { - "text" : "[Champions: 20] Last updated at 2020-08-28 11:25:02 GMT" + "xAxis" : { + "type" : "category" }, "title" : { "text" : "Perl Weekly Challenge - 075" }, - "chart" : { - "type" : "column" - }, "yAxis" : { "title" : { "text" : "Total Solutions" } }, - "xAxis" : { - "type" : "category" - }, "tooltip" : { - "pointFormat" : "{point.name}: {point.y:f}
", + "headerFormat" : "{series.name}
", "followPointer" : 1, - "headerFormat" : "{series.name}
" + "pointFormat" : "{point.name}: {point.y:f}
" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + }, + "subtitle" : { + "text" : "[Champions: 20] Last updated at 2020-08-28 12:16:41 GMT" + }, + "series" : [ + { + "colorByPoint" : 1, + "name" : "Perl Weekly Challenge - 075", + "data" : [ + { + "drilldown" : "Alex Mauney", + "y" : 2, + "name" : "Alex Mauney" + }, + { + "name" : "Alexander Pankoff", + "y" : 2, + "drilldown" : "Alexander Pankoff" + }, + { + "drilldown" : "Dave Jacoby", + "name" : "Dave Jacoby", + "y" : 2 + }, + { + "name" : "E. Choroba", + "y" : 2, + "drilldown" : "E. Choroba" + }, + { + "drilldown" : "James Smith", + "name" : "James Smith", + "y" : 2 + }, + { + "drilldown" : "Jason Messer", + "y" : 2, + "name" : "Jason Messer" + }, + { + "drilldown" : "Jorg Sommrey", + "y" : 2, + "name" : "Jorg Sommrey" + }, + { + "y" : 2, + "name" : "Lubos Kolouch", + "drilldown" : "Lubos Kolouch" + }, + { + "y" : 4, + "name" : "Luca Ferrari", + "drilldown" : "Luca Ferrari" + }, + { + "drilldown" : "Mark Anderson", + "y" : 2, + "name" : "Mark Anderson" + }, + { + "drilldown" : "Markus Holzer", + "y" : 2, + "name" : "Markus Holzer" + }, + { + "y" : 5, + "name" : "Mohammad S Anwar", + "drilldown" : "Mohammad S Anwar" + }, + { + "drilldown" : "Myoungjin Jeon", + "y" : 4, + "name" : "Myoungjin Jeon" + }, + { + "drilldown" : "Nuno Vieira", + "y" : 2, + "name" : "Nuno Vieira" + }, + { + "name" : "Pete Houston", + "y" : 2, + "drilldown" : "Pete Houston" + }, + { + "drilldown" : "Roger Bell_West", + "name" : "Roger Bell_West", + "y" : 5 + }, + { + "name" : "Simon Green", + "y" : 3, + "drilldown" : "Simon Green" + }, + { + "name" : "Simon Proctor", + "y" : 2, + "drilldown" : "Simon Proctor" + }, + { + "drilldown" : "Ulrich Rieke", + "y" : 2, + "name" : "Ulrich Rieke" + }, + { + "drilldown" : "Walt Mankowski", + "name" : "Walt Mankowski", + "y" : 3 + } + ] + } + ], + "legend" : { + "enabled" : 0 }, "drilldown" : { "series" : [ { + "name" : "Alex Mauney", "data" : [ [ "Perl", 2 ] ], - "name" : "Alex Mauney", "id" : "Alex Mauney" }, { + "name" : "Alexander Pankoff", "data" : [ [ "Perl", 2 ] ], - "name" : "Alexander Pankoff", "id" : "Alexander Pankoff" }, { - "id" : "Dave Jacoby", "name" : "Dave Jacoby", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Dave Jacoby" }, { - "name" : "E. Choroba", "id" : "E. Choroba", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "E. Choroba" }, { "id" : "James Smith", - "name" : "James Smith", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "James Smith" }, { + "id" : "Jason Messer", + "name" : "Jason Messer", "data" : [ [ "Raku", 2 ] - ], - "id" : "Jason Messer", - "name" : "Jason Messer" + ] }, { - "id" : "Jorg Sommrey", "name" : "Jorg Sommrey", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Jorg Sommrey" }, { "data" : [ [ "Perl", - 1 + 2 ] ], - "id" : "Lubos Kolouch", - "name" : "Lubos Kolouch" + "name" : "Lubos Kolouch", + "id" : "Lubos Kolouch" }, { "id" : "Luca Ferrari", @@ -128,25 +239,26 @@ }, { "id" : "Mark Anderson", - "name" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ] + ], + "name" : "Mark Anderson" }, { - "id" : "Markus Holzer", - "name" : "Markus Holzer", "data" : [ [ "Raku", 2 ] - ] + ], + "name" : "Markus Holzer", + "id" : "Markus Holzer" }, { + "name" : "Mohammad S Anwar", "data" : [ [ "Perl", @@ -161,12 +273,10 @@ 1 ] ], - "name" : "Mohammad S Anwar", "id" : "Mohammad S Anwar" }, { "name" : "Myoungjin Jeon", - "id" : "Myoungjin Jeon", "data" : [ [ "Perl", @@ -176,7 +286,8 @@ "Raku", 2 ] - ] + ], + "id" : "Myoungjin Jeon" }, { "data" : [ @@ -185,8 +296,8 @@ 2 ] ], - "id" : "Nuno Vieira", - "name" : "Nuno Vieira" + "name" : "Nuno Vieira", + "id" : "Nuno Vieira" }, { "id" : "Pete Houston", @@ -199,8 +310,6 @@ ] }, { - "name" : "Roger Bell_West", - "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -214,11 +323,12 @@ "Blog", 1 ] - ] + ], + "name" : "Roger Bell_West", + "id" : "Roger Bell_West" }, { "id" : "Simon Green", - "name" : "Simon Green", "data" : [ [ "Perl", @@ -228,29 +338,31 @@ "Blog", 1 ] - ] + ], + "name" : "Simon Green" }, { - "id" : "Simon Proctor", - "name" : "Simon Proctor", "data" : [ [ "Raku", 2 ] - ] + ], + "name" : "Simon Proctor", + "id" : "Simon Proctor" }, { + "name" : "Ulrich Rieke", "data" : [ [ "Perl", 2 ] ], - "name" : "Ulrich Rieke", "id" : "Ulrich Rieke" }, { + "id" : "Walt Mankowski", "data" : [ [ "Perl", @@ -261,120 +373,8 @@ 1 ] ], - "name" : "Walt Mankowski", - "id" : "Walt Mankowski" + "name" : "Walt Mankowski" } ] - }, - "series" : [ - { - "data" : [ - { - "drilldown" : "Alex Mauney", - "name" : "Alex Mauney", - "y" : 2 - }, - { - "y" : 2, - "name" : "Alexander Pankoff", - "drilldown" : "Alexander Pankoff" - }, - { - "drilldown" : "Dave Jacoby", - "name" : "Dave Jacoby", - "y" : 2 - }, - { - "y" : 2, - "drilldown" : "E. Choroba", - "name" : "E. Choroba" - }, - { - "name" : "James Smith", - "drilldown" : "James Smith", - "y" : 2 - }, - { - "drilldown" : "Jason Messer", - "name" : "Jason Messer", - "y" : 2 - }, - { - "y" : 2, - "name" : "Jorg Sommrey", - "drilldown" : "Jorg Sommrey" - }, - { - "y" : 1, - "name" : "Lubos Kolouch", - "drilldown" : "Lubos Kolouch" - }, - { - "y" : 4, - "drilldown" : "Luca Ferrari", - "name" : "Luca Ferrari" - }, - { - "name" : "Mark Anderson", - "drilldown" : "Mark Anderson", - "y" : 2 - }, - { - "y" : 2, - "drilldown" : "Markus Holzer", - "name" : "Markus Holzer" - }, - { - "drilldown" : "Mohammad S Anwar", - "name" : "Mohammad S Anwar", - "y" : 5 - }, - { - "y" : 4, - "drilldown" : "Myoungjin Jeon", - "name" : "Myoungjin Jeon" - }, - { - "drilldown" : "Nuno Vieira", - "name" : "Nuno Vieira", - "y" : 2 - }, - { - "name" : "Pete Houston", - "drilldown" : "Pete Houston", - "y" : 2 - }, - { - "drilldown" : "Roger Bell_West", - "name" : "Roger Bell_West", - "y" : 5 - }, - { - "y" : 3, - "name" : "Simon Green", - "drilldown" : "Simon Green" - }, - { - "drilldown" : "Simon Proctor", - "name" : "Simon Proctor", - "y" : 2 - }, - { - "name" : "Ulrich Rieke", - "drilldown" : "Ulrich Rieke", - "y" : 2 - }, - { - "drilldown" : "Walt Mankowski", - "name" : "Walt Mankowski", - "y" : 3 - } - ], - "name" : "Perl Weekly Challenge - 075", - "colorByPoint" : 1 - } - ], - "legend" : { - "enabled" : 0 } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 0c7eb66d7f..c9d6386558 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,21 +1,7 @@ { - "legend" : { - "enabled" : "false" - }, "series" : [ { - "dataLabels" : { - "y" : 10, - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - }, - "format" : "{point.y:.0f}", - "enabled" : "true", - "rotation" : -90, - "align" : "right", - "color" : "#FFFFFF" - }, + "name" : "Contributions", "data" : [ [ "Blog", @@ -23,41 +9,55 @@ ], [ "Perl", - 3127 + 3128 ], [ "Raku", 2033 ] ], - "name" : "Contributions" + "dataLabels" : { + "enabled" : "true", + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + }, + "y" : 10, + "rotation" : -90, + "format" : "{point.y:.0f}", + "align" : "right", + "color" : "#FFFFFF" + } } ], + "legend" : { + "enabled" : "false" + }, + "subtitle" : { + "text" : "Last updated at 2020-08-28 12:16:41 GMT" + }, + "title" : { + "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" + }, "xAxis" : { "type" : "category", "labels" : { "style" : { - "fontFamily" : "Verdana, sans-serif", - "fontSize" : "13px" + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" } } }, - "tooltip" : { - "pointFormat" : "{point.y:.0f}" - }, - "title" : { - "text" : "Perl Weekly Challenge Contributions [2019 - 2020]" - }, - "chart" : { - "type" : "column" - }, "yAxis" : { "min" : 0, "title" : { "text" : null } }, - "subtitle" : { - "text" : "Last updated at 2020-08-28 11:25:02 GMT" + "chart" : { + "type" : "column" + }, + "tooltip" : { + "pointFormat" : "{point.y:.0f}" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index 2e730719fc..ea0a4a2d21 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,31 +1,43 @@ { + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + } + } + }, + "subtitle" : { + "text" : "Click the columns to drilldown the language breakdown. Last updated at 2020-08-28 12:16:41 GMT" + }, "series" : [ { "data" : [ { - "y" : 142, + "drilldown" : "001", "name" : "#001", - "drilldown" : "001" + "y" : 142 }, { + "drilldown" : "002", "y" : 109, - "name" : "#002", - "drilldown" : "002" + "name" : "#002" }, { - "drilldown" : "003", + "y" : 71, "name" : "#003", - "y" : 71 + "drilldown" : "003" }, { + "drilldown" : "004", "y" : 91, - "name" : "#004", - "drilldown" : "004" + "name" : "#004" }, { "drilldown" : "005", - "name" : "#005", - "y" : 72 + "y" : 72, + "name" : "#005" }, { "drilldown" : "006", @@ -34,28 +46,28 @@ }, { "name" : "#007", - "drilldown" : "007", - "y" : 59 + "y" : 59, + "drilldown" : "007" }, { - "name" : "#008", "drilldown" : "008", - "y" : 72 + "y" : 72, + "name" : "#008" }, { + "name" : "#009", "y" : 68, - "drilldown" : "009", - "name" : "#009" + "drilldown" : "009" }, { - "y" : 60, "drilldown" : "010", + "y" : 60, "name" : "#010" }, { - "y" : 79, "drilldown" : "011", - "name" : "#011" + "name" : "#011", + "y" : 79 }, { "drilldown" : "012", @@ -63,24 +75,24 @@ "y" : 83 }, { - "name" : "#013", "drilldown" : "013", - "y" : 76 + "y" : 76, + "name" : "#013" }, { - "y" : 96, + "drilldown" : "014", "name" : "#014", - "drilldown" : "014" + "y" : 96 }, { - "y" : 93, "drilldown" : "015", + "y" : 93, "name" : "#015" }, { + "y" : 66, "name" : "#016", - "drilldown" : "016", - "y" : 66 + "drilldown" : "016" }, { "drilldown" : "017", @@ -88,29 +100,29 @@ "y" : 79 }, { - "y" : 76, + "drilldown" : "018", "name" : "#018", - "drilldown" : "018" + "y" : 76 }, { - "y" : 97, "name" : "#019", + "y" : 97, "drilldown" : "019" }, { + "y" : 95, "name" : "#020", - "drilldown" : "020", - "y" : 95 + "drilldown" : "020" }, { - "name" : "#021", "drilldown" : "021", - "y" : 67 + "y" : 67, + "name" : "#021" }, { - "drilldown" : "022", "name" : "#022", - "y" : 63 + "y" : 63, + "drilldown" : "022" }, { "drilldown" : "023", @@ -118,93 +130,93 @@ "y" : 91 }, { + "y" : 70, "name" : "#024", - "drilldown" : "024", - "y" : 70 + "drilldown" : "024" }, { - "y" : 55, + "drilldown" : "025", "name" : "#025", - "drilldown" : "025" + "y" : 55 }, { - "y" : 70, + "drilldown" : "026", "name" : "#026", - "drilldown" : "026" + "y" : 70 }, { - "drilldown" : "027", "name" : "#027", - "y" : 58 + "y" : 58, + "drilldown" : "027" }, { - "y" : 78, "drilldown" : "028", + "y" : 78, "name" : "#028" }, { - "name" : "#029", "drilldown" : "029", + "name" : "#029", "y" : 77 }, { - "name" : "#030", "drilldown" : "030", + "name" : "#030", "y" : 115 }, { + "name" : "#031", "y" : 87, - "drilldown" : "031", - "name" : "#031" + "drilldown" : "031" }, { - "y" : 92, "name" : "#032", + "y" : 92, "drilldown" : "032" }, { - "y" : 108, "drilldown" : "033", - "name" : "#033" + "name" : "#033", + "y" : 108 }, { "name" : "#034", - "drilldown" : "034", - "y" : 62 + "y" : 62, + "drilldown" : "034" }, { - "name" : "#035", "drilldown" : "035", + "name" : "#035", "y" : 62 }, { "name" : "#036", - "drilldown" : "036", - "y" : 66 + "y" : 66, + "drilldown" : "036" }, { - "drilldown" : "037", "name" : "#037", - "y" : 65 + "y" : 65, + "drilldown" : "037" }, { - "name" : "#038", "drilldown" : "038", + "name" : "#038", "y" : 65 }, { - "drilldown" : "039", + "y" : 60, "name" : "#039", - "y" : 60 + "drilldown" : "039" }, { "y" : 71, - "drilldown" : "040", - "name" : "#040" + "name" : "#040", + "drilldown" : "040" }, { - "name" : "#041", "drilldown" : "041", + "name" : "#041", "y" : 74 }, { @@ -218,24 +230,24 @@ "y" : 66 }, { - "drilldown" : "044", + "y" : 82, "name" : "#044", - "y" : 82 + "drilldown" : "044" }, { - "drilldown" : "045", "name" : "#045", - "y" : 94 + "y" : 94, + "drilldown" : "045" }, { - "y" : 85, "drilldown" : "046", + "y" : 85, "name" : "#046" }, { "name" : "#047", - "drilldown" : "047", - "y" : 82 + "y" : 82, + "drilldown" : "047" }, { "y" : 106, @@ -243,29 +255,29 @@ "drilldown" : "048" }, { - "drilldown" : "049", + "y" : 85, "name" : "#049", - "y" : 85 + "drilldown" : "049" }, { - "drilldown" : "050", "name" : "#050", - "y" : 96 + "y" : 96, + "drilldown" : "050" }, { - "y" : 87, "drilldown" : "051", + "y" : 87, "name" : "#051" }, { - "drilldown" : "052", + "y" : 89, "name" : "#052", - "y" : 89 + "drilldown" : "052" }, { + "name" : "#053", "y" : 99, - "drilldown" : "053", - "name" : "#053" + "drilldown" : "053" }, { "drilldown" : "054", @@ -273,38 +285,38 @@ "y" : 101 }, { + "y" : 86, "name" : "#055", - "drilldown" : "055", - "y" : 86 + "drilldown" : "055" }, { - "name" : "#056", "drilldown" : "056", - "y" : 93 + "y" : 93, + "name" : "#056" }, { + "drilldown" : "057", "y" : 78, - "name" : "#057", - "drilldown" : "057" + "name" : "#057" }, { + "drilldown" : "058", "y" : 67, - "name" : "#058", - "drilldown" : "058" + "name" : "#058" }, { "y" : 87, - "drilldown" : "059", - "name" : "#059" + "name" : "#059", + "drilldown" : "059" }, { - "name" : "#060", "drilldown" : "060", - "y" : 83 + "y" : 83, + "name" : "#060" }, { - "y" : 79, "name" : "#061", + "y" : 79, "drilldown" : "061" }, { @@ -313,73 +325,73 @@ "drilldown" : "062" }, { + "drilldown" : "063", "y" : 87, - "name" : "#063", - "drilldown" : "063" + "name" : "#063" }, { - "y" : 76, + "drilldown" : "064", "name" : "#064", - "drilldown" : "064" + "y" : 76 }, { "y" : 71, - "drilldown" : "065", - "name" : "#065" + "name" : "#065", + "drilldown" : "065" }, { - "name" : "#066", "drilldown" : "066", + "name" : "#066", "y" : 82 }, { + "name" : "#067", "y" : 88, - "drilldown" : "067", - "name" : "#067" + "drilldown" : "067" }, { + "name" : "#068", "y" : 73, - "drilldown" : "068", - "name" : "#068" + "drilldown" : "068" }, { - "y" : 81, "drilldown" : "069", - "name" : "#069" + "name" : "#069", + "y" : 81 }, { - "drilldown" : "070", "name" : "#070", - "y" : 91 + "y" : 91, + "drilldown" : "070" }, { - "name" : "#071", "drilldown" : "071", - "y" : 76 + "y" : 76, + "name" : "#071" }, { - "drilldown" : "072", "name" : "#072", - "y" : 109 + "y" : 109, + "drilldown" : "072" }, { - "drilldown" : "073", "name" : "#073", - "y" : 108 + "y" : 108, + "drilldown" : "073" }, { - "y" : 110, "drilldown" : "074", - "name" : "#074" + "name" : "#074", + "y" : 110 }, { - "y" : 51, "name" : "#075", + "y" : 52, "drilldown" : "075" } ], - "colorByPoint" : "true", - "name" : "Perl Weekly Challenge Languages" + "name" : "Perl Weekly Challenge Languages", + "colorByPoint" : "true" } ], "legend" : { @@ -388,7 +400,6 @@ "drilldown" : { "series" : [ { - "name" : "001", "id" : "001", "data" : [ [ @@ -403,9 +414,11 @@ "Blog", 11 ] - ] + ], + "name" : "001" }, { + "name" : "002", "data" : [ [ "Perl", @@ -420,12 +433,11 @@ 10 ] ], - "id" : "002", - "name" : "002" + "id" : "002" }, { - "name" : "003", "id" : "003", + "name" : "003", "data" : [ [ "Perl", @@ -460,8 +472,6 @@ "id" : "004" }, { - "id" : "005", - "name" : "005", "data" : [ [ "Perl", @@ -475,9 +485,13 @@ "Blog", 12 ] - ] + ], + "name" : "005", + "id" : "005" }, { + "id" : "006", + "name" : "006", "data" : [ [ "Perl", @@ -491,13 +505,10 @@ "Blog", 7 ] - ], - "name" : "006", - "id" : "006" + ] }, { "name" : "007", - "id" : "007", "data" : [ [ "Perl", @@ -511,7 +522,8 @@ "Blog", 10 ] - ] + ], + "id" : "007" }, { "data" : [ @@ -532,7 +544,6 @@ "id" : "008" }, { - "name" : "009", "id" : "009", "data" : [ [ @@ -547,11 +558,11 @@ "Blog", 13 ] - ] + ], + "name" : "009" }, { "name" : "010", - "id" : "010", "data" : [ [ "Perl", @@ -565,9 +576,12 @@ "Blog", 11 ] - ] + ], + "id" : "010" }, { + "id" : "011", + "name" : "011", "data" : [ [ "Perl", @@ -581,11 +595,10 @@ "Blog", 10 ] - ], - "id" : "011", - "name" : "011" + ] }, { + "id" : "012", "data" : [ [ "Perl", @@ -600,7 +613,6 @@ 11 ] ], - "id" : "012", "name" : "012" }, { @@ -622,6 +634,8 @@ ] }, { + "id" : "014", + "name" : "014", "data" : [ [ "Perl", @@ -635,9 +649,7 @@ "Blog", 15 ] - ], - "id" : "014", - "name" : "014" + ] }, { "data" : [ @@ -672,10 +684,11 @@ 12 ] ], - "id" : "016", - "name" : "016" + "name" : "016", + "id" : "016" }, { + "name" : "017", "data" : [ [ "Perl", @@ -690,10 +703,10 @@ 12 ] ], - "name" : "017", "id" : "017" }, { + "id" : "018", "data" : [ [ "Perl", @@ -708,11 +721,9 @@ 14 ] ], - "name" : "018", - "id" : "018" + "name" : "018" }, { - "name" : "019", "id" : "019", "data" : [ [ @@ -727,9 +738,11 @@ "Blog", 13 ] - ] + ], + "name" : "019" }, { + "id" : "020", "data" : [ [ "Perl", @@ -744,12 +757,11 @@ 13 ] ], - "name" : "020", - "id" : "020" + "name" : "020" }, { - "name" : "021", "id" : "021", + "name" : "021", "data" : [ [ "Perl", @@ -766,6 +778,7 @@ ] }, { + "name" : "022", "data" : [ [ "Perl", @@ -780,12 +793,10 @@ 10 ] ], - "id" : "022", - "name" : "022" + "id" : "022" }, { "name" : "023", - "id" : "023", "data" : [ [ "Perl", @@ -799,7 +810,8 @@ "Blog", 12 ] - ] + ], + "id" : "023" }, { "data" : [ @@ -834,12 +84