6 kyu
Roman Numerals Encoder
16,026 of 56,641jhoffner
Description:
Create a function taking a positive integer between 1
and 3999
(both included) as its parameter and returning a string containing the Roman Numeral representation of that integer.
Modern Roman numerals are written by expressing each digit separately starting with the leftmost digit and skipping any digit with a value of zero. There cannot be more than 3 identical symbols in a row.
In Roman numerals:
1990
is rendered:1000
=M
+900
=CM
+90
=XC
; resulting inMCMXC
.2008
is written as2000
=MM
,8
=VIII
; orMMVIII
.1666
uses each Roman symbol in descending order:MDCLXVI
.
Example:
1 --> "I"
1000 --> "M"
1666 --> "MDCLXVI"
Help:
Symbol Value
I 1
V 5
X 10
L 50
C 100
D 500
M 1,000
Algorithms
Similar Kata:
Stats:
Created | Jun 10, 2013 |
Published | Jun 10, 2013 |
Warriors Trained | 167577 |
Total Skips | 30462 |
Total Code Submissions | 216151 |
Total Times Completed | 56641 |
JavaScript Completions | 16026 |
CoffeeScript Completions | 134 |
Ruby Completions | 1939 |
Python Completions | 15387 |
Haskell Completions | 604 |
Java Completions | 7111 |
TypeScript Completions | 1761 |
C++ Completions | 3889 |
PHP Completions | 1917 |
C# Completions | 3755 |
Swift Completions | 859 |
Elixir Completions | 226 |
Rust Completions | 974 |
R Completions | 174 |
Solidity Completions | 208 |
C Completions | 1310 |
Nim Completions | 32 |
Lua Completions | 174 |
Scala Completions | 244 |
Kotlin Completions | 704 |
Julia Completions | 40 |
Clojure Completions | 34 |
COBOL Completions | 9 |
Go Completions | 597 |
F# Completions | 24 |
Total Stars | 3346 |
% of votes with a positive feedback rating | 90% of 5424 |
Total "Very Satisfied" Votes | 4508 |
Total "Somewhat Satisfied" Votes | 795 |
Total "Not Satisfied" Votes | 121 |