【题目】
Validate if a given string is numeric.
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true
Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before imple...
分类:
其他好文 时间:
2014-06-04 23:45:09
阅读次数:
388
【题目】
Follow up for "Remove Duplicates":
What if duplicates are allowed at most twice?
For example,
Given sorted array A = [1,1,1,2,2,3],
Your function should return length = 5, and A is now [1,1,2,2,3].
【题意】
给定一个有序数组,给数组去重,和Remove Duplicates from...
分类:
其他好文 时间:
2014-06-03 05:36:24
阅读次数:
219
apache的虚拟主机一直运行都是正常,但是当我升级了ubuntu系统之后,再启动apache时,虚拟主机出现了forbidden的错误。在网上找了很长时间答案,但是很多方法试了之后都无效,最后还是找到了解决办法,先记录下来,后面防止再发生这样的错误。
奇怪现象:如果将document root指向/var/www或其子目录,那么就不会出现forbidden错误————太奇怪了~~
失败方法:...
分类:
其他好文 时间:
2014-06-03 04:13:25
阅读次数:
202
【题目】
Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2, return 1->2.
Given 1->1->2->3->3, return 1->2->3.
【题意】
给定一个已排序的链表,删除其中的重复元素
【思路】
维护两个指针prev和cur, cur指针负责扫描链表,prev指向cur的前一...
分类:
其他好文 时间:
2014-06-03 04:05:39
阅读次数:
231
【题目】
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the array.
【题意】
在“Search in Rotated Sorted Array”的基...
分类:
其他好文 时间:
2014-06-03 01:55:38
阅读次数:
173
交换两个变量:例如num1=5,num2=6→num1=6,num=5
怎么样?是不是觉得灰常简单,你是不是用下面的方法做的:
int num1=5;
int num2=6;
int temp=num1;
num1=num2;
num2=temp;
Console.WriteLine("num1={0},num2={1}",num1,num2);
好吧!你赢了!你做的非常对!就就是...
分类:
其他好文 时间:
2014-06-03 01:51:43
阅读次数:
225
【题目】
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be use...
分类:
其他好文 时间:
2014-06-03 01:07:58
阅读次数:
329
【题目】
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1->1->2->3, return 2->3.
【题意】
给定一个有序链表,删出其中重复出现的值...
分类:
其他好文 时间:
2014-05-31 21:14:11
阅读次数:
333
??对于一个应用程序而言,静态链接库可能被载入多次,而动态链接库仅仅会被载入一次。Gameloft面试之错误一Event:面试官说例如以下程序是能够链接通过的.class
Base{Public:Base(void){this-> initialize();}virtual void initial...
分类:
编程语言 时间:
2014-05-31 20:07:51
阅读次数:
400