自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(28)
  • 收藏
  • 关注

原创 【leetcode题解】【再做一遍】【47】【M】241. Different Ways to Add Parentheses

Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +,- and *.Example 1Input

2015-12-24 01:46:19 428

原创 【leetcode题解】【E】【19】299. Bulls and Cows

You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint t

2015-12-23 22:09:41 331

原创 【leetcode题解】[E][52]303. Range Sum Query - Immutable

Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1sumRange(2, 5) -> -1sumRan

2015-12-23 21:41:35 336

原创 【leetcode题解】【M】【10】318. Maximum Product of Word Lengths

Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case le

2015-12-23 01:28:31 306

原创 【leetcode题解】【M】Bulb Switcher

There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turning off

2015-12-23 00:29:36 376

原创 【leetcode题解】【有问题,python没AC,java却过了】【M】【66】Perfect Squares

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.For example, given n = 12, return 3 because 12 = 4 + 4 + 4; given n =

2015-12-21 22:38:22 726

转载 【leetcode题解】【再来,动态规划】【H】【21.8】Burst Balloons

Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get num

2015-12-21 19:19:52 1042

原创 【leetcode题解】【E】【61.5】Remove Nth Node From End of List

Given a linked list, remove the nth node from the end of list and return its head.For example,   Given linked list: 1->2->3->4->5, and n = 2.   After removing the second node from the end, the

2015-12-19 01:17:33 275

原创 【leetcode题解】【M】【67】Letter Combinations of a Phone Number

Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.

2015-12-18 23:56:24 278

原创 【leetcode题解】【M】【79】Palindrome Partitioning

Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return [ [

2015-12-18 23:54:35 274

原创 【leetcode题解】【再看一遍】【86】【M】Contains Duplicate III

Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums[j] is at most t and the difference between i and j 

2015-12-17 23:08:52 429

原创 【leetcode题解】【99.38】【E】Contains Duplicate II

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is at most k.

2015-12-17 19:28:14 266

原创 【leetcode题解】【回溯】【54】【M】Subsets II

Given a collection of integers that might contain duplicates, nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain du

2015-12-15 20:01:12 451

原创 【回溯】【leetcode题解】【M】【57】Combination Sum

Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C unlimited numbe

2015-12-15 18:37:56 409

原创 【VIP】【leetcode题解】【回溯】【97.5】【M】Subsets

Given a set of distinct integers, nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For

2015-12-15 13:46:41 328

原创 【leetcode题解】【E】【97】Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Subscribe to see which companies asked th

2015-12-14 19:13:21 257

原创 【100题纪念】【有趣的算法】【leetcode题解】【E】【84】Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold addit

2015-12-14 18:24:33 746

原创 【leetcode题解】【E】【59】Reverse Bits

Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as0011100101

2015-12-13 22:14:29 444

原创 【特别重要!!!快排的partition思想】【leetcode题解】【M】【71】Kth Largest Element in an Array

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.For example,Given [3,2,1,5,6,4] and k = 2, return 5.

2015-12-13 20:10:09 1596

原创 [E][79][leetcode题解]Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings.Subscribe to see which companies asked this question思路简单,首先找到最短的那个,然后把它,一位一位减少,跟每个字符串比较,看是

2015-12-11 21:12:01 318

原创 【M】【83】【leetcode题解】Flatten Binary Tree to Linked List

Given a binary tree, flatten it to a linked list in-place.For example,Given         1        / \       2   5      / \   \     3   4   6The flattened tree should look like:   1   

2015-12-11 20:48:36 333

原创 【E】【59】【leetcode题解】Valid Sudoku

Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character '.'.A partially fille

2015-12-10 22:18:45 382

原创 【E】【51】【leetcode题解】Rectangle Area

Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.Assume that the tota

2015-12-10 00:16:39 285

原创 [81][E][leetcode 题解]Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.Subscribe to see which c

2015-12-09 23:28:17 367

原创 [88][E][leetcode 题解]Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is

2015-12-09 22:26:21 349

原创 java实现126邮箱邮件发送,使用stmp协议

用java实现一个简单的发送邮件的程序。比较烦人的是,好多邮箱都需要手机验证才能开启stmp服务。跑程序之前记得看一下,邮箱的stmp是否开启,否则会报java 发送邮件报异常 javax.mail.AuthenticationFailedException: 550 ???§±????¨的错误

2015-12-07 14:40:33 3334

原创 【leetcode题解】【28】【E】Palindrome Number

class Solution(object): def isPalindrome(self, x): l = 1 if x < 0 : return False #x = 0 - x while x / (pow(10,l)): l += 1 #prin

2015-12-06 21:25:52 322

原创 【92】【H】【leetcode】 Search in Rotated Sorted Array

Suppose a sorted array 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 target value to search. If found in the array retur

2015-12-06 21:03:43 455

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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