Given a binary tree, return the inorder traversal of its nodes’ values. Example: Input:…
分类:LeetCode题目解答
[Leetcode] Flatten 2D Vector 整平二维向量
Flatten 2D Vector Implement an iterator to flatten a 2d vector. For example, Given 2d vector = [ [1,2], [3], […
[LeetCode] Heaters 加热器
Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radi…
[LeetCode] Course Schedule III 课程清单之三
There are n different online courses numbered from 1 to n. Each course has som…
[LeetCode] Image Smoother 图片平滑器
Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to m…
LeetCode | 4Sum
题目: Given an array S of n integers, are there elements a, b, c, and d&…
LeetCode | First Missing Positive
题目: Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0]&…
[Leetcode] Sqrt 开方
Sqrt Implement int sqrt(int x). Compute and return the square root of x. 二分搜索 复杂度 时间 O(1) 因为整数长度有限 空间 O(1) 思路 …
LeetCode 5. Longest Palindromic Substring
Total Accepted: 200641 Total Submissions: 798974 Difficulty: Medium Contributor: LeetCode Given a string s, fi…
[LeetCode] Ones and Zeroes 一和零
In the computer world, use restricted resource you have to generate maximum benefit is what we al…
LeetCode | Word Break
题目: Given a string s and a dictionary of words dict, determine if s can be segmented …
LeetCode 264 Ugly Number II
题目描述 Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only …