The Weekly Challenge - 083

Monday, Oct 19, 2020| Tags: Perl, Raku

TABLE OF CONTENTS


1. HEADLINES

2. RECAP

3. PERL REVIEW

4. RAKU REVIEW

5. CHART

6. NEW MEMBERS

7. GUESTS

8. TASK #1: Words Length

9. TASK #2: Flip Array


HEADLINES


Congratulations Team PWC for crossing the magic number 5th times in a row, first time ever since the start of the journey.

Checkout the interview with the Champion: Myoungjin Jeon.

Contributions Summary


Welcome Philip Hood and Dieter Dobbelaere to the Team PWC.

This week, we had 28 contributions by guests in 12 different languages. I would like to THANK each and every guest contributors.

GNAT is the new language introduced this week by Philip Hood.

Languages Summary


While we are talking about contributions, lets share some interesting stats from the GitHub repository.

1) Commits: 10,442 (+259)

2) Pull Requests: 2,559 (+65)

3) Contributors: 140 (+3)

4) Fork: 172 (+2)

5) Stars: 80 (+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 - 082” by Mohammad S Anwar.


PERL REVIEW


Please checkout Perl solutions review of the “The Weekly Challenge - 081” by Colin Crain.

If you missed any past reviews then please checkout the collection.


RAKU REVIEW


Please checkout Raku solutions review of the “The Weekly Challenge - 081” 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


1) Philip Hood, an experienced Raku hacker from NYC.

2) Dieter Dobbelaere, an experienced Perl hacker from Belgium.


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) Lubos Kolouch shared solutions to Task #1 and Task #2 in Python.

2) Myoungjin Jeon shared solutions to Task #1 and Task #2 in Elm.

3) Myoungjin Jeon shared solutions to Task #1 and Task #2 in Go.

4) Myoungjin Jeon shared solutions to Task #1 and Task #2 in Haskell.

5) Nuno Vieira shared solutions to Task #1 and Task #2 in JavaScript.

6) Philip Hood shared solution to Task #1 in GNAT.

7) Richard Park shared solutions to Task #1 and Task #2 in APL.

8) Roger Bell_West shared solutions to Task #1 and Task #2 in Python.

9) Roger Bell_West shared solutions to Task #1 and Task #2 in Ruby.

10) Tyler Wardhaugh shared solutions to Task #1 and Task #2 in Clojure.

11) Tyler Wardhaugh shared solutions to Task #1 and Task #2 in Lua.

12) Ulrich Rieke shared solution to Task #1 in C++.

13) Ulrich Rieke shared solutions to Task #1 and Task #2 in Haskell.

14) 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 › Words Length

Submitted by: Mohammad S Anwar

You are given a string $S with 3 or more words.

Write a script to find the length of the string except the first and last words ignoring whitespace.

Example 1:

Input: $S = "The Weekly Challenge"

Output: 6

Example 2:

Input: $S = "The purpose of our lives is to be happy"

Output: 23


TASK #2 › Flip Array

Submitted by: Mohammad S Anwar

You are given an array @A of positive numbers.

Write a script to flip the sign of some members of the given array so that the sum of the all members is minimum non-negative.

Given an array of positive elements, you have to flip the sign of some of its elements such that the resultant sum of the elements of array should be minimum non-negative(as close to zero as possible). Return the minimum no. of elements whose sign needs to be flipped such that the resultant sum is minimum non-negative.

Example 1:

Input: @A = (3, 10, 8)
Output: 1

Explanation:

Flipping the sign of just one element 10 gives the result 1 i.e. (3) + (-10) + (8) = 1

Example 2:

Input: @A = (12, 2, 10)
Output: 1

Explanation:

Flipping the sign of just one element 12 gives the result 0 i.e. (-12) + (2) + (10) = 0


Last date to submit the solution 23:59 (UK Time) Sunday 25th October 2020.


SO WHAT DO YOU THINK ?

If you have any suggestions or ideas then please do share with us.

Contact with me