摘要:
题目如下:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two ... 阅读全文
摘要:
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999与罗马字符转数字类似,注意按级处理。string intToRoman(int num){... 阅读全文
摘要:
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.从低位开始累加,注意一下像IV和 VI DC和CD的处理class Solution {... 阅读全文
摘要:
'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input string (not partial).The 阅读全文
摘要:
这是DP最基础的一个问题,刚开始学习这一块,实现了一下,不要黑我巨长的参数表,新手。代码如下:void FastWay(int l1[], int l2[], int e1, int e2, int x1, int x2, int t1[], int t2[], int n){ int f1[... 阅读全文
摘要:
Given an input string, reverse the string word by word.For example, Given s = "the sky is blue", return "blue is sky the".Update (2015-02-12): For C p... 阅读全文
摘要:
'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input string (not partial).The... 阅读全文
摘要:
Which of following C++ code is correct ?A.int f(){ int *a = new int(3); return *a;}B.int *f(){ int a[3] = {1,2,3}; return a;}C.vector f(){ vecto... 阅读全文