题目:Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you ca...
分类:
编程语言 时间:
2015-06-18 23:42:31
阅读次数:
198
Longest Increasing Continuous subsequence IIGive you an integer matrix (with row size n, column size m),find the longest increasing continuous subsequ...
分类:
其他好文 时间:
2015-06-18 19:21:53
阅读次数:
156
Given an array ofnpositive integers and a positive integers, find the minimal length of a subarray of which the sum ≥s. If there isn't one, return 0 i...
分类:
其他好文 时间:
2015-06-18 18:47:04
阅读次数:
98
Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum
= 22,
5
...
分类:
其他好文 时间:
2015-06-18 17:29:24
阅读次数:
108
Single Number
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it ...
分类:
其他好文 时间:
2015-06-18 17:26:45
阅读次数:
93
这道题目一开始我还以为是并查集,后来发现比并查集简单的多,就是一个家谱树,然后找到两个节点之间的深度差。
#include
int data[30];
void make_set(){
for(int i=0;i<30;i++)
data[i]=-1;
}
int find(int a,int b){
int re=1;
while(data[...
分类:
其他好文 时间:
2015-06-18 13:38:42
阅读次数:
134
MAC下安装Android Studio 遇到该问题Android studio was unable to find a valid JVM解决方法在应用程序中找到Android Studio.app -> 右击显示包内容,在目录下找到 info.plist 并用任意文本编辑器打开 -> 找到 J...
分类:
移动开发 时间:
2015-06-18 11:26:59
阅读次数:
136
find .|xargs grep -ri "IBM"find .|xargs grep -ri "IBM" -l\ :只用来屏蔽一个元字符的特殊含义。 如\*,\',\",\|,\+,\^,\. 等.:(点)只匹配任意单字符。pattern\{n\}:只用来匹配前面pattern出现的次数.n为次...
分类:
其他好文 时间:
2015-06-18 11:26:20
阅读次数:
105
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a...
分类:
其他好文 时间:
2015-06-18 11:20:39
阅读次数:
81
题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet...
分类:
编程语言 时间:
2015-06-18 11:07:33
阅读次数:
151