Perl Weekly Challenge 113: Represent Integer and Recreate Binary Tree
These are some answers to the Week 113 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Task 1: Represent Integer
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
I’m very late and have very little time this week, so I’ll implement this task only in Raku.




