The Weekly Challenge - 113

Monday, May 17, 2021| Tags: Perl, Raku

TABLE OF CONTENTS


01. HEADLINES

02. SPONSOR

03. RECAP

04. PERL REVIEW

05. RAKU REVIEW

06. CHART

07. NEW MEMBERS

08. GUESTS

09. TASK #1: Represent Integer

10. TASK #2: Recreate Binary Tree


HEADLINES


Let us all welcome, Dimitar Dimitrov, to the Team PWC. In the first week itself, we have received solution in Perl.


Mohammad Anwar: Ordered Letters




Let us share some interesting stats from the GitHub repository.

1. Commits: 16,746 (+188)

2. Pull Requests: 4,090 (+48)

3. Contributors: 165 (+1)

4. Fork: 207 (+3)

5. Stars: 91


Last but not least, I would like to thank each and every member for their support and encouragement.



Our solo sponsor Pete Sergeant has been a great support to keep us motivated. We are lucky that he agreed to continue the journey with us in the year 2021. I would like to personally thank Pete and his entire team for their generosity. It would be great if we could add few more to sponsor the prize money so that we could go back and declare weekly champions as we have done in the past. I hope and wish this will become possible in 2021. The amount doesn’t have to be huge. However, it would be nice to show off bunch of supporters. If an organisation comes forward and supports us then that would be the ultimate achievement.


RECAP


Quick recap of “The Weekly Challenge - 112” by Mohammad S Anwar.


PERL REVIEW


Please check out Perl solutions review of the “Perl Weekly Challenge - 110” by Colin Crain.

If you missed any past reviews then please check out the collection.


RAKU REVIEW


If you missed any past reviews then please check out 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


Dimitar Dimitrov, an experienced Perl hacker, joined the Team PWC.

Please find out How to contribute?, if you have any doubts.

Please try the excellent tool EZPWC created by respected member Saif Ahmed of Team PWC.


GUESTS


Please checkout the guest contributions for the Week #112.

Please find past solutions by respected guests. Please share your creative solutions in other languages.


TASK #1 › Represent Integer

Submitted by: Mohammad S Anwar

You are given a positive integer $N and a digit $D.

Write a script to check if $N can be represented as a sum of positive integers having $D at least once. If check passes print 1 otherwise 0.

Example

Input: $N = 25, $D = 7
Output: 0 as there are 2 numbers between 1 and 25 having the digit 7 i.e. 7 and 17. If we add up both we don't get 25.

Input: $N = 24, $D = 7
Output: 1

TASK #2 › Recreate Binary Tree

Submitted by: Mohammad S Anwar

You are given a Binary Tree.

Write a script to replace each node of the tree with the sum of all the remaining nodes.

Example

Input Binary Tree

        1
       / \
      2   3
     /   / \
    4   5   6
     \
      7

Output Binary Tree

        27
       /  \
      26  25
     /   /  \
    24  23  22
     \
     21


Last date to submit the solution 23:59 (UK Time) Sunday 23rd May 2021.


SO WHAT DO YOU THINK ?

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

Contact with me