随笔分类 -  LeetCode

上一页 1 2 3 4 5 6 7 ··· 61 下一页
摘要:Return the number of distinct non-empty substrings of text that can be written as the concatenation of some string with itself (i.e. it can be written 阅读全文
posted @ 2022-10-02 05:00 Grandyang 阅读(249) 评论(0) 推荐(0) 编辑
摘要:Given the root of a binary tree, return the sum of values of nodes with an even-valued grandparent. If there are no nodes with an even-valued grandpar 阅读全文
posted @ 2022-08-31 12:50 Grandyang 阅读(196) 评论(0) 推荐(0) 编辑
摘要:Given a m x n matrix mat and an integer k, return a matrix answer where each answer[i][j] is the sum of all elements mat[r][c] for: i - k <= r <= i + 阅读全文
posted @ 2022-08-17 13:45 Grandyang 阅读(385) 评论(0) 推荐(0) 编辑
摘要:We are given a list nums of integers representing a list compressed with run-length encoding. Consider each adjacent pair of elements [freq, val] = [n 阅读全文
posted @ 2022-08-11 14:03 Grandyang 阅读(166) 评论(0) 推荐(0) 编辑
摘要:Given a string s. In one step you can insert any character at any index of the string. Return the minimum number of steps to make s palindrome. A Pali 阅读全文
posted @ 2022-08-06 12:25 Grandyang 阅读(355) 评论(0) 推荐(0) 编辑
摘要:There are n people, each person has a unique id between 0 and n-1. Given the arrays watchedVideos and friends, where watchedVideos[i] and friends[i] c 阅读全文
posted @ 2022-07-23 10:34 Grandyang 阅读(330) 评论(0) 推荐(0) 编辑
摘要:Given an equation, represented by words on the left side and the result on the right side. You need to check if the equation is solvable under the fol 阅读全文
posted @ 2022-07-15 12:29 Grandyang 阅读(330) 评论(0) 推荐(0) 编辑
摘要:You are given an array arr of positive integers. You are also given the array queries where queries[i] = [lefti, righti]. For each query i compute the 阅读全文
posted @ 2022-07-08 21:24 Grandyang 阅读(167) 评论(0) 推荐(0) 编辑
摘要:You are given a string s formed by digits and '#'. We want to map s to English lowercase characters as follows: Characters ('a' to 'i') are represente 阅读全文
posted @ 2022-06-27 06:10 Grandyang 阅读(180) 评论(0) 推荐(0) 编辑
摘要:Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + ar 阅读全文
posted @ 2022-06-12 14:25 Grandyang 阅读(397) 评论(0) 推荐(0) 编辑
摘要:Given an integer n, return any array containing n unique integers such that they add up to 0. Example 1: Input: n = 5 Output: [-7,-1,1,3,4] Explanatio 阅读全文
posted @ 2022-06-04 12:28 Grandyang 阅读(195) 评论(0) 推荐(0) 编辑
摘要:Given two binary search trees root1 and root2, return a list containing all the integers from both trees sorted in ascending order. Example 1: Input: 阅读全文
posted @ 2022-05-29 14:16 Grandyang 阅读(224) 评论(0) 推荐(0) 编辑
摘要:Given the root of a binary tree, return the sum of values of its deepest leaves. Example 1: Input: root = [1,2,3,4,5,null,6,7,null,null,null,null,8] O 阅读全文
posted @ 2022-05-26 10:15 Grandyang 阅读(213) 评论(0) 推荐(0) 编辑
摘要:You are given a square board of characters. You can move on the board starting at the bottom right square marked with the character 'S'. You need to r 阅读全文
posted @ 2022-05-23 12:47 Grandyang 阅读(213) 评论(0) 推荐(0) 编辑
摘要:Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with - 阅读全文
posted @ 2022-05-18 12:50 Grandyang 阅读(140) 评论(0) 推荐(0) 编辑
摘要:You have n boxes labeled from 0 to n - 1. You are given four arrays: status, candies, keys, and containedBoxes where: status[i] is 1 if the ith box is 阅读全文
posted @ 2022-05-16 03:17 Grandyang 阅读(128) 评论(0) 推荐(0) 编辑
摘要:Given an integer array arr and a target value target, return the integer value such that when we change all the integers larger than value in the give 阅读全文
posted @ 2022-05-11 13:51 Grandyang 阅读(303) 评论(0) 推荐(0) 编辑
摘要:Given a string s, return the maximum number of ocurrences of any substring under the following rules: The number of unique characters in the substring 阅读全文
posted @ 2022-05-05 13:16 Grandyang 阅读(306) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers nums and a positive integer k, check whether it is possible to divide this array into sets of k consecutive numbers. Return 阅读全文
posted @ 2022-04-27 11:41 Grandyang 阅读(214) 评论(0) 推荐(0) 编辑
摘要:Given an array nums of integers, return how many of them contain an even number of digits. Example 1: Input: nums = [12,345,2,6,7896] Output: 2 Explan 阅读全文
posted @ 2022-04-24 01:22 Grandyang 阅读(214) 评论(0) 推荐(0) 编辑

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