上一页 1 2 3 4 5 6 ··· 64 下一页
摘要: 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 阅读全文
posted @ 2025-06-10 10:54 CNoodle 阅读(22) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-06-06 03:46 CNoodle 阅读(37) 评论(0) 推荐(0)
摘要: 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, 阅读全文
posted @ 2025-06-04 07:45 CNoodle 阅读(107) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-05-19 06:28 CNoodle 阅读(30) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-04-02 02:03 CNoodle 阅读(58) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-03-28 01:28 CNoodle 阅读(19) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-03-27 02:15 CNoodle 阅读(61) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-03-27 01:59 CNoodle 阅读(36) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-03-20 01:09 CNoodle 阅读(62) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-03-19 05:03 CNoodle 阅读(14) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-03-19 04:22 CNoodle 阅读(22) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-03-14 12:35 CNoodle 阅读(81) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-03-11 00:19 CNoodle 阅读(24) 评论(0) 推荐(0)
摘要: 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]: 阅读全文
posted @ 2025-03-10 11:20 CNoodle 阅读(34) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-03-10 06:45 CNoodle 阅读(28) 评论(0) 推荐(0)
摘要: You are given a 0-indexed integer array nums. In one operation, you can: Choose two different indices i and j such that 0 <= i, j < nums.length. Choos 阅读全文
posted @ 2025-03-06 01:08 CNoodle 阅读(39) 评论(0) 推荐(0)
摘要: You are given a 0-indexed string array words. Two strings are similar if they consist of the same characters. For example, "abca" and "cba" are simila 阅读全文
posted @ 2025-02-22 02:39 CNoodle 阅读(40) 评论(0) 推荐(0)
摘要: You are given a 0-indexed 2D matrix grid of size m x n, where (r, c) represents: A land cell if grid[r][c] = 0, or A water cell containing grid[r][c] 阅读全文
posted @ 2025-02-17 10:56 CNoodle 阅读(44) 评论(0) 推荐(0)
摘要: You are given a 0-indexed array nums consisting of positive integers. You can choose two indices i and j, such that i != j, and the sum of digits of t 阅读全文
posted @ 2025-02-12 13:57 CNoodle 阅读(79) 评论(0) 推荐(0)
摘要: You are given a 0-indexed integer array nums. A pair of indices (i, j) is a bad pair if i < j and j - i != nums[j] - nums[i]. Return the total number 阅读全文
posted @ 2025-02-09 12:21 CNoodle 阅读(59) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 64 下一页