随笔分类 -  LeetCode

上一页 1 2 3 4 5 6 ··· 61 下一页
摘要: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:44 Grandyang 阅读(267) 评论(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 阅读(263) 评论(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 阅读(389) 评论(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 阅读(217) 评论(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:36 Grandyang 阅读(231) 评论(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:02 Grandyang 阅读(244) 评论(0) 推荐(0)
摘要:Given an array of integers arr and an integer d. In one step you can jump from index i to index: i + x where: i + x < arr.length and 0 < x <= d. i - x 阅读全文
posted @ 2023-04-14 13:16 Grandyang 阅读(385) 评论(0) 推荐(0)
摘要:Given the root of a binary tree, split the binary tree into two subtrees by removing one edge such that the product of the sums of the subtrees is max 阅读全文
posted @ 2023-04-05 13:42 Grandyang 阅读(227) 评论(0) 推荐(0)
摘要:You are given an integer array arr. You can choose a set of integers and remove all the occurrences of these integers in the array. Return the minimum 阅读全文
posted @ 2023-04-02 08:13 Grandyang 阅读(219) 评论(0) 推荐(0)
摘要:You are given an m x n binary matrix mat of 1's (representing soldiers) and 0's (representing civilians). The soldiers are positioned in front of the 阅读全文
posted @ 2023-03-27 10:40 Grandyang 阅读(292) 评论(0) 推荐(0)
摘要:You want to schedule a list of jobs in d days. Jobs are dependent (i.e To work on the ith job, you have to finish all the jobs j where 0 <= j < i). Yo 阅读全文
posted @ 2023-03-20 07:27 Grandyang 阅读(427) 评论(0) 推荐(0)
摘要:There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge b 阅读全文
posted @ 2023-03-15 14:04 Grandyang 阅读(373) 评论(0) 推荐(0)
摘要:Given the array restaurants where restaurants[i] = [idi, ratingi, veganFriendlyi, pricei, distancei]. You have to filter the restaurants using three f 阅读全文
posted @ 2023-02-27 09:15 Grandyang 阅读(161) 评论(0) 推荐(0)
摘要:You are given a string s consisting only of letters 'a' and 'b'. In a single step you can remove one palindromic subsequence from s. Return the minimu 阅读全文
posted @ 2023-02-25 12:25 Grandyang 阅读(225) 评论(0) 推荐(0)
摘要:Given an array of integers arr, replace each element with its rank. The rank represents how large the element is. The rank has the following rules: Ra 阅读全文
posted @ 2023-02-19 09:20 Grandyang 阅读(248) 评论(0) 推荐(0)
摘要:You are given an integer array nums. The value of this array is defined as the sum of |nums[i] - nums[i + 1]| for all 0 <= i < nums.length - 1. You ar 阅读全文
posted @ 2023-02-14 11:14 Grandyang 阅读(218) 评论(0) 推荐(0)
摘要:A matrix diagonal is a diagonal line of cells starting from some cell in either the topmost row or leftmost column and going in the bottom-right direc 阅读全文
posted @ 2023-01-30 13:56 Grandyang 阅读(313) 评论(0) 推荐(0)
摘要:Given a palindromic string of lowercase English letters palindrome, replace exactly one character with any lowercase English letter so that the result 阅读全文
posted @ 2023-01-17 02:49 Grandyang 阅读(328) 评论(0) 推荐(0)
摘要:There is a one-dimensional garden on the x-axis. The garden starts at the point 0 and ends at the point n. (i.e The length of the garden is n). There 阅读全文
posted @ 2023-01-12 14:16 Grandyang 阅读(335) 评论(0) 推荐(0)
摘要:Given a binary tree root and an integer target, delete all the leaf nodes with value target. Note that once you delete a leaf node with value target,  阅读全文
posted @ 2023-01-03 19:16 Grandyang 阅读(200) 评论(0) 推荐(0)

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