- 博客(11)
- 收藏
- 关注
原创 48. Rotate Image
题目You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the image in-place, which means you have to modify the input
2017-11-28 15:05:34 233
原创 Ubuntu快速下载百度云文件
Ubuntu系统本身的下载速度较慢,特别是firefox,经搜索可以使用wget,uget等方法下载,但是由于uget依赖的flashgot插件在最新的firefox上失效,所以命令行使用aria2。1. 安装aria2添加aria2的依赖:sudo add-apt-repository ppa:t-tujikawa/ppa更新依赖:sudo apt-get update安
2017-11-24 16:07:48 31834 6
原创 46. Permutations
题目Given a collection of distinct numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2],
2017-11-23 10:33:21 187
原创 34. Search for a Range
题目Given an array of integers sorted in ascending order, 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).
2017-11-16 15:56:04 174
原创 33. Search in Rotated Sorted Array
题目Suppose 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 target value to search.
2017-11-16 10:41:18 152
原创 32. Longest Valid Parentheses
题目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
2017-11-15 15:34:58 162
原创 31. Next Permutation
题目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
2017-11-10 14:06:24 126
原创 23. Merge k Sorted Lists
题目Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.分析合并k个已排序链表为一个链表,利用优先队列和仿函数构造最小堆,需要注意仿函数的应用场景,在sort等可以排序的算法中,以及set,map,priority_queue等可排序的
2017-11-09 10:44:39 147
原创 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:
2017-11-08 16:54:37 158
原创 15. 3Sum
题目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: The solution set must not
2017-11-07 20:36:59 176
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人