diff options
| -rw-r--r-- | challenge-191/robert-dicicco/julia/ch-1.jl | 93 | ||||
| -rw-r--r-- | challenge-191/robert-dicicco/perl/ch-1.pl | 95 | ||||
| -rw-r--r-- | challenge-191/robert-dicicco/raku/ch-1.raku | 87 | ||||
| -rw-r--r-- | challenge-191/robert-dicicco/ruby/ch-1.rb | 91 | ||||
| -rw-r--r-- | challenge-191/robert-dicicco/tcl/ch-1.tcl | 97 | ||||
| -rw-r--r-- | stats/pwc-current.json | 115 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown-summary.json | 80 | ||||
| -rw-r--r-- | stats/pwc-language-breakdown.json | 2642 | ||||
| -rw-r--r-- | stats/pwc-leaders.json | 726 | ||||
| -rw-r--r-- | stats/pwc-summary-1-30.json | 36 | ||||
| -rw-r--r-- | stats/pwc-summary-121-150.json | 100 | ||||
| -rw-r--r-- | stats/pwc-summary-151-180.json | 100 | ||||
| -rw-r--r-- | stats/pwc-summary-181-210.json | 42 | ||||
| -rw-r--r-- | stats/pwc-summary-211-240.json | 104 | ||||
| -rw-r--r-- | stats/pwc-summary-241-270.json | 34 | ||||
| -rw-r--r-- | stats/pwc-summary-271-300.json | 68 | ||||
| -rw-r--r-- | stats/pwc-summary-31-60.json | 104 | ||||
| -rw-r--r-- | stats/pwc-summary-61-90.json | 46 | ||||
| -rw-r--r-- | stats/pwc-summary-91-120.json | 98 | ||||
| -rw-r--r-- | stats/pwc-summary.json | 622 |
20 files changed, 2931 insertions, 2449 deletions
diff --git a/challenge-191/robert-dicicco/julia/ch-1.jl b/challenge-191/robert-dicicco/julia/ch-1.jl new file mode 100644 index 0000000000..816f27ba38 --- /dev/null +++ b/challenge-191/robert-dicicco/julia/ch-1.jl @@ -0,0 +1,93 @@ +#!/usr/bin/env julia + +#= + +UTHOR: Robert DiCicco + +DATE: 2022-11-14 + +Challenge 191 Twice Largest ( Julia ) + + + +You are given list of integers, @list. + +Write a script to find out whether the largest item in the + +list is at least twice as large as each of the other items. + +=# + +using Printf + + + +arr = [[1,2,3,4],[1,2,0,5],[2,6,3,1],[4,5,2,3]] + + + +for lst in arr + + @printf("Input: @list = %s\n",lst); + + result = "good" + + max = maximum(lst) + + sort!(lst) + + x = 1 + + while (x < length(lst)) + + if ( (2 * (lst[x]) > max)) + + println("Output: -1\n") + + result = "bad" + + break + + end + + x += 1 + + end + + if (cmp(result,"good") == 0) + + println("Output: 1\n") + + end + +end + + + +#= + +SAMPLE OUTPUT + +Input: @list = [1, 2, 3, 4] + +Output: -1 + + + +Input: @list = [1, 2, 0, 5] + +Output: 1 + + + +Input: @list = [2, 6, 3, 1] + +Output: 1 + + + +Input: @list = [4, 5, 2, 3] + +Output: -1 + +=# diff --git a/challenge-191/robert-dicicco/perl/ch-1.pl b/challenge-191/robert-dicicco/perl/ch-1.pl new file mode 100644 index 0000000000..2d17a4a15f --- /dev/null +++ b/challenge-191/robert-dicicco/perl/ch-1.pl @@ -0,0 +1,95 @@ +#!/usr/bin/env perl + +=begin pod + +AUTHOR: Robert DiCicco + +DATE: 2022-11-14 + +Challenge 191 Twice Largest ( Perl ) + + + +You are given list of integers, @list. + +Write a script to find out whether the largest item in the + +list is at least twice as large as each of the other items. + +=cut + +use strict; + +use warnings; + +use feature qw/say/; + +use List::Util qw( max ); + + + +my @arr = ([1,2,3,4],[1,2,0,5],[2,6,3,1],[4,5,2,3]); + + + +for my $lst (@arr) { + + my $result = "good"; + + print("Input: \@list = \(@$lst\)\n"); + + my $max = max(@$lst); + + my @sorted = sort @$lst; + + my $x = 0; + + while($x < scalar(@$lst)-1) { + + if ( (2 * ($sorted[$x]) > $max)) { + + say "Output: -1\n"; + + $result = "bad"; + + last; + + } + + $x++; + + } + + if ($result eq "good") { say "Output: 1\n"} + + } + + + +=begin pod + +SAMPLE OUTPUT + +Input: @list = (1 2 3 4) + +Output: -1 + + + +Input: @list = (1 2 0 5) + +Output: 1 + + + +Input: @list = (2 6 3 1) + +Output: 1 + + + +Input: @list = (4 5 2 3) + +Output: -1 + +=cut diff --git a/challenge-191/robert-dicicco/raku/ch-1.raku b/challenge-191/robert-dicicco/raku/ch-1.raku new file mode 100644 index 0000000000..7933d1d3f6 --- /dev/null +++ b/challenge-191/robert-dicicco/raku/ch-1.raku @@ -0,0 +1,87 @@ +use v6; + +=begin comment + +AUTHOR: Robert DiCicco + +DATE: 2022-11-14 + +Challenge 191 Twice Largest ( Raku ) + + + +You are given list of integers, @list. + +Write a script to find out whether the largest item in the + +list is at least twice as large as each of the other items. + +=end comment + + + +my @arr = ([1,2,3,4],[1,2,0,5],[2,6,3,1],[4,5,2,3]); + + + +for (@arr) -> @lst { + + my $result = "good"; + + print("Input: @list = (" ~ @lst ~ ")\n"); + + my $max = @lst.max; + + my @sorted = @lst.sort; + + my $x = 0; + + while ($x < @lst.elems - 1) { + + if ( (2 * (@sorted[$x]) > $max)) { + + say "Output: -1\n"; + + $result = "bad"; + + last; + + } + + $x++; + + } + + if ($result eq "good") { say "Output: 1\n"} + +} + + + +=begin comment + +SAMPLE OUTPUT + +Input: @list = (1 2 3 4) + +Output: -1 + + + +Input: @list = (1 2 0 5) + +Output: 1 + + + +Input: @list = (2 6 3 1) + +Output: 1 + + + +Input: @list = (4 5 2 3) + +Output: -1 + +=end comment diff --git a/challenge-191/robert-dicicco/ruby/ch-1.rb b/challenge-191/robert-dicicco/ruby/ch-1.rb new file mode 100644 index 0000000000..606784214b --- /dev/null +++ b/challenge-191/robert-dicicco/ruby/ch-1.rb @@ -0,0 +1,91 @@ +#!/usr/bin/env ruby + +=begin + +AUTHOR: Robert DiCicco + +DATE: 2022-11-14 + +Challenge 191 Twice Largest ( Ruby ) + + + +You are given list of integers, @list. + +Write a script to find out whether the largest item in the + +list is at least twice as large as each of the other items. + +=end + + + +arr = [[1,2,3,4],[1,2,0,5],[2,6,3,1],[4,5,2,3]] + + + +arr.each do |lst| + + result = "good" + + print("Input: @list = #{lst}\n"); + + max = lst.max() + + lst = lst.sort! + + x = 0 + + while (x < lst.length()-1) + + if ( (2 * (lst[x]) > max)) + + puts "Output: -1\n\n" + + result = "bad" + + break + + end + + x += 1 + + end + + if (result.eql? "good") + + puts "Output: 1\n\n" + + end + +end + + + +=begin + +SAMPLE OUTPUT + +Input: @list = [1, 2, 3, 4] + +Output: -1 + + + +Input: @list = [1, 2, 0, 5] + +Output: 1 + + + +Input: @list = [2, 6, 3, 1] + +Output: 1 + + + +Input: @list = [4, 5, 2, 3] + +Output: -1 + +=end diff --git a/challenge-191/robert-dicicco/tcl/ch-1.tcl b/challenge-191/robert-dicicco/tcl/ch-1.tcl new file mode 100644 index 0000000000..ae38c0003d --- /dev/null +++ b/challenge-191/robert-dicicco/tcl/ch-1.tcl @@ -0,0 +1,97 @@ +#!/usr/bin/env tclsh + + + +set comment { + + AUTHOR: Robert DiCicco + + DATE: 2022-11-14 + + Challenge 191 Twice Largest ( Tcl ) + + + + You are given list of integers, @list. + + Write a script to find out whether the largest item in the + + list is at least twice as large as each of the other items. + +} + + + +set arr {{1 2 3 4} {1 2 0 5} {2 6 3 1} {4 5 2 3}} + + + +foreach lst $arr { + + puts "Input: @list = \($lst\)" + + set max [tcl::mathfunc::max {*}$lst] + + set result "good" + + set lst [lsort $lst] + + set x 0 + + set len [llength $lst] + + while { $x < $len - 1} { + + set dubl [expr { 2 * [lindex $lst $x]}] + + if {$dubl > $max} { + + puts "Output: -1\n" + + set result "bad" + + break + + } + + incr x + + } + + if {$result eq "good"} { puts "Output: 1\n" } + +} + + + +set comment { + + + +SAMPLE OUTPUT + +Input: @list = (1 2 3 4) + +Output: -1 + + + +Input: @list = (1 2 0 5) + +Output: 1 + + + +Input: @list = (2 6 3 1) + +Output: 1 + + + +Input: @list = (4 5 2 3) + +Output: -1 + + + +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 2ffad4e694..e9ea4c7b6b 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,51 +1,57 @@ { - "tooltip" : { - "followPointer" : 1, - "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>", - "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>" - }, - "title" : { - "text" : "The Weekly Challenge - 191" - }, "legend" : { "enabled" : 0 }, - "xAxis" : { - "type" : "category" - }, "yAxis" : { "title" : { "text" : "Total Solutions" } }, + "xAxis" : { + "type" : "category" + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 + } + }, + "tooltip" : { + "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>", + "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>", + "followPointer" : 1 + }, "chart" : { "type" : "column" }, "drilldown" : { "series" : [ { + "id" : "Feng Chang", "name" : "Feng Chang", "data" : [ [ "Raku", 2 ] - ], - "id" : "Feng Chang" + ] }, { "id" : "Humberto Massa", + "name" : "Humberto Massa", "data" : [ [ "Raku", 2 ] - ], - "name" : "Humberto Massa" + ] }, { - "name" : "Luca Ferrari", "id" : "Luca Ferrari", + "name" : "Luca Ferrari", "data" : [ [ "Raku", @@ -58,8 +64,8 @@ ] }, { - "name" : "Niels van Dijke", "id" : "Niels van Dijke", + "name" : "Niels van Dijke", "data" : [ [ "Perl", @@ -68,7 +74,6 @@ ] }, { - "name" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -79,10 +84,24 @@ 1 ] ], + "name" : "Peter Campbell Smith", "id" : "Peter Campbell Smith" }, { - "name" : "Roger Bell_West", + "data" : [ + [ + "Perl", + 1 + ], + [ + "Raku", + 1 + ] + ], + "name" : "Robert DiCicco", + "id" : "Robert DiCicco" + }, + { "id" : "Roger Bell_West", "data" : [ [ @@ -93,17 +112,18 @@ "Raku", 2 ] - ] + ], + "name" : "Roger Bell_West" }, { - "id" : "Simon Proctor", + "name" : "Simon Proctor", "data" : [ [ "Raku", 2 ] ], - "name" : "Simon Proctor" + "id" : "Simon Proctor" }, { "id" : "Tim Potapov", @@ -117,7 +137,6 @@ }, { "name" : "Ulrich Rieke", - "id" : "Ulrich Rieke", "data" : [ [ "Perl", @@ -127,30 +146,23 @@ "Raku", 2 ] - ] + ], + "id" : "Ulrich Rieke" } ] }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } - }, "subtitle" : { - "text" : "[Champions: 9] Last updated at 2022-11-14 20:06:34 GMT" + "text" : "[Champions: 10] Last updated at 2022-11-14 20:41:58 GMT" }, "series" : [ { + "colorByPoint" : 1, "name" : "The Weekly Challenge - 191", "data" : [ { - "drilldown" : "Feng Chang", + "y" : 2, "name" : "Feng Chang", - "y" : 2 + "drilldown" : "Feng Chang" }, { "drilldown" : "Humberto Massa", @@ -158,24 +170,29 @@ "y" : 2 }, { - "name" : "Luca Ferrari", + "drilldown" : "Luca Ferrari", "y" : 8, - "drilldown" : "Luca Ferrari" + "name" : "Luca Ferrari" }, { - "drilldown" : "Niels van Dijke", + "y" : 2, "name" : "Niels van Dijke", - "y" : 2 + "drilldown" : "Niels van Dijke" }, { - "y" : 3, "name" : "Peter Campbell Smith", + "y" : 3, "drilldown" : "Peter Campbell Smith" }, { + "y" : 2, + "name" : "Robert DiCicco", + "drilldown" : "Robert DiCicco" + }, + { + "drilldown" : "Roger Bell_West", "y" : 4, - "name" : "Roger Bell_West", - "drilldown" : "Roger Bell_West" + "name" : "Roger Bell_West" }, { "name" : "Simon Proctor", @@ -188,12 +205,14 @@ "name" : "Tim Potapov" }, { - "drilldown" : "Ulrich Rieke", "y" : 4, - "name" : "Ulrich Rieke" + "name" : "Ulrich Rieke", + "drilldown" : "Ulrich Rieke" } - ], - "colorByPoint" : 1 + ] } - ] + ], + "title" : { + "text" : "The Weekly Challenge - 191" + } } diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json index 22cda37672..42a0d73075 100644 --- a/stats/pwc-language-breakdown-summary.json +++ b/stats/pwc-language-breakdown-summary.json @@ -1,9 +1,42 @@ { - "subtitle" : { - "text" : "Last updated at 2022-11-14 20:06:34 GMT" + "xAxis" : { + "type" : "category", + "labels" : { + "style" : { + "fontFamily" : "Verdana, sans-serif", + "fontSize" : "13px" + } + } + }, + "legend" : { + "enabled" : "false" + }, + "yAxis" : { + "title" : { + "text" : null + }, + "min" : 0 + }, + "chart" : { + "type" : "column" + }, + "tooltip" : { + "pointFormat" : "<b>{point.y:.0f}</b>" }, "series" : [ { + "dataLabels" : { + "style" : { + "fontSize" : "13px", + "fontFamily" : "Verdana, sans-serif" + }, + "color" : "#FFFFFF", + "y" : 10, + "align" : "right", + "format" : "{point.y:.0f}", + "rotation" : -90, + "enabled" : "true" + }, "name" : "Contributions", "data" : [ [ @@ -12,52 +45,19 @@ ], [ "Perl", - 9321 + 9322 ], [ "Raku", - 5598 + 5599 ] - ], - "dataLabels" : { - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - }, - "format" : "{point.y:.0f}", - "align" : "right", - "rotation" : -90, - "color" : "#FFFFFF", - "y" : 10, - "enabled" : "true" - } + ] } ], "title" : { "text" : "The Weekly Challenge Contributions [2019 - 2022]" }, - "tooltip" : { - "pointFormat" : "<b>{point.y:.0f}</b>" - }, - "legend" : { - "enabled" : "false" - }, - "xAxis" : { - "labels" : { - "style" : { - "fontSize" : "13px", - "fontFamily" : "Verdana, sans-serif" - } - }, - "type" : "category" - }, - "chart" : { - "type" : "column" - }, - "yAxis" : { - "min" : 0, - "title" : { - "text" : null - } + "subtitle" : { + "text" : "Last updated at 2022-11-14 20:41:58 GMT" } } diff --git a/stats/pwc-language-breakdown.json b/stats/pwc-language-breakdown.json index c5d59c7bf5..93a26d9198 100644 --- a/stats/pwc-language-breakdown.json +++ b/stats/pwc-language-breakdown.json @@ -1,43 +1,980 @@ { - "legend" : { - "enabled" : "false" - }, - "tooltip" : { - "pointFormat" : "<span style=\"color:{point.color}\">Challenge {point.name}</span>: <b>{point.y:f}</b><br/>", - "headerFormat" : "<span style=\"font-size:11px\"></span>", - "followPointer" : "true" - }, + "series" : [ + { + "colorByPoint" : "true", + "name" : "The Weekly Challenge Languages", + "data" : [ + { + "name" : "#001", + "y" : 161, + "drilldown" : "001" + }, + { + "name" : "#002", + "y" : 125, + "drilldown" : "002" + }, + { + "name" : "#003", + "y" : 83, + "drilldown" : "003" + }, + { + "name" : "#004", + "y" : 99, + "drilldown" : "004" + }, + { + "y" : 78, + "name" : "#005", + "drilldown" : "005" + }, + { + "drilldown" : "006", + "y" : 58, + "name" : "#006" + }, + { + "name" : "#007", + "y" : 65, + "drilldown" : "007" + }, + { + "y" : 78, + "name" : "#008", + "drilldown" : "008" + }, + { + "drilldown" : "009", + "y" : 76, + "name" : "#009" + }, + { + "y" : 65, + "name" : "#010", + "drilldown" : "010" + }, + { + "y" : 85, + "name" : "#011", + "drilldown" : "011" + }, + { + "drilldown" : "012", + "name" : "#012", + "y" : 89 + }, + { + "drilldown" : "013", + "name" : "#013", + "y" : 85 + }, + { + "name" : "#014", + "y" : 101, + "drilldown" : "014" + }, + { + "drilldown" : "015", + "name" : "#015", + "y" : 99 + }, + { + "name" : "#016", + "y" : 71, + "drilldown" : "016" + }, + { + "name" : "#017", + "y" : 84, + "drilldown" : "017" + }, + { + "drilldown" : "018", + "y" : 81, + "name" : "#018" + }, + { + "drilldown" : "019", + "name" : "#019", + "y" : 103 + }, + { + "y" : 101, + "name" : "#020", + "drilldown" : "020" + }, + { + "drilldown" : "021", + "y" : 72, + "name" : "#021" + }, + { + "y" : 68, + "name" : "#022", + "drilldown" : "022" + }, + { + "y" : 97, + "name" : "#023", + "drilldown" : "023" + }, + { + "drilldown" : "024", + "name" : "#024", + "y" : 75 + }, + { + "name" : "#025", + "y" : 59, + "drilldown" : "025" + }, + { + "name" : "#026", + "y" : 74, + "drilldown" : "026" + }, + { + "drilldown" : "027", + "name" : "#027", + "y" : 62 + }, + { + "name" : "#028", + "y" : 82, + "drilldown" : "028" + }, + { + "y" : 81, + "name" : "#029", + "drilldown" : "029" + }, + { + "drilldown" : "030", + "name" : "#030", + "y" : 119 + }, + { + "name" : "#031", + "y" : 91, + "drilldown" : "031" + }, + { + "y" : 96, + "name" : "#032", + "drilldown" : "032" + }, + { + "name" : "#033", + "y" : 112, + "drilldown" : "033" + }, + { + "drilldown" : "034", + "name" : "#034", + "y" : 66 + }, + { + "name" : "#035", + "y" : 66, + "drilldown" : "035" + }, + { + "drilldown" : "036", + "name" : "#036", + "y" : 70 + }, + { + "name" : "#037", + "y" : 69, + "drilldown" : "037" + }, + { + "name" : "#038", + "y" : 70, + "drilldown" : "038" + }, + { + "drilldown" : "039", + "name" : "#039", + "y" : 64 + }, + { + "y" : 75, + "name" : "#040", + "drilldown" : "040" + }, + { + "y" : 78, + "name" : "#041", + "drilldown" : "041" + }, + { + "drilldown" : "042", + "name" : "#042", + "y" : 94 + }, + { + "drilldown" : "043", + "name" : "#043", + "y" : 70 + }, + { + "y" : 87, + "name" : "#044", + "drilldown" : "044" + }, + { + "name" : "#045", + "y" : 98, + "drilldown" : "045" + }, + { + "drilldown" : "046", + "y" : 89, + "name" : "#046" + }, + { + "y" : 86, + "name" : "#047", + "drilldown" : "047" + }, + { + "y" : 110, + "name" : "#048", + "drilldown" : "048" + }, + { + "drilldown" : "049", + "name" : "#049", + "y" : 91 + }, + { + "drilldown" : "050", + "name" : "#050", + "y" : 100 + }, + { + "drilldown" : "051", + "y" : 91, + "name" : "#051" + }, + { + "drilldown" : "052", + "name" : "#052", + "y" : 93 + }, + { + "drilldown" : "053", + "name" : "#053", + "y" : 103 + }, + { + "name" : "#054", + "y" : 105, + "drilldown" : "054" + }, + { + "drilldown" : "055", + "y" : 90, + "name" : "#055" + }, + { + "drilldown" : "056", + "y" : 97, + "name" : "#056" + }, + { + "y" : 82, + "name" : "#057", + "drilldown" : "057" + }, + { + "drilldown" : "058", + "name" : "#058", + "y" : 71 + }, + { + "drilldown" : "059", + "name" : "#059", + "y" : 91 + }, + { + "drilldown" : "060", + "y" : 87, + "name" : "#060" + }, + { + "drilldown" : "061", + "y" : 83, + "name" : "#061" + }, + { + "drilldown" : "062", + "name" : "#062", + "y" : 60 + }, + { + "drilldown" : "063", + "y" : 91, + "name" : "#063" + }, + { + "y" : 82, + "name" : "#064", + "drilldown" : "064" + }, + { + "drilldown" : "065", + "y" : 75, + "name" : "#065" + }, + { + "y" : 86, + "name" : "#066", + "drilldown" : "066" + }, + { + "name" : "#067", + "y" : 92, + "drilldown" : "067" + }, + { + "drilldown" : "068", + "name" : "#068", + "y" : 77 + }, + { + "drilldown" : "069", + "y" : 85, + "name" : "#069" + |
