1399. Count Largest Group
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 […]
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 […]
You are given two integers n and maxValue, which are used to describe an ideal array. A 0-indexed integer array arr of length n is considered ideal if the following conditions hold: Every arr[i] is
You are given a 0-indexed array of n integers differences, which describes the differences between each pair of consecutive integers of a hidden sequence of length (n + 1). More formally, call
There is a forest with an unknown number of rabbits. We asked n rabbits “How many rabbits have the same color
Given a 0-indexed integer array nums of length n and an integer k, return the number of pairs (i, j) where 0 <= i < j < n, such that nums[i] == nums[j] and (i *
You are given an integer array nums. You need to ensure that the elements in the array are distinct. To achieve this,
Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements
Given a set of distinct positive integers nums, return the largest subset answer such that every pair (answer[i], answer[j]) of elements in this subset satisfies: answer[i] %
The XOR total of an array is defined as the bitwise XOR of all its elements, or 0 if the array is empty. For example, the XOR total of the
You are given a 0-indexed integer array nums. Return the maximum value over all triplets of indices (i, j, k) such that i < j < k. If
You are given a 0-indexed integer array nums. Return the maximum value over all triplets of indices (i, j, k) such that i < j < k.
You are given a 0-indexed 2D integer array questions where questions[i] = [pointsi, brainpoweri]. The array describes the questions of an exam, where you have