摘要:
Alice is attempting to type a specific string on her computer. However, she tends to be clumsy and may press a key for too long, resulting in a charac 阅读全文
摘要:
You are given a 0-indexed integer array nums and two integers key and k. A k-distant index is an index i of nums for which there exists at least one i 阅读全文
摘要:
A string s can be partitioned into groups of size k using the following procedure: The first group consists of the first k characters of the string, t 阅读全文
摘要:
You are given an integer array nums and an integer k. You may partition nums into one or more subsequences such that each element in nums appears in e 阅读全文
摘要:
You are given an integer num. You know that Bob will sneakily remap one of the 10 possible digits (0 to 9) to another digit. Return the difference bet 阅读全文
摘要:
Given an integer n, return all the numbers in the range [1, n] sorted in lexicographical order. You must write an algorithm that runs in O(n) time and 阅读全文
摘要:
You are given a string s and a robot that currently holds an empty string t. Apply one of the following operations until s and t are both empty: Remov 阅读全文
摘要:
You are given a string word, and an integer numFriends. Alice is organizing a game for her numFriends friends. There are multiple rounds in the game, 阅读全文
摘要:
You are given a 0-indexed integer array nums of size 3 which can form the sides of a triangle. A triangle is called equilateral if it has all sides of 阅读全文
摘要:
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 all such triplet 阅读全文
摘要:
An element x of an integer array arr of length m is dominant if more than half the elements of arr have a value of x. You are given a 0-indexed intege 阅读全文
摘要:
You are given a 2D integer grid of size m x n and an integer x. In one operation, you can add x to or subtract x from any element in the grid. A uni-v 阅读全文
摘要:
You are given a 0-indexed binary string s of length n on which you can apply two types of operations: Choose an index i and invert all characters from 阅读全文
摘要:
You are given a binary array nums. You can do the following operation on the array any number of times (possibly zero): Choose any 3 consecutive eleme 阅读全文
摘要:
You are given an integer array nums. You need to create a 2D array from nums satisfying the following conditions: The 2D array should contain only the 阅读全文
摘要:
You are given an array nums consisting of positive integers. We call a subarray of nums nice if the bitwise AND of every pair of elements that are in 阅读全文
摘要:
You are given a 0-indexed integer array candies. Each element in the array denotes a pile of candies of size candies[i]. You can divide each pile into 阅读全文
摘要:
You are given a binary array nums. We call a subarray alternating if no two adjacent elements in the subarray have the same value. Return the number o 阅读全文
摘要:
There is a circle of red and blue tiles. You are given an array of integers colors and an integer k. The color of tile i is represented by colors[i]: 阅读全文
摘要:
The k-beauty of an integer num is defined as the number of substrings of num when it is read as a string that meet the following conditions: It has a 阅读全文