LeetCode
EdVulcan
啊~~
展开
-
LeetCode.395
Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than k times.原创 2017-07-16 14:54:15 · 216 阅读 · 0 评论 -
LeetCode.338 Counting Bits
338. Counting BitsGiven 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 and return them as an array.原创 2017-09-20 15:38:49 · 183 阅读 · 0 评论 -
LeetCode.477 Total Hamming Distance
477. Total Hamming DistanceThe Hamming distance between two integers is the number of positions at which the corresponding bits are different.Now your job is to find the total Hamming dist原创 2017-09-18 14:47:30 · 329 阅读 · 0 评论 -
LeetCode.102 Binary Tree Level Order Traversal
102. Binary Tree Level Order TraversalGiven a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree [3,9,原创 2017-09-26 11:37:29 · 146 阅读 · 0 评论 -
LeetCode.45 Jump Game II
45. Jump Game IIGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that po原创 2017-09-18 10:11:50 · 338 阅读 · 0 评论 -
LeetCode.62
/*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 any point in time. The robot is trying to reac原创 2017-09-07 15:44:37 · 115 阅读 · 0 评论 -
LeetCode.1 Two Sum
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 exactly one solution, and you may not use the same原创 2017-09-14 11:43:41 · 106 阅读 · 0 评论 -
LeetCode.154 Find Minimum in Rotated Sorted Array II
154. Find Minimum in Rotated Sorted Array IIFollow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?原创 2017-09-14 10:58:39 · 124 阅读 · 0 评论 -
LeetCode.153
153. Find Minimum in Rotated Sorted ArraySuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).原创 2017-09-13 16:00:25 · 147 阅读 · 0 评论 -
LeetCode.670
/*Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get.Example 1:Input: 2736Output: 7236E原创 2017-09-05 16:59:58 · 277 阅读 · 0 评论 -
LeetCode.33
Search in Rotated Sorted ArraySuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a原创 2017-09-13 15:37:20 · 130 阅读 · 0 评论 -
LeetCode.64
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right at原创 2017-09-13 10:05:14 · 155 阅读 · 0 评论 -
LeetCode.174
The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was initially p原创 2017-09-13 08:40:23 · 226 阅读 · 0 评论 -
LeetCode.289
/* According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970."Given a board wi原创 2017-08-15 21:17:05 · 169 阅读 · 0 评论 -
LeetCode.168
/*Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -原创 2017-08-16 23:24:19 · 152 阅读 · 0 评论 -
LeetCode.106 Construct Binary Tree from Inorder and Postorder Traversal
106. Construct Binary Tree from Inorder and Postorder TraversalGiven inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist i原创 2017-10-19 14:39:10 · 164 阅读 · 0 评论