Integer to Roman
https://leetcode.com/problems/integer-to-roman/description/
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
Thoughts
本质上是不断除10, 把每一位映射回去. 只是千, 百, 十都有各自的映射.
Code
Analysis
时空复杂度O(1).
Last updated
Was this helpful?