TABLE OF CONTENTS
1. HEADLINES
2. RECAP
3. PERL REVIEW
4. RAKU REVIEW
5. CHART
6. NEW MEMBERS
7. GUESTS
8. TASK #1: Common Base String
9. TASK #2: Frequency Sort
HEADLINES
Congratulations Team PWC for crossing the magic number 3rd times in a row, for the second time.
Today is the first Monday of the month and time to declare the Champion. With great pleasure, I announce Myoungjin Jeon
as the next Champion. He joined the Team PWC in the Week #068
. He is currently ranked #38
with contributions Perl: 24
, Raku: 24
and BLOG: 3
.
This week, we had 39 contributions
by guests in 14 different languages. I would like to THANK
each and every guest contributors.
While we are talking about contributions, lets share some interesting stats from the GitHub repository.
1) Commits: 9998 (+219)
2) Pull Requests: 2448 (+58)
3) Contributors: 136
4) Fork: 168 (+1)
5) Stars: 79 (+1)
Last but not the least, I would like to thank each and every member for their support and encouragement.
RECAP
Quick recap of the “The Weekly Challenge - 080” by Mohammad S Anwar
.
PERL REVIEW
If you missed any past reviews then please checkout the collection.
RAKU REVIEW
Please checkout Raku solutions review of the “The Weekly Challenge - 079” by Andrew Shitov
.
If you missed any past reviews then please checkout the collection.
CHART
Please take a look at the charts showing interesting data.
I would like to THANK
every member of the team for their valuable suggestions. Please do share your experience with us.
NEW MEMBERS
Please find out How to contribute?, if you have any doubts.
Please give it a try to an excellent tool EZPWC created by respected member Saif Ahmed
of Team PWC.
GUESTS
1) Adam Russell shared solutions to Task #1 and Task #2 in C++.
2) Adam Russell shared solutions to Task #1 and Task #2 in Prolog.
3) Alexander Pankoff shared solution to Task #1 in Haskell.
4) Andrew Shitov shared solution to Task #1 in C++.
5) Aviral Goel shared solutions to Task #1 and Task #2 in Haskell.
6) Cheok-Yin Fung shared solution to Task #1 in Lisp.
7) Dave Jacoby shared solutions to Task #1 and Task #2 in Node.
8) Kang-min Liu shared solutions to Task #1 and Task #2 in Kotlin.
9) Lubos Kolouch shared solutions to Task #1 and Task #2 in Python.
10) Myoungjin Jeon shared solutions to Task #1 and Task #2 in Elm.
11) Myoungjin Jeon shared solutions to Task #1 and Task #2 in Go.
12) Myoungjin Jeon shared solutions to Task #1 and Task #2 in Haskell.
13) Nuno Vieira shared solutions to Task #1 and Task #2 in JavaScript.
14) Roger Bell_West shared solutions to Task #1 and Task #2 in Python.
15) Roger Bell_West shared solutions to Task #1 and Task #2 in Ruby.
16) Shawn Wagner shared solutions to Task #1 and Task #2 in Tcl.
17) Tyler Wardhaugh shared solutions to Task #1 and Task #2 in Clojure.
18) Tyler Wardhaugh shared solutions to Task #1 and Task #2 in Lua.
19) Ulrich Rieke shared solutions to Task #1 and Task #2 in C++.
20) Ulrich Rieke shared solutions to Task #1 and Task #2 in Haskell.
21) Walt Mankowski shared solutions to Task #1 and Task #2 in Python.
Please find out past solutions by respected guests. Please do share your creative solutions in other languages.
TASK #1 › Common Base String
Submitted by: Mohammad S Anwar
You are given 2 strings, $A
and $B
.
Write a script to find out common base strings in $A
and $B
.
A substring of a string
$S
is called base string if repeated concatenation of the substring results in the string.
Example 1:
Input:
$A = "abcdabcd"
$B = "abcdabcdabcdabcd"
Output:
("abcd", "abcdabcd")
Example 2:
Input:
$A = "aaa"
$B = "aa"
Output:
("a")
TASK #2 › Frequency Sort
Submitted by: Mohammad S Anwar
You are given file named input
.
Write a script to find the frequency of all the words.
It should print the result as first column of each line should be the frequency of the the word followed by all the words of that frequency arranged in lexicographical order. Also sort the words in the ascending order of frequency.
INPUT file
West Side Story
The award-winning adaptation of the classic romantic tragedy "Romeo and Juliet". The feuding families become two warring New York City gangs, the white Jets led by Riff and the Latino Sharks, led by Bernardo. Their hatred escalates to a point where neither can coexist with any form of understanding. But when Riff's best friend (and former Jet) Tony and Bernardo's younger sister Maria meet at a dance, no one can do anything to stop their love. Maria and Tony begin meeting in secret, planning to run away. Then the Sharks and Jets plan a rumble under the highway--whoever wins gains control of the streets. Maria sends Tony to stop it, hoping it can end the violence. It goes terribly wrong, and before the lovers know what's happened, tragedy strikes and doesn't stop until the climactic and heartbreaking ending.
NOTE
For the sake of this task, please ignore the following in the input file:
. " ( ) , 's --
OUTPUT
1 But City It Jet Juliet Latino New Romeo Side Story Their Then West York adaptation any anything at award-winning away become before begin best classic climactic coexist control dance do doesn't end ending escalates families feuding form former friend gains gangs goes happened hatred heartbreaking highway hoping in know love lovers meet meeting neither no one plan planning point romantic rumble run secret sends sister streets strikes terribly their two under understanding until violence warring what when where white whoever wins with wrong younger
2 Bernardo Jets Riff Sharks The by it led tragedy
3 Maria Tony a can of stop
4 to
9 and the
Last date to submit the solution 23:59 (UK Time) Sunday 11th October 2020.