自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 45. Jump Game II leetcode python 2016 new season

Given 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 position.Your goal is to

2016-01-25 13:14:07 615

原创 44. Wildcard Matching leetcode Python 2016 new season

Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover t

2016-01-25 07:09:19 840

原创 43. Multiply Strings leetcode python 2016 new season

Total Accepted: 51879 Total Submissions: 231091 Difficulty: MediumGiven two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbi

2016-01-25 04:46:28 705

原创 42. Trapping Rain Water leetcode Python 2016 new season

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1],

2016-01-24 14:01:23 623

原创 40. Combination Sum II leetcode Python 2016 new season

Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in the combina

2016-01-24 10:58:45 871

原创 39. Combination Sum leetcode python 2016 new season

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 numb

2016-01-23 13:48:33 503

原创 38. Count and Say leetcode python 2016 new season

The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as 

2016-01-21 13:09:24 348

原创 37. Sudoku Solver leetcode python new season 2016

Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will be only one unique solution.A sudoku

2016-01-20 11:50:00 455

原创 36. Valid Sudoku leetcode Python new season 2016

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

2016-01-20 11:22:08 428

原创 35. Search Insert Position leetcode Python 2016 new season

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.

2016-01-20 11:01:57 432

原创 34. Search for a Range leetcode Python 2016 new season

Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found

2016-01-20 10:51:54 477

原创 33. Search in Rotated Sorted Array leetcode python 2016 new season

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

2016-01-19 12:46:59 383

原创 32. Longest Valid Parentheses leetcode python new season 2016

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()",

2016-01-18 14:35:19 353

原创 31. Next Permutation leetcode Python 2016 new Season

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible

2016-01-18 14:20:38 448

原创 30. Substring with Concatenation of All Words leetcode Python 2016 new season

You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in wordsexactly once and w

2016-01-18 01:00:44 298

原创 29. Divide Two Integers leetcode python new season 2016

Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.class Solution(object): MAX_INT = 0x7FFFFFFF def divide(self, divide

2016-01-12 12:14:40 387

原创 28. Implement strStr() leetcode Python new season 2016

Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Show Company TagsShow TagsShow Similar Problems

2016-01-12 11:43:21 379

原创 27. Remove Element leetcode python 2016 new season

Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.t

2016-01-12 11:32:54 560

原创 25. Reverse Nodes in k-Group leetcode Python 2016 new season

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is

2016-01-12 11:14:08 466

原创 24. Swap Nodes in Pairs leetcode Python 2016 new Season

Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You m

2016-01-10 12:07:50 418

原创 23. Merge k Sorted Lists python leetcode 2016 new Season

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.use priority queue will take O(n) time cause get max from priority will only take O(1)#

2016-01-10 11:44:20 596

原创 22. Generate Parentheses leetcode Python 2016 new Season

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()

2016-01-08 13:02:33 359

原创 21. Merge Two Sorted Lists leetcode Python 2016 new Season

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.# Definition for singly-linked list.# class ListNo

2016-01-08 12:44:46 346

原创 20. Valid Parentheses leetcode Python 2016 new Season

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all vali

2016-01-07 10:41:39 345

原创 19. Remove Nth Node From End of List leetcode Python 2016 new Season

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 l

2016-01-07 10:29:03 306

原创 18. 4Sum leetcode Python 2016 new Season

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:Elements

2016-01-06 21:24:41 498

原创 17. 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.Input:Digit string

2016-01-06 21:02:16 355

原创 16. 3Sum Closest leetcode Python 2016 new Season

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact

2016-01-06 11:31:39 564

原创 15. 3Sum leetcode python 2016 new Season

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c)

2016-01-06 11:07:01 354

原创 195. Tenth Line leetcode bash

How would you print just the 10th line of a file?For example, assume that file.txt has the following content:Line 1Line 2Line 3Line 4Line 5Line 6Line 7Line 8Line 9Line 10Your script

2016-01-06 10:47:53 616

原创 194. Transpose File leetcode Bash

Given a text file file.txt, transpose its content.You may assume that each row has the same number of columns and each field is separated by the ' ' character.For example, if file.txt has the

2016-01-06 10:46:16 917

原创 193. Valid Phone Numbers leetcode Bash

Given a text file file.txt that contains list of phone numbers (one per line), write a one liner bash script to print all valid phone numbers.You may assume that a valid phone number must appear

2016-01-06 10:42:45 808

原创 192. Word Frequency My Submissions Question Leetcode Bash

Write a bash script to calculate the frequency of each word in a text file words.txt.For simplicity sake, you may assume:words.txt contains only lowercase characters and space ' ' characters

2016-01-06 10:40:14 692

原创 14. Longest Common Prefix leetcode Python 2016 new Season

Write a function to find the longest common prefix string amongst an array of strings.to compare all the strings assume the longest_prefix's length is m and there are n strings. we will need at leas

2016-01-05 20:56:03 312

原创 13. Roman to Integer leetcode Python 2016 new Season

Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.O(n) time go through the whole string. O(1) space.class Solution(object): def

2016-01-05 20:47:34 284

原创 12. Integer to Roman python leetcode 2016 new Season

Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.store the roman and values in arrays and iterate array to get the value. takes O

2016-01-05 11:26:01 279

原创 11. Container With Most Water leetcode Python 2016 new Season

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin

2016-01-05 11:15:33 295

原创 10. Regular Expression Matching leetcode Python 2016 new Season

Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input st

2016-01-04 20:52:00 368

原创 9. Palindrome Number Leetcode Python 2016 new Season

Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Show TagsShow Similar ProblemsT

2016-01-04 10:33:17 253

原创 6. ZigZag Conversion Leetcode Python 2016 new Season

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I

2016-01-04 10:29:08 320

空空如也

空空如也

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

TA关注的人

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