不知道我写的会不会也超时 public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); int[] alpha = new int[26]; String[] strs = new String[n]; for (int i = 0; i < n; i++) strs[i] = sc.nextLine(); HashMap<String,Integer> hashMap = new HashMap<>(); for (int i = 0; i < n; i++) { Arrays.fill(alpha , 0 ); String tmpStr = strs[i]; for (int j = 0; j < tmpStr.length(); j++) alpha[tmpStr.charAt(j) - 'a']++; String string = ""; for (int j = 0; j < 26; j++) string = string + "_" + alpha[j]; hashMap.put(string , hashMap.getOrDefault(string , 0 )+ 1); } int res = 0 ; for (String string : hashMap.keySet()) { if(hashMap.get(string) > res){ res = hashMap.get(string); } } System.out.println(res); }
点赞 评论

相关推荐

程序员花海:实习和校招简历正确格式应该是教育背景+实习+项目经历+个人评价 其中项目经历注意要体现业务 实习经历里面的业务更是要自圆其说 简历模板尽可能保持干净整洁 不要太花哨的
秋招吐槽大会
点赞 评论 收藏
分享
牛客78682892...:直接点还好,总比要了简历也不回的强
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务