## The Weekly Challenge - 086

Monday, Nov 9, 2020| Tags: Perl, Raku

### 9. TASK #2: Sudoku Puzzle

Congratulations Team PWC for crossing the magic number `8th consecutive weeks`. Well done and keep it up.

This week, we had `30 contributions` by guests in `12` 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.

#### 5) Stars: 82 (+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 - 085” by `Mohammad S Anwar`.

## PERL REVIEW

Please checkout Perl solutions review of the “The Weekly Challenge - 084” 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 - 083” 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

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

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

## TASK #1 › Pair Difference

You are given an array of integers `@N` and an integer `\$A`.

Write a script to find find if there exists a pair of elements in the array whose difference is `\$A`.

Print `1` if exists otherwise `0`.

## Example 1:

``````Input: @N = (10, 8, 12, 15, 5) and \$A = 7
Output: 1 as 15 - 8 = 7
``````

## Example 2:

``````Input: @N = (1, 5, 2, 9, 7) and \$A = 6
Output: 1 as 7 - 1 = 6
``````

## Example 3:

``````Input: @N = (10, 30, 20, 50, 40) and \$A = 15
Output: 0
``````

## TASK #2 › Sudoku Puzzle

You are given Sudoku puzzle (9x9).

Write a script to complete the puzzle and must respect the following rules:

## Example:

``````[ _ _ _ 2 6 _ 7 _ 1 ]
[ 6 8 _ _ 7 _ _ 9 _ ]
[ 1 9 _ _ _ 4 5 _ _ ]
[ 8 2 _ 1 _ _ _ 4 _ ]
[ _ _ 4 6 _ 2 9 _ _ ]
[ _ 5 _ _ _ 3 _ 2 8 ]
[ _ _ 9 3 _ _ _ 7 4 ]
[ _ 4 _ _ 5 _ _ 3 6 ]
[ 7 _ 3 _ 1 8 _ _ _ ]
``````

## Output:

``````[ 4 3 5 2 6 9 7 8 1 ]
[ 6 8 2 5 7 1 4 9 3 ]
[ 1 9 7 8 3 4 5 6 2 ]
[ 8 2 6 1 9 5 3 4 7 ]
[ 3 7 4 6 8 2 9 1 5 ]
[ 9 5 1 7 4 3 6 2 8 ]
[ 5 1 9 3 2 6 8 7 4 ]
[ 2 4 8 9 5 7 1 3 6 ]
[ 7 6 3 4 1 8 2 5 9 ]
``````

As the above puzzle respect the 3 rules including 9-sub-boxes as shown below:

``````[ 4 3 5 ] [ 2 6 9 ] [ 7 8 1 ]
[ 6 8 2 ] [ 5 7 1 ] [ 4 9 3 ]
[ 1 9 7 ] [ 8 3 4 ] [ 5 6 2 ]

[ 8 2 6 ] [ 1 9 5 ] [ 3 4 7 ]
[ 3 7 4 ] [ 6 8 2 ] [ 9 1 5 ]
[ 9 5 1 ] [ 7 4 3 ] [ 6 2 8 ]

[ 5 1 9 ] [ 3 2 6 ] [ 8 7 4 ]
[ 2 4 8 ] [ 9 5 7 ] [ 1 3 6 ]
[ 7 6 3 ] [ 4 1 8 ] [ 2 5 9 ]
``````

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

## SO WHAT DO YOU THINK ?

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