ℹ️ For detailed information about the contest, check out devadvent/readme
For hundreds of years, the elves have been working with roman numerals. They use it everywhere - in file cabinets, in notes, etc. This was okay when the numbers were smaller. But some index cards sure are getting big, and the roman version of reading it is just not practical anymore.
Therefore once again the head elf 🧝 counts on your help.
Complete the function romanToArabic
in src/utils/roman.js.
The parameter input
is a string of roman numerals, either in lower- or uppercase (e.g. CXXIII
or cxxiii
).
Return the arabic number for a given roman number.
You can assume the numbers will be between 1
and 99999
.
📖 Learn more about roman numerals 🧪 Online converter to try out some values
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/r6od1WSS
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