举例输入: abc abc de de de fghi fghi 应该返回: de 代码: static List<String> func(String str) { String[] parts = str.split(" "); Map<String, Integer> map = new HashMap<String, Integer>(); int len = parts.length; for (int i = 0; i < len…
javascript 写一段代码,判断一个字符串中出现次数最多的字符串,并统计出现的次数 function test(){ var bt = document.getElementById("bt"); bt.addEventListener("click",function(){ var str = "dafdsjkfnaiesdaadsllllllkkkkk444444444444444"; var obj = []; // 存放结果集的数组…