摘要: 终于将LeetCode的大部分题刷完了,真是漫长的第一遍啊,估计很多题都忘的差不多了,这次开个题目汇总贴,并附上每道题目的解题连接,方便之后查阅吧~ 博主还制作了一款 网页版APP,方便大家进行查阅,网址如下: https://grandyang.com 对应的 Github 项目 的同步地址如下, 阅读全文
posted @ 2015-06-28 23:20 Grandyang 阅读(1232877) 评论(156) 推荐(115) 编辑
摘要: You are given a positive integer num consisting only of digits 6 and 9. Return the maximum number you can get by changing at most one digit (6* become 阅读全文
posted @ 2022-12-04 07:44 Grandyang 阅读(6) 评论(0) 推荐(0) 编辑
摘要: You have a keyboard layout as shown above in the X-Y plane, where each English uppercase letter is located at some coordinate. For example, the letter 阅读全文
posted @ 2022-11-21 04:01 Grandyang 阅读(51) 评论(0) 推荐(0) 编辑
摘要: There are n computers numbered from 0 to n - 1 connected by ethernet cables connections forming a network where connections[i] = [ai, bi] represents a 阅读全文
posted @ 2022-11-07 15:32 Grandyang 阅读(33) 评论(0) 推荐(0) 编辑
摘要: Given 3 positives numbers a, b and c. Return the minimum flips required in some bits of a and b to make ( a OR b == c ). (bitwise OR operation). Flip 阅读全文
posted @ 2022-10-17 04:01 Grandyang 阅读(34) 评论(0) 推荐(0) 编辑
摘要: No-Zero integer is a positive integer that does not contain any 0 in its decimal representation. Given an integer n, return a list of two integers [A, 阅读全文
posted @ 2022-10-06 12:41 Grandyang 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(52) 评论(0) 推荐(0) 编辑
摘要: Using CloudFormation template to create CodePipeline should be the best practice to maintain a pipeline. There are a lot of posts or videos online tha 阅读全文
posted @ 2022-09-05 07:16 Grandyang 阅读(67) 评论(0) 推荐(0) 编辑
摘要: Normally, vite build by default is building the production environment only, but we still can make it build development environment by adding --mode d 阅读全文
posted @ 2022-09-05 06:50 Grandyang 阅读(34) 评论(0) 推荐(0) 编辑
摘要: Unlike AWS_REGION or AWS_LAMBDA_FUNCTION_NAME, we cannot get current account id from the environment variables. In order to to get the account id, we 阅读全文
posted @ 2022-09-03 13:56 Grandyang 阅读(21) 评论(0) 推荐(0) 编辑
摘要: When you deploy with SAM CLI using sam deploy, you might get the following error: Error: Unable to upload artifact <YourComponent> referenced by Conte 阅读全文
posted @ 2022-09-02 13:40 Grandyang 阅读(120) 评论(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 阅读(50) 评论(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 阅读(131) 评论(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 阅读(36) 评论(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 阅读(117) 评论(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 阅读(95) 评论(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 阅读(162) 评论(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 阅读(56) 评论(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 阅读(75) 评论(0) 推荐(0) 编辑
摘要: When use AWS API gateway with lambda authorizer, you may get 403 Forbidden error code with the error message User is not authorized to access this res 阅读全文
posted @ 2022-06-20 08:31 Grandyang 阅读(103) 评论(0) 推荐(0) 编辑
摘要: If you configure CORS (Cross-Origin Resource Sharing) for an API, API Gateway automatically sends a response to preflight OPTIONS requests, even if th 阅读全文
posted @ 2022-06-19 04:54 Grandyang 阅读(24) 评论(0) 推荐(0) 编辑
摘要: AWS Lambda allows you to write customized authorizer for the API gateway, here is the video for Secure your API Gateway with Lambda Authorizer | Step 阅读全文
posted @ 2022-06-17 14:33 Grandyang 阅读(322) 评论(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 阅读(93) 评论(0) 推荐(0) 编辑
摘要: AWS lambda function has some built-in packages, but when you use some other packages (like requests), you might get the following error: Unable to imp 阅读全文
posted @ 2022-06-06 12:59 Grandyang 阅读(202) 评论(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 阅读(78) 评论(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 阅读(71) 评论(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 阅读(81) 评论(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 阅读(67) 评论(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 阅读(41) 评论(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 阅读(49) 评论(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 阅读(103) 评论(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 阅读(123) 评论(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 阅读(98) 评论(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 阅读(96) 评论(0) 推荐(0) 编辑
摘要: You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that 阅读全文
posted @ 2022-04-22 12:19 Grandyang 阅读(143) 评论(0) 推荐(0) 编辑
摘要: You are given an m x n integer matrix grid where each cell is either 0 (empty) or 1 (obstacle). You can move up, down, left, or right from and to an e 阅读全文
posted @ 2022-04-19 12:40 Grandyang 阅读(340) 评论(0) 推荐(0) 编辑
摘要: Given a m x n matrix mat and an integer threshold, return the maximum side-length of a square with a sum less than or equal to threshold or return 0 i 阅读全文
posted @ 2022-04-15 09:51 Grandyang 阅读(958) 评论(0) 推荐(0) 编辑
摘要: An integer has sequential digits if and only if each digit in the number is one more than the previous digit. Return a sorted list of all the integers 阅读全文
posted @ 2022-04-04 23:15 Grandyang 阅读(236) 评论(0) 推荐(0) 编辑
摘要: Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the bi 阅读全文
posted @ 2022-03-25 22:55 Grandyang 阅读(317) 评论(0) 推荐(0) 编辑
摘要: Given an n x n integer matrix grid, return the minimum sum of a falling path with non-zero shifts. A falling path with non-zero shifts is a choice of 阅读全文
posted @ 2022-03-25 11:01 Grandyang 阅读(257) 评论(0) 推荐(0) 编辑
摘要: Given an array intervals where intervals[i] = [li, ri] represent the interval [li, ri), remove all intervals that are covered by another interval in t 阅读全文
posted @ 2022-03-22 13:45 Grandyang 阅读(230) 评论(0) 推荐(0) 编辑
Fork me on GitHub