随笔分类 -  leetcode

上一页 1 2 3 4 5 6 ··· 17 下一页
https://leetcode.com/problemset/all/
摘要:Some people will make friend requests. The list of their ages is given and ages[i] is the age of the ith person. Person A will NOT friend request pers 阅读全文
posted @ 2019-01-07 21:05 bernieloveslife 阅读(171) 评论(0) 推荐(0)
摘要:Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between i and j equals 阅读全文
posted @ 2019-01-07 19:43 bernieloveslife 阅读(109) 评论(0) 推荐(0)
摘要:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Example 2: 很蠢得用了模拟法。。 阅读全文
posted @ 2019-01-07 18:13 bernieloveslife 阅读(110) 评论(0) 推荐(0)
摘要:Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list t 阅读全文
posted @ 2019-01-07 17:05 bernieloveslife 阅读(154) 评论(0) 推荐(0)
摘要:Find the sum of all left leaves in a given binary tree. 阅读全文
posted @ 2019-01-07 16:58 bernieloveslife 阅读(121) 评论(0) 推荐(0)
摘要:You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep 阅读全文
posted @ 2019-01-07 16:28 bernieloveslife 阅读(128) 评论(0) 推荐(0)
摘要:Given two arrays, write a function to compute their intersection. Example 1: Example 2: Note: Each element in the result should appear as many times a 阅读全文
posted @ 2018-12-03 21:20 bernieloveslife 阅读(139) 评论(0) 推荐(0)
摘要:Given a non empty integer array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected e 阅读全文
posted @ 2018-12-03 17:10 bernieloveslife 阅读(124) 评论(0) 推荐(0)
摘要:There are two types of soup: type A and type B. Initially we have N ml of each type of soup. There are four kinds of operations: 1. Serve 100 ml of so 阅读全文
posted @ 2018-12-03 16:54 bernieloveslife 阅读(234) 评论(0) 推荐(0)
摘要:Write a function to check whether an input string is a valid IPv4 address or IPv6 address or neither. IPv4 addresses are canonically represented in do 阅读全文
posted @ 2018-12-03 14:20 bernieloveslife 阅读(196) 评论(0) 推荐(0)
摘要:Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro 阅读全文
posted @ 2018-12-03 13:28 bernieloveslife 阅读(151) 评论(0) 推荐(0)
摘要:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a g 阅读全文
posted @ 2018-12-03 12:41 bernieloveslife 阅读(166) 评论(0) 推荐(0)
摘要:Design a data structure that supports the following two operations: search(word) can search a literal word or a regular expression string containing o 阅读全文
posted @ 2018-12-01 21:18 bernieloveslife 阅读(116) 评论(0) 推荐(0)
摘要:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. The update(i, val) function modifies nums by upd 阅读全文
posted @ 2018-12-01 20:55 bernieloveslife 阅读(197) 评论(0) 推荐(0)
摘要:Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1. Example 1: Input: 阅读全文
posted @ 2018-12-01 19:10 bernieloveslife 阅读(347) 评论(0) 推荐(0)
摘要:Given a square array of integers A, we want the minimum sum of a falling path through A. A falling path starts at any element in the first row, and ch 阅读全文
posted @ 2018-12-01 15:56 bernieloveslife 阅读(153) 评论(0) 推荐(0)
摘要:In a string S of lowercase letters, these letters form consecutive groups of the same character. For example, a string like S = "abbxxxxzyy" has the g 阅读全文
posted @ 2018-12-01 14:55 bernieloveslife 阅读(159) 评论(0) 推荐(0)
摘要:There are n different online courses numbered from 1 to n. Each course has some duration(course length) t and closed on dth day. A course should be ta 阅读全文
posted @ 2018-11-30 15:19 bernieloveslife 阅读(170) 评论(0) 推荐(0)
摘要:Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Explanation: 20 = 1 Example 2: Input: 16 Out 阅读全文
posted @ 2018-11-30 15:19 bernieloveslife 阅读(90) 评论(0) 推荐(0)
摘要:Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2018-11-30 15:19 bernieloveslife 阅读(94) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 ··· 17 下一页