摘要:
在c++中,没有java与python中定义的split()功能的函数,于是自己实现之。 情况1,适用范围,分隔符为字符。思路,记录分隔符的位置,判断需要截取的字符串的下标范围。 vector<string> split(string s,char ch){ int start=0; int len 阅读全文
posted @ 2016-03-06 13:52
ZHOU YANG
阅读(3508)评论(0)推荐(0)
摘要:
Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array.Formally the function should:Return true if there exists i, j, k such that arr[i] & nums) { ... 阅读全文
posted @ 2016-03-05 22:37
ZHOU YANG
阅读(323)评论(0)推荐(0)
摘要:
Given an integer, write a function to determine if it is a power of three.Follow up:Could you do it without using any loop / recursion?思路1:利用递归函数解决问题,... 阅读全文
posted @ 2016-01-13 12:07
ZHOU YANG
阅读(278)评论(0)推荐(0)
摘要:
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文
posted @ 2016-01-11 23:35
ZHOU YANG
阅读(280)评论(0)推荐(0)
摘要:
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文
posted @ 2016-01-10 22:59
ZHOU YANG
阅读(238)评论(0)推荐(0)