Open ShannonHung opened 4 months ago
https://shannonhung.github.io/posts/leetcode-12-integer-to-roman/
題目來源:https://leetcode.com/problems/roman-to-integer/description/ 1 題目描述 把數字轉換成羅馬數字,正常情況就是把每個字母相加,並且大字母在前,小字母在後,上邊也介紹了像 4 和 9 那些特殊情況。 2 解法 2.1 我的作法(無HashTable) 簡單粗暴些,把所有可能都列舉出來,包含1000, 900, 500, 40
https://shannonhung.github.io/posts/leetcode-12-integer-to-roman/
題目來源:https://leetcode.com/problems/roman-to-integer/description/ 1 題目描述 把數字轉換成羅馬數字,正常情況就是把每個字母相加,並且大字母在前,小字母在後,上邊也介紹了像 4 和 9 那些特殊情況。 2 解法 2.1 我的作法(無HashTable) 簡單粗暴些,把所有可能都列舉出來,包含1000, 900, 500, 40