Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:
其他好文 时间:
2015-05-05 23:46:09
阅读次数:
174
问题Text Justification Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.You should pack your words in a greedy...
分类:
其他好文 时间:
2015-05-05 22:06:25
阅读次数:
150
Problem:
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the...
分类:
其他好文 时间:
2015-05-05 19:42:36
阅读次数:
101
problem:
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.
get(key) - Get the value (will
always be po...
分类:
系统相关 时间:
2015-05-05 19:42:16
阅读次数:
204
First Missing Positive
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in...
分类:
其他好文 时间:
2015-05-05 16:32:16
阅读次数:
104
在ubuntu环境下, 想往/etc/sudoers中添加可以执行sudo操作的用户,使用root将/etc/sudoers的权限修改为755后,提示出现标题中的错误: 修正方法:将/etc/sudoers的owner和组修改为root: chown root:root /etc/sudoers
分类:
其他好文 时间:
2015-05-05 16:11:17
阅读次数:
706
Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru...
分类:
其他好文 时间:
2015-05-05 15:58:37
阅读次数:
99
题目:
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.
翻译:
把2个有序链表连接,返回一个新链表
思路:
很简单,就是遍历每个节点,小的话添加在...
分类:
其他好文 时间:
2015-05-05 12:43:02
阅读次数:
126
Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.解决思路:
决定阶乘末尾零的个数其实是数列中5出现的次数,比如5的阶乘一个零。1024的阶乘末尾到底有几个零呢?http://bbs.csdn.net/...
分类:
其他好文 时间:
2015-05-05 00:02:59
阅读次数:
176
There are two sorted arrays nums1 and nums2 of
size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).
这是一道非常经典的题。这题更通用的形式是,给定...
分类:
其他好文 时间:
2015-05-04 12:00:57
阅读次数:
100