随笔分类 -  LeetCode

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 61 下一页
摘要:Given an array of non negative integers, the array is squareful if for every pair of adjacent elements, their sum is a perfect square. Return the numb 阅读全文
posted @ 2021-01-11 11:16 Grandyang 阅读(788) 评论(0) 推荐(0) 编辑
摘要:You are given an `grid` where each cell can have one of three values: representing an empty cell, representing a fresh orange, or representing a rotte 阅读全文
posted @ 2021-01-10 04:07 Grandyang 阅读(2180) 评论(0) 推荐(1) 编辑
摘要:In a binary tree, the root node is at depth , and children of each depth node are at depth . Two nodes of a binary tree are cousins if they have the s 阅读全文
posted @ 2021-01-09 15:46 Grandyang 阅读(1214) 评论(0) 推荐(0) 编辑
摘要:Given an array of positive integers, call a (contiguous, not necessarily distinct) subarray of good if the number of different integers in that subarr 阅读全文
posted @ 2021-01-08 16:00 Grandyang 阅读(2367) 评论(1) 推荐(0) 编辑
摘要:On a broken calculator that has a number showing on its display, we can perform two operations: Double: Multiply the number on the display by 2, or; D 阅读全文
posted @ 2021-01-05 14:17 Grandyang 阅读(982) 评论(0) 推荐(0) 编辑
摘要:Given two strings and , return the length of their longest common subsequence. A subsequence of a string is a new string generated from the original s 阅读全文
posted @ 2021-01-04 16:36 Grandyang 阅读(3950) 评论(2) 推荐(0) 编辑
摘要:Given an array equations of strings that represent relationships between variables, each string has length and takes one of two different forms: or . 阅读全文
posted @ 2021-01-03 13:51 Grandyang 阅读(996) 评论(0) 推荐(0) 编辑
摘要:For a non negative integer , the array form of is an array of its digits in left to right order. For example, if , then the array form is . Given the 阅读全文
posted @ 2021-01-02 05:46 Grandyang 阅读(1003) 评论(0) 推荐(0) 编辑
摘要:Given the of a binary tree, each node has a value from to representing the letters to : a value of represents , a value of represents , and so on. Fin 阅读全文
posted @ 2021-01-01 14:31 Grandyang 阅读(705) 评论(0) 推荐(0) 编辑
摘要:Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order. Return the intersection of these two interval li 阅读全文
posted @ 2021-01-01 13:36 Grandyang 阅读(1620) 评论(0) 推荐(0) 编辑
摘要:We have an array of integers, and an array of queries. For the th query , we add val to . Then, the answer to the th query is the sum of the even valu 阅读全文
posted @ 2020-12-31 14:23 Grandyang 阅读(528) 评论(0) 推荐(0) 编辑
摘要:Given two integers and , return any string such that: has length and contains exactly `'a' b` letters, The substring does not occur in , and The subst 阅读全文
posted @ 2020-12-30 13:15 Grandyang 阅读(725) 评论(0) 推荐(0) 编辑
摘要:In a country popular for train travel, you have planned some train travelling one year in advance. The days of the year that you will travel is given 阅读全文
posted @ 2020-12-29 12:21 Grandyang 阅读(1894) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers , find the number of triples of indices (i, j, k) such that: `0 这道题给了一个数组,定义了一种三元组,使得这三个数字相‘与’得到为0,问有多少种不同的组合。根据题目中的例子可以发现, 阅读全文
posted @ 2020-12-28 11:07 Grandyang 阅读(498) 评论(0) 推荐(0) 编辑
摘要:Create a timebased key value store class , that supports two operations. 1\. Stores the and , along with the given . 2\. Returns a value such that was 阅读全文
posted @ 2020-12-27 04:01 Grandyang 阅读(2259) 评论(0) 推荐(0) 编辑
摘要:On a 2 dimensional , there are 4 types of squares: represents the starting square. There is exactly one starting square. represents the ending square. 阅读全文
posted @ 2020-12-26 09:42 Grandyang 阅读(1729) 评论(2) 推荐(0) 编辑
摘要:You are given the root of a binary tree with n nodes where each node in the tree has node.val coins and there are n coins total. In one move, we may c 阅读全文
posted @ 2020-12-25 13:09 Grandyang 阅读(1832) 评论(3) 推荐(0) 编辑
摘要:Given an integer array , return the length of a maximum size turbulent subarray of . A subarray is turbulent if the comparison sign flips between each 阅读全文
posted @ 2020-12-24 14:07 Grandyang 阅读(957) 评论(0) 推荐(2) 编辑
摘要:Given an array of positive lengths, return the largest perimeter of a triangle with non zero area, formed from 3 of these lengths. If it is impossible 阅读全文
posted @ 2020-12-22 13:32 Grandyang 阅读(987) 评论(0) 推荐(0) 编辑
摘要:Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: I 阅读全文
posted @ 2020-12-22 13:30 Grandyang 阅读(2323) 评论(0) 推荐(1) 编辑

上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 61 下一页
Fork me on GitHub