Leetcode Algorithms -- Roman to Integer
Roman to Integer (Easy)
Description
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
Analysis
罗马数字转换成数字。因为肯定是非递增的,突然递增的情况下就是相减
My Solution
1 | //C++ |
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
罗马数字转换成数字。因为肯定是非递增的,突然递增的情况下就是相减
1 | //C++ |