Leetcode 2423. Remove Letter To Equalize Frequency

Posted on Fri 11 November 2022 in Leetcode • Tagged with hash-map-count

Question Link : https://leetcode.com/problems/remove-letter-to-equalize-frequency/

Difficulty: Easy

Question

You are given a 0-indexed string word, consisting of lowercase English letters. You need to select one index and remove the letter at that index from word so that the frequency of every letter present in word is equal. Return …


Continue reading

Leetcode 2404. Most Frequent Even Element

Posted on Wed 09 November 2022 in Leetcode • Tagged with hash-map-count

Question Link : https://leetcode.com/problems/most-frequent-even-element/

Difficulty: Easy

Question

Given an integer array nums, return the most frequent even element. If there is a tie, return the smallest one. If there is no such element, return -1.   Example 1:

Input: nums = [0,1,2,2,4,4,1] Output …


Continue reading

Leetcode 2456. Most Popular Video Creator

Posted on Sat 05 November 2022 in Leetcode • Tagged with hash-map-count

Question Link : https://leetcode.com/problems/most-popular-video-creator/

Difficulty: Medium

Question

You are given two string arrays creators and ids, and an integer array views, all of length n. The ith video on a platform was created by creator[i], has an id of ids[i], and has views[i] views …


Continue reading

Leetcode 1647. Minimum Deletions to Make Character Frequencies Unique

Posted on Mon 27 June 2022 in Leetcode • Tagged with hash-map-count

Question Link : https://leetcode.com/problems/minimum-deletions-to-make-character-frequencies-unique/

Difficulty: Medium

Question

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 …


Continue reading

Leetcode 2284. Sender With Largest Word Count

Posted on Wed 15 June 2022 in Leetcode • Tagged with hash-map-count

Question Link : https://leetcode.com/problems/sender-with-largest-word-count/

Difficulty: Medium

Question

You have a chat log of n messages. You are given two string arrays messages and senders where messages[i] is a message sent by senders[i]. A message is list of words that are separated by a single space …


Continue reading

Leetcode 2283. Check if Number Has Equal Digit Count and Digit Value

Posted on Wed 08 June 2022 in Leetcode • Tagged with hash-map-count

Question Link : https://leetcode.com/problems/check-if-number-has-equal-digit-count-and-digit-value/

Difficulty: Easy

Question

You are given a 0-indexed string num of length n consisting of digits. Return true if for every index i in the range 0 <= i < n, the digit i occurs num[i] times in num, otherwise return false.   Example 1 …


Continue reading

Leetcode 2287. Rearrange Characters to Make Target String

Posted on Wed 08 June 2022 in Leetcode • Tagged with hash-map-count

Question Link : https://leetcode.com/problems/rearrange-characters-to-make-target-string/

Difficulty: Easy

Question

You are given two 0-indexed strings s and target. You can take some letters from s and rearrange them to form new strings. Return the maximum number of copies of target that can be formed by taking letters from s …


Continue reading