2929. Distribute Candies Among Children II
You are given two positive integers n and limit. Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies. Example […]
You are given two positive integers n and limit. Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies. Example […]
Given two matrices mat1[][] and mat2[][] of size n x n, where the elements in each matrix are arranged in strictly ascending order. Specifically, each row is sorted
Given a matrix mat[][] of size n*n, where each row and column is sorted in non-decreasing order. Find the kth smallest element in the matrix. Examples:
You are given an n x n integer matrix board where the cells are labeled from 1 to n2 in a Boustrophedon style starting from the bottom left of the
You are given a binary tree, and the task is to determine whether it satisfies the properties of a max-heap.
You are given an integer array nums and two integers minK and maxK. A fixed-bound subarray of nums is a subarray that satisfies the following conditions: The minimum value in the
Given an array arr[]. Find the majority element in the array. If no majority element exists, return -1. Note: A majority element in an array
You are given a 0-indexed integer array nums, an integer modulo, and an integer k. Your task is to find the count of subarrays that
Given an array of integers arr[] where, every element appears thrice except for one which occurs once.Find that element which occurs once. Examples: Input: arr[] = [1, 10, 1, 1]
You are given an array nums consisting of positive integers. We call a subarray of an array complete if the following condition is satisfied: The number
Given an array arr[] containing 2*n + 2 positive numbers, out of which 2*n numbers exist in pairs whereas only two number occur exactly once and
You are given an integer n. Each number from 1 to n is grouped according to the sum of its digits. Return the number of groups