Given a list of integers expressed as roman numerals, compute their sum.

- Example 1:
Input: I + II

Output: 3.

Explanation: I + II = 1 + 2 = 3

- Example 2:
Input: XXXVIII + IV + XXV

Output: 67.

Explanation: XXXVIII + IV + XXV = 38 + 4 + 25 = 67

- Example 3:
Input: MCLXVI + DCCCXXVI + MMMCXCIX

Output: 5191.

Explanation: MCLXVI + DCCCXXVI + MMMCXCIX = 1166 + 826 + 3199 = 5191

- The number of roman numerals contained in INPUT is greater than 0 and less than 100.
- Roman numerals in INPUT are separated by a "+" sign.
- Roman numerals are always positive.
- 0 (zero) does not exists in roman numerals.

You must be signed in to view submissions.

Select an version of ChatGPT: