generated from jfarmer/template-javascript
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathtoRoman.js
28 lines (25 loc) · 787 Bytes
/
toRoman.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* Given a positive integer, returns a string containing that integer's
* Roman numeral representation.
*
* We recommend doing this work in two iterations: first supporting only
* additive Roman numerals and then adding support for subtractive
* Roman numerals. See the README for details.
*
* @example
* toRoman(1); // => 'I'
* toRoman(6); // => 'VI'
* toRoman(152); // => 'CLII'
*
* @param {number} num - An integer
* @returns {string} The input integer's Roman numeral representation
*/
function toRoman(num) {
// This is your job. :)
}
if (require.main === module) {
console.log('Running sanity checks for toRoman:');
// Add your own sanity checks here.
// How else will you be sure your code does what you think it does?
}
module.exports = toRoman;