Leetcode 2182. Construct String With Repeat Limit

Posted on Mon 16 December 2024 in Leetcode • Tagged with priority-queue

Question Link : https://leetcode.com/problems/construct-string-with-repeat-limit/

Difficulty: Medium

Premium: False

Question

You are given a string s and an integer repeatLimit. Construct a new string repeatLimitedString using the characters of s such that no letter appears more than repeatLimit times in a row. You do not have to use …


Continue reading

Leetcode 3264. Final Array State After K Multiplication Operations I

Posted on Sun 15 December 2024 in Leetcode • Tagged with priority-queue

Question Link : https://leetcode.com/problems/final-array-state-after-k-multiplication-operations-i/

Difficulty: Easy

Premium: False

Question

You are given an integer array nums, an integer k, and an integer multiplier. You need to perform k operations on nums. In each operation:

Find the minimum value x in nums. If there are multiple occurrences of …


Continue reading

Leetcode 0215. Kth Largest Element in an Array

Posted on Tue 10 December 2024 in Leetcode • Tagged with k-most-points, priority-queue, bubble-sort, quick-sort, counting-sort

Question Link : https://leetcode.com/problems/kth-largest-element-in-an-array/

Difficulty: Medium

Premium: False

Question

Given an integer array nums and an integer k, return the kth largest element in the array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Can you solve it …


Continue reading

Leetcode 1046. Last Stone Weight

Posted on Mon 24 April 2023 in Leetcode • Tagged with priority-queue

Question Link : https://leetcode.com/problems/last-stone-weight/

Difficulty: Easy

Premium: False

Question

You are given an array of integers stones where stones[i] is the weight of the ith stone. We are playing a game with the stones. On each turn, we choose the heaviest two stones and smash them …


Continue reading