【题目】
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[6,5,7],
[4,1,8,3]
]
The minimum path sum from top to...
分类:
其他好文 时间:
2014-06-08 17:52:45
阅读次数:
235
我们在浏览一些网站,尤其是一些小说网站的时候,都会有修改页面背景颜色的地方,这个功能使用jquery很容易实现。
效果图:
show you code:
jquery test
white
red
green
yellow
$("button").click(
function()
{
var color = this.value;
$("...
分类:
Web程序 时间:
2014-06-08 16:48:45
阅读次数:
274
【题目】
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
Note:
You may only use constant extra space.
For example,
Given the following binary tre...
分类:
其他好文 时间:
2014-06-08 15:46:22
阅读次数:
303
【题目】
Given an index k, return the kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only O(k) extra space?
【题意】
给定行索引k, k从0开始,返回该索引指向的杨辉三角的行
要求只能使用O(k)的额外空间
【思路】
...
分类:
其他好文 时间:
2014-06-08 15:46:02
阅读次数:
272
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 approach; that i...
分类:
编程语言 时间:
2014-06-08 15:25:00
阅读次数:
282
【题目】
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
...
分类:
其他好文 时间:
2014-06-08 15:11:58
阅读次数:
298
1、函数、变量出现“could not be resolved ”问题
出现此问题一般是没有找到cocos2d-x声明的头文件,在eclipse将cocos2d的头文件目录引入,包括工程目录、platform/android
在hellocpp/main.cpp函数加入头文件
#include "AppDelegate.h"
#include "cocos2d.h"
#include "...
分类:
移动开发 时间:
2014-06-08 15:06:08
阅读次数:
425
#!/bin/sh
while true
do
ps | grep "my_app" | grep -v "grep" > /dev/null
#第一二个命令输出my_app的运行情况,第二个命令去掉带有grep的条目,然后把结果重定向到null里面不要回显
if [ "$?" -eq 1 ] # 1 : 表示有 ; 0 :表示没有
then
./my_app &...
分类:
系统相关 时间:
2014-06-08 10:06:03
阅读次数:
346
题目
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.
原题链接(点我)
解题思路
给一个数组和一个数字,移除该数字在数组中所有出现的地方。
这是一个非常简单的题目,应...
分类:
其他好文 时间:
2014-06-08 04:05:50
阅读次数:
284
Problem Description
A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.
You are to find all the hat’s words in a dictionary.
In...
分类:
其他好文 时间:
2014-06-08 03:02:14
阅读次数:
323