随笔分类 -  Level 2

上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要:Given an array of integers A with even length, return true if and only if it is possible to reorder it such that A[2 * i + 1] = 2 * A[2 * i] for every 阅读全文
posted @ 2019-07-08 01:47 北叶青藤 阅读(219) 评论(0) 推荐(0)
摘要:Solve a given equation and return the value of x in the form of string "x=#value". The equation contains only '+', '-' operation, the variable x and i 阅读全文
posted @ 2019-07-07 10:24 北叶青藤 阅读(356) 评论(0) 推荐(0)
摘要:We are given a list schedule of employees, which represents the working time for each employee. Each employee has a list of non-overlapping Intervals, 阅读全文
posted @ 2019-07-06 22:58 北叶青藤 阅读(253) 评论(0) 推荐(0)
摘要:Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c 阅读全文
posted @ 2019-07-05 09:13 北叶青藤 阅读(166) 评论(0) 推荐(0)
摘要:Given a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only need to return the root node of any one of them. Two 阅读全文
posted @ 2019-07-04 03:06 北叶青藤 阅读(188) 评论(0) 推荐(0)
摘要:On a single threaded CPU, we execute some functions. Each function has a unique id between 0 and N-1. We store logs in timestamp order that describe w 阅读全文
posted @ 2019-07-03 03:38 北叶青藤 阅读(226) 评论(0) 推荐(0)
摘要:We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign r 阅读全文
posted @ 2019-07-03 03:15 北叶青藤 阅读(223) 评论(0) 推荐(0)
摘要:Given a BST, remove an extra edge to make it BST. 7 / \ 5 9 / \ / 3 8 阅读全文
posted @ 2019-06-22 11:25 北叶青藤 阅读(324) 评论(0) 推荐(0)
摘要:A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its inde 阅读全文
posted @ 2019-06-09 11:45 北叶青藤 阅读(134) 评论(0) 推荐(0)
摘要:Given a time represented in the format "HH:MM", form the next closest time by reusing the current digits. There is no limit on how many times a digit 阅读全文
posted @ 2019-05-28 07:27 北叶青藤 阅读(276) 评论(0) 推荐(0)
摘要:Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe 阅读全文
posted @ 2019-05-20 01:39 北叶青藤 阅读(241) 评论(0) 推荐(0)
摘要:Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element. We define an array is non-decr 阅读全文
posted @ 2019-04-29 13:19 北叶青藤 阅读(190) 评论(0) 推荐(0)
摘要:Given an encoded string, return it's decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is be 阅读全文
posted @ 2019-04-22 01:48 北叶青藤 阅读(394) 评论(0) 推荐(0)
摘要:You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through *, /, +, -, (, ) to get the value of 24. 阅读全文
posted @ 2019-04-22 01:04 北叶青藤 阅读(175) 评论(0) 推荐(0)
摘要:Given a non-empty list of words, return the k most frequent elements. Your answer should be sorted by frequency from highest to lowest. If two words h 阅读全文
posted @ 2019-04-21 05:52 北叶青藤 阅读(214) 评论(0) 推荐(0)
摘要:Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2019-03-04 05:23 北叶青藤 阅读(144) 评论(0) 推荐(0)
摘要:TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http 阅读全文
posted @ 2019-02-23 11:41 北叶青藤 阅读(247) 评论(0) 推荐(0)
摘要:Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If the 阅读全文
posted @ 2019-02-19 06:51 北叶青藤 阅读(138) 评论(0) 推荐(0)
摘要:Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo 阅读全文
posted @ 2019-02-03 07:59 北叶青藤 阅读(185) 评论(0) 推荐(0)
摘要:Given an integer n, return 1 - n in lexicographical order. For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. Please optimize your algori 阅读全文
posted @ 2017-01-09 11:40 北叶青藤 阅读(192) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页