diff options
| -rw-r--r-- | challenge-124/abigail/README.md | 81 |
1 files changed, 39 insertions, 42 deletions
diff --git a/challenge-124/abigail/README.md b/challenge-124/abigail/README.md index e71bda7e0f..96ce515677 100644 --- a/challenge-124/abigail/README.md +++ b/challenge-124/abigail/README.md @@ -1,21 +1,27 @@ # Solutions by Abigail -## [Ugly Numbers][task1] +## [Happy Women Day][task1] -> You are given an integer `$n >= 1`. -> -> Write a script to find the $nth element of Ugly Numbers. -> -> > Ugly numbers are those number whose prime factors are `2`, `3` or `5`. -> > For example, the first 10 Ugly Numbers are `1`, `2`, `3`, `4`, `5`, -> > `6`, `8`, `9`, `10`, `12`. +> Write a script to print the Venus Symbol, international gender symbol +> for women. Please feel free to use any character. -### Examples ~~~~ -Input: $n = 7 -Output: 8 - -Input: $n = 10 -Output: 12 + ^^^^^ + ^ ^ + ^ ^ + ^ ^ + ^ ^ + ^ ^ + ^ ^ + ^ ^ + ^ ^ + ^ ^ + ^^^^^ + ^ + ^ + ^ + ^^^^^ + ^ + ^ ~~~~ ### Solutions @@ -30,55 +36,46 @@ Output: 12 * [Ruby](ruby/ch-1.rb) ### Blog -[Perl Weekly Challenge 123: Ugly Numbers][blog1] +[Perl Weekly Challenge 124: Happy Women Day][blog1] -## [Square Points][task2] +## [Tug of War][task2] -> You are given coordinates of four points i.e. `(x1, y1)`, `(x2, y2)`, -> `(x3, y3)` and `(x4, y4)`. -> -> Write a script to find out if the given four points form a square. +> You are given a set of $n integers `(n1, n2, n3, ...)`. +> +> Write a script to divide the set in two subsets of `n/2` sizes each +> so that the difference of the sum of two subsets is the least. If +> `$n` is even then each subset must be of size `$n/2` each. In case $n +> is odd then one subset must be `($n-1)/2` and other must be `($n+1)/2`. ### Examples ~~~~ -Input: x1 = 10, y1 = 20 - x2 = 20, y2 = 20 - x3 = 20, y3 = 10 - x4 = 10, y4 = 10 -Output: 1 as the given coordinates form a square. +Input: Set = (10, 20, 30, 40, 50, 60, 70, 80, 90, 100) +Output: Subset 1 = (30, 40, 60, 70, 80) + Subset 2 = (10, 20, 50, 90, 100) ~~~~ ~~~~ -Input: x1 = 12, y1 = 24 - x2 = 16, y2 = 10 - x3 = 20, y3 = 12 - x4 = 18, y4 = 16 -Output: 0 as the given coordinates doesn't form a square. +Input: Set = (10, -15, 20, 30, -25, 0, 5, 40, -5) + Subset 1 = (30, 0, 5, -5) + Subset 2 = (10, -15, 20, -25, 40) ~~~~ ### Solutions * [AWK](awk/ch-2.awk) * [Bash](bash/ch-2.sh) -* [bc](bc/ch-2.bc) * [C](c/ch-2.c) -* [Go](go/ch-2.go) -* [Java](java/ch-2.java) * [Lua](lua/ch-2.lua) * [Node.js](node/ch-2.js) -* [Pascal](pascal/ch-2.p) * [Perl](perl/ch-2.pl) * [Python](python/ch-2.py) -* [R](r/ch-2.r) * [Ruby](ruby/ch-2.rb) -* [Scheme](scheme/ch-2.scm) -* [Tcl](tcl/ch-2.tcl) ### Blog -[Perl Weekly Challenge 123: Square Points][blog2] +[Perl Weekly Challenge 124: Tug of War][blog2] -[task1]: https://perlweeklychallenge.org/blog/perl-weekly-challenge-123/#TASK1 -[task2]: https://perlweeklychallenge.org/blog/perl-weekly-challenge-123/#TASK2 -[blog1]: https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-123-1.html -[blog2]: https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-123-2.html +[task1]: https://perlweeklychallenge.org/blog/perl-weekly-challenge-124/#TASK1 +[task2]: https://perlweeklychallenge.org/blog/perl-weekly-challenge-124/#TASK2 +[blog1]: https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-124-1.html +[blog2]: https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-124-2.html |
