diff options
| author | Abigail <abigail@abigail.be> | 2021-04-26 14:25:49 +0200 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-04-26 14:25:49 +0200 |
| commit | fa12d5043bd37bf69f42e5b6304bfc92ab29248b (patch) | |
| tree | dc2eefefbf244326682b1b91b20983c534b7beed | |
| parent | 1ff197d81f941c3dd35d77bec8a0326807e8d2b1 (diff) | |
| download | perlweeklychallenge-club-fa12d5043bd37bf69f42e5b6304bfc92ab29248b.tar.gz perlweeklychallenge-club-fa12d5043bd37bf69f42e5b6304bfc92ab29248b.tar.bz2 perlweeklychallenge-club-fa12d5043bd37bf69f42e5b6304bfc92ab29248b.zip | |
README from week 110
| -rw-r--r-- | challenge-110/abigail/README.md | 129 |
1 files changed, 42 insertions, 87 deletions
diff --git a/challenge-110/abigail/README.md b/challenge-110/abigail/README.md index efca0f497f..a931e845a9 100644 --- a/challenge-110/abigail/README.md +++ b/challenge-110/abigail/README.md @@ -1,107 +1,62 @@ # Solutions by Asbigail -## [Chowla Numbers](https://perlweeklychallenge.org/blog/perl-weekly-challenge-109/#TASK1) +## [Valid Phone Number Formats](https://perlweeklychallenge.org/blog/perl-weekly-challenge-110/#TASK1) -Write a script to generate first 20 Chowla Numbers, named after, -Sarvadaman D. S. Chowla, a London born Indian American mathematician. -It is defined as: +> You are given a text file. +> +> Write a script to display all valid phone numbers in the given text file. - C(n) = (sum of divisors of n) - 1 - n +### Acceptable Phone Number Formats -### Output +~~~~ ++nn nnnnnnnnnn +(nn) nnnnnnnnnn +nnnn nnnnnnnnnn +~~~~ + +### Input File +~~~~ +0044 1148820341 + +44 1148820341 + 44-11-4882-0341 +(44) 1148820341 + 00 1148820341 +~~~~ - 0, 0, 0, 2, 0, 5, 0, 6, 3, 7, 0, 15, 0, 9, 8, 14, 0, 20, 0, 21 +### Output +~~~~ +0044 1148820341 + +44 1148820341 +(44) 1148820341 +~~~~ ### Solutions -* [AWK](awk/ch-1.awk) -* [Bash](bash/ch-1.sh) -* [BASIC](basic/ch-1.bas) -* [bc](bc/ch-1.bc) -* [Befunge-93][befunge-93/ch-1.bf93] -* [C](c/ch-1.c) -* [Cobol](cobol/ch-1.cb) -* [Csh](csh/ch-1.csh) -* [Erlang](erlang/ch-1.erl) -* [Forth](forth/ch-1.fs) -* [Fortran](fortran/ch-1.f90) -* [Go](go/ch-1.go) -* [Java](java/ch-1.java) -* [Lua](lua/ch-1.lua) -* [m4](m4/ch-1.m4) -* [Node.js](node/ch-1.js) -* [Ocaml](ocaml/ch-1.ml) -* [Pascal](pascal/ch-1.p) -* [Perl](perl/ch-1.pl) -* [PHP](php/ch-1.php) -* [PostScript](postscript/ch-1.ps) -* [Python](python/ch-1.py) -* [R](r/ch-1.r) -* [Rexx](rexx/ch-1.rexx) -* [Ruby](ruby/ch-1.rb) -* [Scheme](scheme/ch-1.scm) -* [sed](sed/ch-1.sed) -* [SQL](sql/ch-1.sql) -* [Tcl](tcl/ch-1.tcl) ### Blog -[Chowla Numbers](https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-109-1.html) - +## [Transpose File](https://perlweeklychallenge.org/blog/perl-weekly-challenge-110/#TASK2) -## [Four Squares Puzzle](https://perlweeklychallenge.org/blog/perl-weekly-challenge-109/#TASK2) - -You are given four squares as below with numbers named `a`, `b`, -`c`, `d`, `e`, `f`, `g`. - - (1) (3) - ╔══════════════╗ ╔══════════════╗ - ║ ║ ║ ║ - ║ a ║ ║ e ║ - ║ ║ (2) ║ ║ (4) - ║ ┌───╫──────╫───┐ ┌───╫─────────┐ - ║ │ ║ ║ │ │ ║ │ - ║ │ b ║ ║ d │ │ f ║ │ - ║ │ ║ ║ │ │ ║ │ - ║ │ ║ ║ │ │ ║ │ - ╚══════════╪═══╝ ╚═══╪══════╪═══╝ │ - │ c │ │ g │ - │ │ │ │ - │ │ │ │ - └──────────────┘ └─────────────┘ - -Write a script to place the given unique numbers in the square box -so that sum of numbers in each box is the same. - -### Example +> You are given a text file. +> +> Write a script to transpose the contents of the given file. +### Input File +~~~~ +name,age,sex +Mohammad,45,m +Joe,20,m +Julie,35,f +Cristina,10,f ~~~~ -Input: 1,2,3,4,5,6,7 - -Output: - - a = 6 - b = 4 - c = 1 - d = 5 - e = 2 - f = 3 - g = 7 - Box 1: a + b = 6 + 4 = 10 - Box 2: b + c + d = 4 + 1 + 5 = 10 - Box 3: d + e + f = 5 + 2 + 3 = 10 - Box 4: f + g = 3 + 7 = 10 +### Output ~~~~ +name,Mohammad,Joe,Julie,Cristina +age,45,20,35,10 +sex,m,m,f,f +~~~~ + ### Solutions -* [AWK](awk/ch-2.awk) -* [Bash](bash/ch-2.sh) -* [C](c/ch-2.c) -* [Lua](lua/ch-2.lua) -* [Node.js](node/ch-2.js) -* [Perl](perl/ch-2.pl) -* [Python](python/ch-2.py) -* [Ruby](ruby/ch-2.rb) ### Blog -[Four Squares Puzzle](https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-109-2.html) |
