随笔分类 -  LeetCode

1 2 3 4 5 ··· 61 下一页
摘要:Given an array of digits digits, return the largest multiple of three that can be formed by concatenating some of the given digits in any order. If th 阅读全文
posted @ 2024-01-11 13:44 Grandyang 阅读(90) 评论(0) 推荐(0) 编辑
摘要:Given an integer num, find the closest two integers in absolute difference whose product equals num + 1 or num + 2. Return the two integers in any ord 阅读全文
posted @ 2023-12-21 09:52 Grandyang 阅读(42) 评论(0) 推荐(0) 编辑
摘要:You have n binary tree nodes numbered from 0 to n - 1 where node i has two children leftChild[i] and rightChild[i], return true if and only if all the 阅读全文
posted @ 2023-11-20 09:39 Grandyang 阅读(97) 评论(0) 推荐(0) 编辑
摘要:Write a program to count the number of days between two dates. The two dates are given as strings, their format is YYYY-MM-DD as shown in the examples 阅读全文
posted @ 2023-11-12 12:19 Grandyang 阅读(44) 评论(0) 推荐(0) 编辑
摘要:Given n orders, each order consists of a pickup and a delivery service. Count all valid pickup/delivery possible sequences such that delivery(i) is al 阅读全文
posted @ 2023-11-06 08:02 Grandyang 阅读(37) 评论(0) 推荐(0) 编辑
摘要:Given a string s consisting only of characters a, b and c. Return the number of substrings containing at least one occurrence of all these characters  阅读全文
posted @ 2023-10-30 05:48 Grandyang 阅读(53) 评论(0) 推荐(0) 编辑
摘要:There is a supermarket that is frequented by many customers. The products sold at the supermarket are represented as two parallel integer arrays produ 阅读全文
posted @ 2023-10-29 02:29 Grandyang 阅读(46) 评论(0) 推荐(0) 编辑
摘要:You are given an integer array arr. Sort the integers in the array in ascending order by the number of 1's in their binary representation and in case 阅读全文
posted @ 2023-10-22 01:07 Grandyang 阅读(73) 评论(0) 推荐(0) 编辑
摘要:You are given an array target of n integers. From a starting array arr consisting of n 1's, you may perform the following procedure : let x be the sum 阅读全文
posted @ 2023-10-15 07:48 Grandyang 阅读(25) 评论(0) 推荐(0) 编辑
摘要:You are given an array of events where events[i] = [startDayi, endDayi]. Every event i starts at startDayi and ends at endDayi. You can attend an even 阅读全文
posted @ 2023-09-25 10:22 Grandyang 阅读(95) 评论(0) 推荐(0) 编辑
摘要:Design an algorithm that accepts a stream of integers and retrieves the product of the last k integers of the stream. Implement the ProductOfNumbers c 阅读全文
posted @ 2023-09-14 12:55 Grandyang 阅读(446) 评论(0) 推荐(0) 编辑
摘要:Given a `m x n` matrix `grid` which is sorted in non-increasing order both row-wise and column-wise, return *the number of **negative** numbers in* `g 阅读全文
posted @ 2023-08-06 00:40 Grandyang 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Given a `m * n` matrix `seats` that represent seats distributions in a classroom. If a seat is broken, it is denoted by `'#'` character otherwise it i 阅读全文
posted @ 2023-07-21 15:03 Grandyang 阅读(160) 评论(0) 推荐(0) 编辑
摘要:A social media company is trying to monitor activity on their site by analyzing the number of tweets that occur in select periods of time. These perio 阅读全文
posted @ 2023-06-14 14:10 Grandyang 阅读(88) 评论(0) 推荐(0) 编辑
摘要:You are given two strings of the same length `s` and `t`. In one step you can choose **any character** of `t` and replace it with **another character* 阅读全文
posted @ 2023-06-05 23:45 Grandyang 阅读(113) 评论(0) 推荐(0) 编辑
摘要:Given an array `arr` of integers, check if there exist two indices `i` and `j` such that : - `i != j` - `0 这道题给了一个整型数组,让检测是否有一个数字和其倍数同时存在的情况。一看到这道题博主就 阅读全文
posted @ 2023-06-05 02:00 Grandyang 阅读(120) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers `arr`, you are initially positioned at the first index of the array. In one step you can jump from index `i` to index: - `i 阅读全文
posted @ 2023-06-04 00:44 Grandyang 阅读(167) 评论(0) 推荐(0) 编辑
摘要:Given two numbers, `hour` and `minutes`, return *the smaller angle (in degrees) formed between the *`hour`* and the *`minute`* hand*. Answers within ` 阅读全文
posted @ 2023-05-24 14:50 Grandyang 阅读(72) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers arr and two integers k and threshold, return *the number of sub-arrays of size k and average greater than or equal to *thre 阅读全文
posted @ 2023-05-16 12:37 Grandyang 阅读(103) 评论(0) 推荐(0) 编辑
摘要:Given an integer num, return the number of steps to reduce it to zero. In one step, if the current number is even, you have to divide it by 2, otherwi 阅读全文
posted @ 2023-04-25 14:03 Grandyang 阅读(108) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 61 下一页
Fork me on GitHub