815 Champagne Tower
Champagne Tower We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row. Each glass holds one cup of champagne. Then, some ch...
Champagne Tower We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row. Each glass holds one cup of champagne. Then, some ch...
Longest Balanced Substring II You are given a string s consisting only of the characters ‘a’, ‘b’, and ‘c’. A substring of s is called balanced if all distinct characters in the substring appear...
Longest Balanced Substring I You are given a string s consisting of lowercase English letters. A substring of s is called balanced if all distinct characters in the substring appear the same num...
Longest Balanced Subarray II You are given an integer array nums. A subarray is called balanced if the number of distinct even numbers in the subarray is equal to the number of distinct odd numb...
Longest Balanced Subarray I You are given an integer array nums. A subarray is called balanced if the number of distinct even numbers in the subarray is equal to the number of distinct odd numbe...
Balance a Binary Search Tree Given the root of a binary search tree, return a balanced binary search tree with the same node values. If there is more than one answer, return any of them. A binar...
Minimum Removals to Balance Array You are given an integer array nums and an integer k. An array is considered balanced if the value of its maximum element is at most k times the minimum element...
Transformed Array You are given an integer array nums that represents a circular array. Your task is to create a new array result of the same size, following these rules: For each index i (where...
Trionic Array II You are given an integer array nums of length n. A trionic subarray is a contiguous subarray nums[l…r] (with 0 <= l < r < n) for which there exist indices l < p <...
Divide an Array Into Subarrays With Minimum Cost II You are given a 0-indexed array of integers nums of length n, and two positive integers k and dist. The cost of an array is the value of its f...