Skip to content

字符在字符串中出现的频率统计 | October #2

Description

@supertpx

https://supertpx.github.io/ac-1/#more

问题描述: 统计字符串中每一个字符在该字符串中出现的次数,按次数从高至低排序输出,若次数相同,则按在该字符串中出现的顺序输出,区分大小写。 解题思路: 此题分为两部分,统计字符出现次数,可以用LinkedHashMap来统计;按次数从高至低输出,则需要对map的value进行排序,可以利用Comparator比较器。

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions