The Weekly Challenge
You don't have to be an expert
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.
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).
SO WHAT DO YOU THINK ?
If you have any suggestions or ideas then please do share with us.
Contact with me