摘要: https://leetcode-cn.com/problems/roman-to-integer/ 能比较快想到的一个方法: public class RomanToInt { public static int romanToInt(String s) { int ret = 0; Map<St 阅读全文
posted @ 2021-05-05 20:29 cstar(小乐) 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 输入1: AAABBC 输出1: A3B2C 输入2:DDBCAA 输出2:A2B1C1D2 解析:首先想到的是用一个hashmap来存储每个字母的统计,然后再对hashmap的关键字进行排序 按照字母顺序输出打印,实现代码如下: public static String charCount(Str 阅读全文
posted @ 2021-05-05 09:57 cstar(小乐) 阅读(344) 评论(0) 推荐(0) 编辑