04 2013 档案

摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a palindrome.Note:Have you consider that the string might be empty? This is a good questio 阅读全文
posted @ 2013-04-25 17:32 aijm 阅读(203) 评论(0) 推荐(0)
摘要:class Solution {public: int lengthOfLongestSubstring(string s) { // Start typing your C/C++ solution below // DO NOT write int main() function int longest = 0; set<char> repeat; string::size_type index1 = 0, index2 = 0; if (0 == s.size()) { ... 阅读全文
posted @ 2013-04-25 11:01 aijm 阅读(86) 评论(0) 推荐(0)
摘要:two sum问题:vector<int> twoSum(vector<int> &numbers, int target) { // Start typing your C/C++ solution below // DO NOT write int main() function vector<int> result;for (int i = 0; i < numbers.size(); ++i){ for (int j = i + 1; j < numbers.size(); ++j) { if (target == n... 阅读全文
posted @ 2013-04-24 18:57 aijm 阅读(118) 评论(0) 推荐(0)