随笔分类 -  leetcode English

摘要:Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2020-09-25 09:00 zmachine 阅读(172) 评论(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 @ 2020-09-15 15:34 zmachine 阅读(116) 评论(0) 推荐(0)
摘要:here 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 i 阅读全文
posted @ 2020-09-10 13:54 zmachine 阅读(176) 评论(0) 推荐(0)
摘要:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb 阅读全文
posted @ 2020-09-10 10:15 zmachine 阅读(99) 评论(0) 推荐(0)
摘要:The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all 阅读全文
posted @ 2020-09-04 19:48 zmachine 阅读(151) 评论(0) 推荐(0)
摘要:Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t 阅读全文
posted @ 2020-09-01 08:15 zmachine 阅读(156) 评论(0) 推荐(0)
摘要:You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2020-08-27 14:33 zmachine 阅读(96) 评论(0) 推荐(0)
摘要:Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tick 阅读全文
posted @ 2020-08-27 07:26 zmachine 阅读(125) 评论(0) 推荐(0)
摘要:Given an array of linked-lists lists, each linked list is sorted in ascending order. Merge all the linked-lists into one sort linked-list and return i 阅读全文
posted @ 2020-08-26 10:50 zmachine 阅读(105) 评论(0) 推荐(0)
摘要:Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the s 阅读全文
posted @ 2020-08-25 19:03 zmachine 阅读(184) 评论(0) 推荐(0)
摘要:Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文
posted @ 2020-08-25 17:29 zmachine 阅读(79) 评论(0) 推荐(0)
摘要:Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing su 阅读全文
posted @ 2020-08-25 16:18 zmachine 阅读(159) 评论(0) 推荐(0)
摘要:Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. Example 1: Input: [5,7]Output: 4 阅读全文
posted @ 2020-08-23 09:21 zmachine 阅读(98) 评论(0) 推荐(0)
摘要:Given two sorted arrays nums1 and nums2 of size m and n respectively. Return the median of the two sorted arrays. Follow up: The overall run time comp 阅读全文
posted @ 2020-08-22 11:51 zmachine 阅读(141) 评论(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 @ 2020-08-22 10:43 zmachine 阅读(154) 评论(0) 推荐(0)