1196 Filling Bookcase Shelves
Filling Bookcase Shelves You are given an array books where books[i] = [thicknessi, heighti] indicates the thickness and height of the ith book. You are also given an integer shelfWidth. We want...
Filling Bookcase Shelves You are given an array books where books[i] = [thicknessi, heighti] indicates the thickness and height of the ith book. You are also given an integer shelfWidth. We want...
Minimum Deletions to Make String Balanced You are given a string s consisting only of characters ‘a’ and ‘b’. You can delete any number of characters in s to make s balanced. s is balanced i...
Count Number of Teams There are n soldiers standing in a line. Each soldier is assigned a unique rating value. You have to form a team of 3 soldiers amongst them under the following rules: Choo...
Sort an Array Given an array of integers nums, sort the array in ascending order and return it. You must solve the problem without using any built-in functions in O(nlog(n)) time complexity and ...
Sort the Jumbled Numbers You are given a 0-indexed integer array mapping which represents the mapping rule of a shuffled decimal system. mapping[i] = j means digit i should be mapped to digit j i...
Sort Array by Increasing Frequency Given an array of integers nums, sort the array in increasing order based on the frequency of the values. If multiple values have the same frequency, sort them ...
Palindrome Number Given an integer x, return true* if x is a **palindrome*, and *false otherwise*. Example 1: **Input:** x = 121 **Output:** true **Explanation:** 121 reads as 121 from left...
Lucky Numbers in a Matrix Given an m x n matrix of *distinct numbers, return *all **lucky numbers in the matrix in **any **order. A lucky number is an element of the matrix such that it is the m...
Number of Good Leaf Nodes Pairs You are given the root of a binary tree and an integer distance. A pair of two different leaf nodes of a binary tree is said to be good if the length of the shorte...
Delete Nodes And Return Forest Given the root of a binary tree, each node in the tree has a distinct value. After deleting all nodes with a value in to_delete, we are left with a forest (a disjo...