Error
|
|
---|---|
@Ibrahim Nash | 5765 |
@blackshadows | 5715 |
@akhayrutdinov | 5111 |
@mb1973 | 4993 |
@Quandray | 4944 |
@saiujwal13083 | 4506 |
@sanjay05 | 3762 |
@marius_valentin_dragoi | 3516 |
@sushant_a | 3459 |
@verma_ji | 3341 |
@KshamaGupta | 3318 |
Complete Leaderboard | |
|
|
@aroranayan999 | 1272 |
@bt8816103042 | 739 |
@rohitanand | 495 |
@codeantik | 479 |
@shalinibhataniya1097 | 472 |
@amrutakashikar2 | 464 |
@thealchemist627 | 456 |
@shivanandp12345678910 | 453 |
@dalwainazism125 | 453 |
@akashkale117 | 453 |
@SherlockHolmes3 | 447 |
Complete Leaderboard |
Given an integer n, your task is to complete the function convertToRoman which prints the corresponding roman number of n. Various symbols and their values are given below.
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
Example 1:
Input:
n = 5
Output: V
Example 2:
Input:
n = 3
Output: III
Your Task:
Complete the function convertToRoman() which takes an integer N as input parameter and returns the equivalent roman.
Expected Time Complexity: O(log10N)
Expected Auxiliary Space: O(log10N * 10)
Constraints:
1<=n<=3999
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes