ICode9

精准搜索请尝试: 精确搜索
  • LeetCode 1647. 字符频次唯一的最小删除次数**2022-02-24 22:06:57

    具体思想: 主体思想是如何去除重复元素; 采用贪心思想: 1.可以使用去重set记录已经出现的频次,如果重复,就减到为零或者不再重复,讲新次数入set; 2.可以逆序排序。 从频次最高的开始遍历,如果当前频次和前一个频次相同,则-1,使其不同; 如果当前频次大于前一个平次,则说明当前频次和之前的

  • 【leetcode】1647. Minimum Deletions to Make Character Frequencies Unique2022-02-03 10:02:29

    题目如下: A string s is called good if there are no two different characters in s that have the same frequency. Given a string s, return the minimum number of characters you need to delete to make s good. The frequency of a character in a strin

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有