diff options
| author | Abigail <abigail@abigail.be> | 2020-12-28 20:06:56 +0100 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2020-12-28 20:06:56 +0100 |
| commit | e062f7a08729efb32afd4dd443b8eba2fa42c182 (patch) | |
| tree | b0c7f4a3298db61d79010ea036fd226246a1d8ae /challenge-093 | |
| parent | 87927492cb49de9007fe648178c8d6804b526218 (diff) | |
| download | perlweeklychallenge-club-e062f7a08729efb32afd4dd443b8eba2fa42c182.tar.gz perlweeklychallenge-club-e062f7a08729efb32afd4dd443b8eba2fa42c182.tar.bz2 perlweeklychallenge-club-e062f7a08729efb32afd4dd443b8eba2fa42c182.zip | |
Add challenges to README
Diffstat (limited to 'challenge-093')
| -rw-r--r-- | challenge-093/abigail/README.md | 72 |
1 files changed, 45 insertions, 27 deletions
diff --git a/challenge-093/abigail/README.md b/challenge-093/abigail/README.md index 5a536096fe..583fee5320 100644 --- a/challenge-093/abigail/README.md +++ b/challenge-093/abigail/README.md @@ -1,50 +1,68 @@ # Solution by Abigail -## Task 1: Isomorphic Strings +## Task 1: Max Points -You are given two strings `$A` and `$B`. +You are given set of co-ordinates `@N`. -Write a script to check if the given strings are Isomorphic. Print -`1` if they are otherwise `0`. +Write a script to count maximum points on a straight line when given +co-ordinates plotted on 2-d plane. ### Examples ~~~~ -Input: $A = "abc"; $B = "xyz" -Output: 1 +| +| x +| x +| x ++ _ _ _ _ -Input: $A = "abb"; $B = "xyy" -Output: 1 +Input: (1,1), (2,2), (3,3) +Output: 3 -Input: $A = "sum"; $B = "add" -Output: 0 + +| +| +| x x +| x +| x x ++ _ _ _ _ _ + +Input: (1,1), (2,2), (3,1), (1,3), (5,3) +Output: 3 ~~~~ ### Solutions -* [Perl](perl/ch-1.pl). -### Blog -[Blog Post](https://wp.me/pcxd30-jK). -## Task 2: Insert Interval -You are given a set of sorted non-overlapping intervals and a new interval. +## Task 2: Sum Path -Write a script to merge the new interval to the given set of intervals. +You are given binary tree containing numbers `0-9` only. + +Write a script to sum all possible paths from root to leaf. ### Examples ~~~~ -Input $S = (1,4), (8,10); $N = (2,6) -Output: (1,6), (8,10) - -Input $S = (1,2), (3,7), (8,10); $N = (5,8) -Output: (1,2), (3,10) +Input: + 1 + / + 2 + / \ + 3 4 + +Output: 13 +~~~~ +as sum two paths (1->2->3) and (1->2->4) -Input $S = (1,5), (7,9); $N = (10,11) -Output: (1,5), (7,9), (10,11) ~~~~ +Input: + 1 + / \ + 2 3 + / / \ + 4 5 6 + +Output: 26 +~~~~ +as sum three paths (1->2->4), (1->3->5) and (1->3->6) ### Solutions -* [Perl](perl/ch-2.pl). - -### Blog -[Blog Post](https://wp.me/pcxd30-ka). |
