随笔分类 -  Leetcode

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 23 下一页
摘要:965. Univalued Binary Tree A binary tree is univalued if every node in the tree has the same value. Return true if and only if the given tree is univa 阅读全文
posted @ 2018-12-30 13:40 Veritas_des_Liberty 阅读(302) 评论(0) 推荐(0) 编辑
摘要:We are given a 2-dimensional grid. "." is an empty cell, "#" is a wall, "@" is the starting point, ("a", "b", ...) are keys, and ("A", "B", ...) are l 阅读全文
posted @ 2018-12-29 21:41 Veritas_des_Liberty 阅读(407) 评论(0) 推荐(0) 编辑
摘要:There are N workers. The i-th worker has a quality[i] and a minimum wage expectation wage[i]. Now we want to hire exactly K workers to form a paid gro 阅读全文
posted @ 2018-12-24 22:26 Veritas_des_Liberty 阅读(298) 评论(0) 推荐(0) 编辑
摘要:Your car starts at position 0 and speed +1 on an infinite number line. (Your car can go into negative positions.) Your car drives automatically accord 阅读全文
posted @ 2018-12-23 18:57 Veritas_des_Liberty 阅读(317) 评论(0) 推荐(0) 编辑
摘要:961. N-Repeated Element in Size 2N Array In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeated N times 阅读全文
posted @ 2018-12-23 12:57 Veritas_des_Liberty 阅读(243) 评论(0) 推荐(0) 编辑
摘要:There are n cities connected by m flights. Each fight starts from city u and arrives at v with a price w. Now given all the cities and flights, togeth 阅读全文
posted @ 2018-12-22 13:05 Veritas_des_Liberty 阅读(297) 评论(0) 推荐(0) 编辑
摘要:There are N network nodes, labelled 1 to N. Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v  阅读全文
posted @ 2018-12-22 12:10 Veritas_des_Liberty 阅读(305) 评论(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 @ 2018-12-21 18:37 Veritas_des_Liberty 阅读(320) 评论(0) 推荐(0) 编辑
摘要:You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subseq 阅读全文
posted @ 2018-12-21 17:59 Veritas_des_Liberty 阅读(217) 评论(0) 推荐(0) 编辑
摘要:Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects 阅读全文
posted @ 2018-12-20 22:06 Veritas_des_Liberty 阅读(355) 评论(0) 推荐(0) 编辑
摘要:You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element from th 阅读全文
posted @ 2018-12-19 20:42 Veritas_des_Liberty 阅读(239) 评论(0) 推荐(0) 编辑
摘要:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Example 阅读全文
posted @ 2018-12-19 17:25 Veritas_des_Liberty 阅读(198) 评论(0) 推荐(0) 编辑
摘要:Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k num 阅读全文
posted @ 2018-12-18 11:03 Veritas_des_Liberty 阅读(210) 评论(0) 推荐(0) 编辑
摘要:Write a program to find the nth super ugly number. Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes  阅读全文
posted @ 2018-12-18 09:17 Veritas_des_Liberty 阅读(254) 评论(0) 推荐(0) 编辑
摘要:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2018-12-17 22:39 Veritas_des_Liberty 阅读(452) 评论(0) 推荐(0) 编辑
摘要:Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Example: Input: n = 10 Outpu 阅读全文
posted @ 2018-12-17 21:06 Veritas_des_Liberty 阅读(174) 评论(0) 推荐(0) 编辑
摘要:Given a list of words (without duplicates), please write a program that returns all concatenated words in the given list of words. A concatenated word 阅读全文
posted @ 2018-12-16 17:58 Veritas_des_Liberty 阅读(331) 评论(0) 推荐(0) 编辑
摘要:958. Check Completeness of a Binary Tree Given a binary tree, determine if it is a complete binary tree. Definition of a complete binary tree from Wik 阅读全文
posted @ 2018-12-16 12:53 Veritas_des_Liberty 阅读(214) 评论(0) 推荐(0) 编辑
摘要:Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top 阅读全文
posted @ 2018-12-15 22:21 Veritas_des_Liberty 阅读(240) 评论(0) 推荐(0) 编辑
摘要:There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you have to 阅读全文
posted @ 2018-12-14 21:28 Veritas_des_Liberty 阅读(185) 评论(0) 推荐(0) 编辑

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 23 下一页