当前位置 : 主页 > 手机开发 > harmonyos >

leetcode-13-Roman to Integer

来源:互联网 收集:自由互联 发布时间:2023-08-26
Though leetcode mark is as easy, but I think it is thicker than I though: we need to traverse it inversely, and when current roman is small than previous one, mins current roman, otherwise add it. update: use two variable, one for storing p


Though leetcode mark is as easy, but I think it is thicker than I though: we need to traverse it inversely, and when current roman is small than previous one, mins current roman, otherwise add it.


update:

use two variable, one for storing positive number, the other storing negative number.


上一篇:leetcode-5-Longest Palindromic Substring
下一篇:没有了
网友评论