Challenge Active

The Weekly Challenge

You don't have   to be an   expert

The Weekly Challenge
Task #1 Dyck Words

A Dyck Word of order $n is a string of length 2x$n consisting of $n 'U' (Up) characters and $n 'D' (Down) characters such that no initial prefix of the string contains more 'D's than 'U's. Write a script to return a list of all valid Dyck words of length 2x$n, sorted in lexicographical (alphabetical) order.

Task #2 Secret Santa

A company with $n employees is running a Secret Santa exchange. Each employee buys one gift and receives one gift. Write a script to return the total number of valid gift assignments where no employee receives the gift they originally bought (i.e., employee $i must not be assigned gift $i).

Design Patterns in Modern Perl
📖 New Book by Mohammad Sajid Anwar

Design Patterns in Modern Perl

Classic object-oriented patterns in today's Perl - using core Perl, Moo and Object::Pad. Cleaner, more maintainable code.

View Book →

SO WHAT DO YOU THINK ?

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

Contact with me