ℹ️ For detailed information about the contest, check out devadvent/readme
There was a minor accident in the EPS (Elf Postal Service). The door of a delivery truck was not closed correctly, and some gifts fell in the snow.
This caused some name tags to be smudged in a way that some of the letters are not recognized anymore.
It is your task to recuperate the original names from the gift tags.
The affected gifts are in the src/data/gifts.js file - an array of objects. The name of the gift is the giftName
property, and the gift recipient's name in the for
property. The letters in the name that are smudged, are marked with a #
. You can assume one #
= 1 letter, and that no letters are missing.
Complete the function matchedNames
that returns an array of possible names that match the smudged name (counter-checking with names.js).
Examples: Anthon#
= ['Anthony']
, Helen#
= ['Helena', 'Helene']
💡 Hint: Regular expressions
- The answer always needs to be an array
- The smudges can appear in any place of the name
- One smudge
#
represents one letter - If no results are found, an empty array should be returned
Check out the contributing guide for details about how to participate.
In short:
- ✨ Create your repository by acceping the assignment using the participation link
- 🧩 Solve the puzzle
- 🐦 Add your Twitter handle to
twitter.js
- 🤖 Test your solution
- 🚀 Upload your changes to the
main
branch
In order to participate, you need to enter the following link and accept the assignment: https://classroom.github.com/a/N3LXDVoW
Install the dependencies with
yarn install
or
npm install
Run the code with
yarn dev
or
npm run dev
This puzzle is equipped with automated tests (in the ./tests
folder). In order for your solution to qualify for winning the daily prize, all tests need to pass.
To run these tests, execute one of the following commands in your console:
yarn test
or
npm test