Skip to content

Commit 64ca725

Browse files
committed
- Added template for Challenge 066.
1 parent b0087b3 commit 64ca725

File tree

171 files changed

+498
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+498
-0
lines changed

challenge-066/aaron-rowe/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Aaron Rowe.

challenge-066/aaron-sherman/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Aaron Sherman.

challenge-066/abigail/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Abigail

challenge-066/adam-russell/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Adam Russell

challenge-066/ailbhe-tweedie/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Ailbhe Tweedie

challenge-066/alex-daniel/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Alex Daniel.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Alexander Karelas

challenge-066/alicia-bielsa/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Alicia Beilsa.

challenge-066/andrezgz/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Andrezgz

challenge-066/anton-fedotov/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Anton Fedotov.

challenge-066/antonio-gamiz/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Antonio Gamiz

challenge-066/arne-sommer/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Arne Sommer.

challenge-066/arpad-toth/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Arpad Toth

challenge-066/ash/README

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Solution by Andrew Shitov
2+
3+
Solutions using the Raku programming language:
4+
5+
Comments and explanations to Task 1: https://andrewshitov.com/2020/06/15/raku-daily-skill-builders/

challenge-066/athanasius/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Athanasius

challenge-066/aubrey-quarcoo/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Aubrey Quarcoo

challenge-066/ben-davies/README.md

Lines changed: 11 additions & 0 deletions

challenge-066/bill-palmer/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Bill Palmer.

challenge-066/bob-kleemann/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Bob Kleemann

challenge-066/brtastic/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Bartosz Jarzyna.

challenge-066/bruno-ramos/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Bruno Ramos.

challenge-066/burkhard-nickels/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Burkhard Nickels.

challenge-066/bwva/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution(s) by bwva (Bruce Van Allen)

challenge-066/cheok-yin-fung/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Cheok-Yin Fung.

challenge-066/cliveholloway/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Clive Holloway

challenge-066/colin-crain/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Colin Crain.

challenge-066/craig/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Craig.

challenge-066/creewick/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Creewick.

challenge-066/cristian-heredia/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Cristina Heredia.

challenge-066/daniel-mantovani/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Daniel Mantovani

challenge-066/daniel-mita/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Daniel Mita

challenge-066/darren-bottin/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Darren Bottin.

challenge-066/dave-cross/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Dave Cross

challenge-066/dave-jacoby/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Dave Jacoby

challenge-066/david-kayal/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by David Kayal

challenge-066/denis-yurashku/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Denis Yurashku.

challenge-066/donald-hunter/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Donald Hunter.

challenge-066/doug-schrag/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Doug Schrag

challenge-066/dracos/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Matthew Somerville.

challenge-066/duane-powell/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Duane Powell.

challenge-066/duncan-c-white/README

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
Task 1: "Digits Sum
2+
3+
You are given two positive numbers $N and $S.
4+
5+
Write a script to list all positive numbers having exactly $N digits
6+
where sum of all digits equals to $S.
7+
8+
Example
9+
10+
Input:
11+
$N = 2
12+
$S = 4
13+
14+
Output:
15+
13, 22, 31, 40
16+
"
17+
18+
My notes: sounds like fun.
19+
20+
21+
Task 2: "Palindrome Partition
22+
23+
You are given a string $S. Write a script print all possible partitions
24+
that gives Palindrome. Return -1 if none found.
25+
26+
Please make sure, partition should not overlap. For example, for given
27+
string "abaab", the partition "aba" and "baab" would not be valid,
28+
since they overlap.
29+
30+
Example 1
31+
32+
Input: $S = 'aabaab'
33+
Ouput:
34+
There are 3 possible solutions.
35+
a) 'aabaa'
36+
b) 'aa', 'baab'
37+
c) 'aba'
38+
39+
Example 2
40+
41+
Input: $S = 'abbaba'
42+
Output:
43+
There are 3 possible solutions.
44+
a) 'abba'
45+
b) 'bb', 'aba'
46+
c) 'bab'
47+
"
48+
49+
My notes: hang on, what exactly do we mean by a "partition"? this isn't clear!
50+
51+
First: isn't a single letter a substring - an element - of a partition?
52+
presumably not - otherwise 'a', 'a', 'b', 'a', 'a', 'b' would be a solution
53+
to the first example. So presumably each partitioned substring is of
54+
minimum length 2.
55+
56+
Second: Do all the substrings in a partition have to "span" the string, i.e.
57+
do all the substrings in a partition have to append together to form the
58+
original string? Presumably not, otherwise 'aabaa' would not be a solution to
59+
the first example.
60+
61+
Third: Can there be more than two elements in a single partition of a string?
62+
None of the examples show more than two. I don't know the answer to this one,
63+
so I'll assume that "there can only one or two elements in a partition".
64+
65+
So this problem is badly specified. Let's assume that we mean:
66+
67+
"A partition of a string S is either a single substring of minimum length 2
68+
or a pair of exactly 2 non-overlapping substrings of S, each of minimum length
69+
2. Find all partitions of S for which the partition substring(s) are all
70+
palindromes."
71+
72+
If this isn't the right definition, well damn it, the question should have
73+
been clearer - and I expect full marks!
74+
75+
Having programmed the above, this also claims (for example) that "aa" is a
76+
possible solution to example 1 - which is fair enough by the above statement.
77+
So I tried adding the logic:
78+
- find the single substrings that are palindromes, call that @p1
79+
- find the pairs of non-overlapping substrings where each substring is
80+
a palindrome, call that @p2
81+
- remove from @p1 any element that is one of any pair in @p2
82+
83+
But even this shows 4 solutions for example 1:
84+
85+
aabaa
86+
aba
87+
aa,baab
88+
aa,aa
89+
90+
(whereas only the first 3 are expected). I guess we are saying that aa,aa
91+
should not a solution because aa,baab is (and baab contains aa)? I can't
92+
be bothered to implement this, as the deal is: we implement the problems
93+
given to us; not we first debug the problem specs given to us and then
94+
implement the debugged spec. Please make the problem spec clearer next
95+
week, Mohammed!

challenge-066/e-choroba/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by E. Choroba.

challenge-066/eddy-hs/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Eddy HS

challenge-066/fabrizio-poggi/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Fabrizio Poggi.

challenge-066/feng-chang/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Feng Chang.

challenge-066/finanalyst/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Richard Hainsworth, aka finanalyst

challenge-066/finley/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Finley

challenge-066/fjwhittle/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Francis Whittle

challenge-066/fred-zinn/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Fred Zinn

challenge-066/freddie-b/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Freddie B
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Giuseppe Di Terlizzi.

challenge-066/guillermo-ramos/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Guillermo Ramos.

challenge-066/gustavo-chaves/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Gustavo Chaves

challenge-066/hauke-d/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solutions by Hauke Dämpfling.

challenge-066/ianrifkin/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Ian Rifkin.

challenge-066/izifresh/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by izifresh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Jacques Guinnebault.

challenge-066/jaime/README

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Task #1
2+
3+
Write a script to display months from the year 1900 to 2019 where you
4+
find 5 weekends i.e. 5 Friday, 5 Saturday and 5 Sunday.
5+
6+
## Solution
7+
8+
Months that contain five full weekends have 31 days and start on a Friday. Use `cal` to display March 2019 as an example.
9+
10+
```
11+
#$ cal -h -m 3 2019 # cal is a UNIX utility
12+
March 2019
13+
Su Mo Tu We Th Fr Sa
14+
1 2
15+
3 4 5 6 7 8 9
16+
10 11 12 13 14 15 16
17+
17 18 19 20 21 22 23
18+
24 25 26 27 28 29 30
19+
31
20+
```
21+
22+
The solution runs `cal` and displays months that match this unique
23+
layout.
24+
25+
# Task #2
26+
27+
Write a script that can wrap the given paragraph at a specified column
28+
using the greedy algorithm.
29+
30+
A simple way to do word wrapping is to use a greedy algorithm that
31+
puts as many words on a line as possible, then moving on to the next
32+
line to do the same until there are no more words left to place. This
33+
method is used by many modern word processors, such as OpenOffice.org
34+
Writer and Microsoft Word[citation needed]. This algorithm always uses
35+
the minimum possible number of lines but may lead to lines of widely
36+
varying lengths. The following pseudocode implements this algorithm:
37+
38+
```
39+
SpaceLeft := LineWidth
40+
for each Word in Text
41+
if (Width(Word) + SpaceWidth) > SpaceLeft
42+
insert line break before Word in Text
43+
SpaceLeft := LineWidth - Width(Word)
44+
else
45+
SpaceLeft := SpaceLeft - (Width(Word) + SpaceWidth)
46+
```
47+
48+
Where LineWidth is the width of a line, SpaceLeft is the remaining
49+
width of space on the line to fill, SpaceWidth is the width of a
50+
single space character, Text is the input text to iterate over and
51+
Word is a word in this text.
52+
53+
## Solution
54+
55+
The solution follows the recommended pseudocode. Minor improvements
56+
avoid trailing whitespace.
57+
58+
The script uses `Text::ParseWords::shellwords` from the standard
59+
library to extract chunks of words from `<STDIN>`.

challenge-066/jaldhar-h-vyas/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Solution by Jaldhar H. Vyas

0 commit comments

Comments
 (0)