I know s
is the string of roman numerals but because I don't know what i
stand for, I am not sure what s[i]
means. I am trying to understand the solution that is posted line by line, but am stuck with this specific part. All help is appreciated, I understand the roman numeral system fully.
Asked
Active
Viewed 48 times
-3

Yash Mehta
- 2,025
- 3
- 9
- 20

adiligentlearner
- 1
- 2
-
1Welcome to stack overflow! Please [edit] your question to include a [mcve] with the code as text in the body of the question, rather than as an image or link – G. Anderson Dec 14 '22 at 18:38
-
Please provide enough code so others can better understand or reproduce the problem. – Community Dec 15 '22 at 12:07
1 Answers
0
"i" is the index of the character being examined in "s". Index starts at 0.
"total" is an accumulator. It is the sum of values of each roman character.

user3435121
- 633
- 4
- 13