6 kyu
Roman Numerals Encoder
15,996 of 56,523jhoffner
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 | 167219 |
Total Skips | 30427 |
Total Code Submissions | 215856 |
Total Times Completed | 56523 |
JavaScript Completions | 15996 |
CoffeeScript Completions | 134 |
Ruby Completions | 1939 |
Python Completions | 15352 |
Haskell Completions | 603 |
Java Completions | 7100 |
TypeScript Completions | 1754 |
C++ Completions | 3878 |
PHP Completions | 1911 |
C# Completions | 3744 |
Swift Completions | 858 |
Elixir Completions | 226 |
Rust Completions | 972 |
R Completions | 174 |
Solidity Completions | 208 |
C Completions | 1307 |
Nim Completions | 32 |
Lua Completions | 173 |
Scala Completions | 243 |
Kotlin Completions | 703 |
Julia Completions | 40 |
Clojure Completions | 34 |
COBOL Completions | 9 |
Go Completions | 595 |
F# Completions | 24 |
Total Stars | 3344 |
% of votes with a positive feedback rating | 90% of 5418 |
Total "Very Satisfied" Votes | 4504 |
Total "Somewhat Satisfied" Votes | 793 |
Total "Not Satisfied" Votes | 121 |