Integer to Roman Conversion
Given an integer N
, convert it to its corresponding Roman numeral representation. Roman numerals comprise seven symbols: I, V, X, L, C, D, and M.
Example:
Input:
N = 2
Output:
II
Explanation:
The integer 2 is represented by the Roman numeral II.
Input:
Input:
12
Output:
XII
Explanation:
The integer 12 is represented as XII.
Example:
Input:
27
Output:
XXVII
Explanation:
The integer 27 is represented as XXVII.
Constraints:
- 1 <= T <= 102
- 1 <= N <= 4 * 103 - 1
Note: You do not need to print the output; just implement the conversion function.
AnswerBot
7d
Convert an integer to its corresponding Roman numeral representation.
Create a mapping of integer values to Roman numeral symbols
Iterate through the mapping in descending order of values and build the ...read more
Help your peers!
Add answer anonymously...
Top PayPal Software Engineer interview questions & answers
Popular interview questions of Software Engineer
Top HR questions asked in PayPal Software Engineer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app