Add BinaryGiven two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".SOLUTION:指针指到两个字符串的末尾,不断往前推进,用carr...
分类:
其他好文 时间:
2014-10-26 22:40:47
阅读次数:
339
A function can return any number of results.This function returns two strings.package mainimport "fmt"func swap(x, y string) (string, string) { ret...
分类:
其他好文 时间:
2014-10-26 21:00:32
阅读次数:
143
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv...
分类:
编程语言 时间:
2014-10-26 11:31:30
阅读次数:
243
Solution: when see question about two strings , DP should be considered first.We can abstract this question to calculate appear times for string T wit...
分类:
其他好文 时间:
2014-10-26 00:12:57
阅读次数:
211
DescriptionProductThe ProblemThe problem is to multiply two integers X, Y. (0 2 #include 3 #include 4 #include 5 #define UNIT 10 6 7 using n...
分类:
其他好文 时间:
2014-10-25 15:53:01
阅读次数:
251
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
class Solution {
public:
std::str...
分类:
其他好文 时间:
2014-10-25 09:21:02
阅读次数:
155
Write a function to find the longest common prefix string amongst an array of strings.题目言简意赅,貌似也不难,暴力法用一个char *数组存放strs里每个元素的起始地址,然后循环,同时把所有指针向前移动,如果有...
分类:
其他好文 时间:
2014-10-25 00:52:44
阅读次数:
265
def add(a, b):print "ADDING %d + %d" % (a, b)return a + bdef subtract(a, b):print "SUBTRACTING %d - %d" % (a, b) return a - bdef multiply(a, b): ...
分类:
其他好文 时间:
2014-10-24 10:47:09
阅读次数:
243
Language:
Default
Power Strings
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 33205
Accepted: 13804
Description
Given two strings a and b we define a...
分类:
其他好文 时间:
2014-10-23 22:50:27
阅读次数:
198
Language:Power StringsTime Limit:3000MSMemory Limit:65536KTotal Submissions:33205Accepted:13804DescriptionGiven two strings a and b we define a*b to b...
分类:
其他好文 时间:
2014-10-23 20:41:22
阅读次数:
215