Skip to content

Conversation

ChobobDev
Copy link
Member

독설을 기다립니당

Comment on lines +59 to +76
func romanToInt(s string) int {
if len(s) == 0 {
return 0
}
currentnum, prevint, total := 0, 0, 0
for i := 0; i < len(s); i++ {
char := s[len(s)-(i+1) : len(s)-i]
currentnum = roman[char]
if currentnum < prevint {
total = total - currentnum
} else {
total = total + currentnum
}
prevint = currentnum
}
return total

}
Copy link
Member

@ForestLee0513 ForestLee0513 Jun 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

들여쓰기랑 줄넘김이 개선되면 좋을 것 같아요 👀

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런 실수를 했을리 없어... 에디터 문제 인거죠...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants