[置顶] [python leetcode] Word Ladder II (very hard)[非常难,放弃]

摘要: Word Ladder II描述Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from startto end, such that:• Only one... 阅读全文

posted @ 2015-08-16 14:03 AIDasr 阅读(1059) 评论(0) 推荐(0) 编辑

[置顶] [leetcode] Valid Palindrome @ Python

摘要: 原题地址:https://oj.leetcode.com/problems/valid-palindrome/题意:Given a string, determine if it is a palindrome, considering only alphanumeric characters an... 阅读全文

posted @ 2014-09-16 07:09 AIDasr 阅读(619) 评论(0) 推荐(0) 编辑

[置顶] [LeetCode] Reverse Linked List II @ Python [提供自创的示意图 Figure illustration]

摘要: 原题地址:https://oj.leetcode.com/problems/reverse-linked-list-ii/题意:Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Gi... 阅读全文

posted @ 2014-09-14 23:04 AIDasr 阅读(909) 评论(0) 推荐(0) 编辑

[置顶] [leetcode]Rotate Image, Matrix tranposition, matrix rotation 90 degree @ Python

摘要: 原题地址:https://oj.leetcode.com/problems/rotate-image/题意:You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Fo... 阅读全文

posted @ 2014-09-14 11:17 AIDasr 阅读(1419) 评论(0) 推荐(0) 编辑

2015年3月16日

Quick Sort

摘要: def quick_sort(array): """ Returns a sorted 'array' by quick sort algorithm via list comprehension, here 'array' is actually a list. """ ... 阅读全文

posted @ 2015-03-16 13:34 AIDasr 阅读(147) 评论(0) 推荐(0) 编辑

2014年12月31日

[leetcode]Copy List with Random Pointer @ Python

摘要: 原题地址:https://oj.leetcode.com/problems/copy-list-with-random-pointer/题意:A linked list is given such that each node contains an additional random pointe... 阅读全文

posted @ 2014-12-31 08:19 AIDasr 阅读(221) 评论(0) 推荐(0) 编辑

[leetcode]Reverse Nodes in k-Group @ Python

摘要: 原题地址:https://oj.leetcode.com/problems/reverse-nodes-in-k-group/题意:Given a linked list, reverse the nodes of a linked listkat a time and return its mod... 阅读全文

posted @ 2014-12-31 07:32 AIDasr 阅读(1181) 评论(0) 推荐(0) 编辑

2014年12月29日

[Leetcode] Remove Duplicates from Sorted List

摘要: Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, r... 阅读全文

posted @ 2014-12-29 11:58 AIDasr 阅读(225) 评论(0) 推荐(0) 编辑

2014年12月27日

[leetcode] Permutation Sequnce

摘要: 原题地址:https://oj.leetcode.com/submissions/detail/5341904/题意:The set[1,2,3,…,n]contains a total ofn! unique permutations.By listing and labeling all of ... 阅读全文

posted @ 2014-12-27 10:57 AIDasr 阅读(186) 评论(0) 推荐(0) 编辑

2014年11月24日

Finding intersection of two sorted arrays

摘要: Reference:http://leetcode.com/2010/03/here-is-phone-screening-question-from.htmlLet’s called array1 as A and array2 as B, each with size m and n.The o... 阅读全文

posted @ 2014-11-24 12:27 AIDasr 阅读(436) 评论(2) 推荐(1) 编辑

2014年10月22日

[leetcode] Search in Rotated Sorted Array @ Python [Figure][自配插图说明]

摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are given a target value t... 阅读全文

posted @ 2014-10-22 23:37 AIDasr 阅读(333) 评论(0) 推荐(0) 编辑

2014年10月21日

[leetcode] Find Minimum in Rotated Sorted Array @ Python

摘要: source:https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array/Suppose a sorted array is rotated at some pivot unknown to you beforehand... 阅读全文

posted @ 2014-10-21 05:16 AIDasr 阅读(687) 评论(0) 推荐(0) 编辑

2014年10月15日

[leetcode] Unique Binary Search Trees @ Python

摘要: Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1... 阅读全文

posted @ 2014-10-15 22:50 AIDasr 阅读(655) 评论(0) 推荐(0) 编辑

导航