心之所向

JUST IDEA

LeetCod : 581. Shortest Unsorted Continuous Subarray 最短非序连续子数组

试题 Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will...

2019-05-18 00:34:07

阅读数 29

评论数 0

LeetCode : 136. Single Number 单一数字

试题 Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear r...

2019-05-17 15:13:48

阅读数 43

评论数 0

LeetCode: 102. Binary Tree Level Order Traversal 按层打印二叉树

试题 Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level). For example: Given binary tr...

2019-05-17 14:20:28

阅读数 35

评论数 0

LeetCode : 617. Merge Two Binary Trees 合并二叉树

试题 Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others a...

2019-05-17 11:04:18

阅读数 56

评论数 0

LeetCode : 78. Subsets 子集 clone

试题 Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Ex...

2019-05-17 10:37:10

阅读数 39

评论数 0

LeeCode : 62. Unique Paths 机器人行走路径数量统计

试题 A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at a...

2019-05-16 10:27:50

阅读数 28

评论数 0

LeetCode : 139. Word Break 拆分字符串

试题 Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated ...

2019-05-15 11:08:11

阅读数 18

评论数 0

LeetCod :79. Word Search 单词搜索

试题 Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where “a...

2019-05-14 11:33:51

阅读数 9

评论数 0

LeeCod : 538. Convert BST to Greater Tree 二叉搜索树转增大树

试题 Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of ...

2019-05-14 10:50:18

阅读数 1

评论数 0

LeetCode : 322. Coin Change 凑齐硬币

试题 You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you...

2019-05-14 10:25:11

阅读数 1

评论数 0

LeetCode : 338. Counting Bits 统计二进制

试题 Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation a...

2019-05-14 09:54:01

阅读数 7

评论数 0

LeetCode : 101. Symmetric Tree 对称二叉树

试题 Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is sy...

2019-05-13 14:51:08

阅读数 2

评论数 0

LeetCode : 56. Merge Intervals 合并区间

试题 Given a collection of intervals, merge all overlapping intervals. Example 1: Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Ex...

2019-05-13 14:14:51

阅读数 11

评论数 0

LeetCode : 394. Decode String 解码字符串 重复复制子串

试题 Given an encoded string, return it’s decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets ...

2019-05-12 01:47:21

阅读数 9

评论数 0

LeetCode : 438. Find All Anagrams in a String 查找所有异位字符串

试题 Given a string s and a non-empty string p, find all the start indices of p’s anagrams in s. Strings consists of lowercase English letters only and...

2019-05-11 11:23:00

阅读数 6

评论数 0

LeetCode : 448. Find All Numbers Disappeared in an Array 数组中的缺失数

试题 Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1,...

2019-05-11 10:54:45

阅读数 6

评论数 0

LeetCode : 287. Find the Duplicate Number 查找重复数字

试题 Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exi...

2019-05-11 01:02:48

阅读数 2

评论数 0

LeetCode : 46. Permutations 全排列

试题 Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [...

2019-05-11 00:00:30

阅读数 4

评论数 0

LeetCode : 114. Flatten Binary Tree to Linked List 将二叉树转成链表

试题 Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: 1 / \ 2 5 / \ \ 3 4 6 The fla...

2019-05-10 14:15:51

阅读数 2

评论数 0

LeetCode : 49. Group Anagrams 分组字符串

试题 Given an array of strings, group anagrams together. Example: Input: [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”], Output: [ [“ate”,“eat”,“tea”], [“n...

2019-05-10 10:59:36

阅读数 10

评论数 0

提示
确定要删除当前文章?
取消 删除
关闭
关闭