摘要: Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. solution: 阅读全文
posted @ 2017-03-08 16:22 DevinGu 阅读(263) 评论(0) 推荐(0)
摘要: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. solution: 阅读全文
posted @ 2017-03-08 15:06 DevinGu 阅读(196) 评论(0) 推荐(0)
摘要: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you 阅读全文
posted @ 2017-03-06 21:24 DevinGu 阅读(167) 评论(0) 推荐(0)
摘要: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space fo 阅读全文
posted @ 2017-03-06 21:13 DevinGu 阅读(165) 评论(0) 推荐(0)
摘要: Given a linked list, remove the nth node from the end of list and return its head. For example, 阅读全文
posted @ 2017-03-06 19:49 DevinGu 阅读(142) 评论(0) 推荐(0)
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 阅读全文
posted @ 2017-03-06 19:33 DevinGu 阅读(279) 评论(0) 推荐(0)
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
posted @ 2017-03-05 22:10 DevinGu 阅读(420) 评论(0) 推荐(0)
摘要: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array whic 阅读全文
posted @ 2017-03-05 21:31 DevinGu 阅读(258) 评论(0) 推荐(0)
摘要: Solution : 1 class Solution { 2 public: 3 vector letterCombinations(string digits) { 4 if(digits.empty()) return vector(); 5 vector list={"","","abc","def","ghi","jkl","mno","... 阅读全文
posted @ 2017-03-05 20:49 DevinGu 阅读(283) 评论(0) 推荐(0)
摘要: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. 阅读全文
posted @ 2017-03-05 19:21 DevinGu 阅读(177) 评论(0) 推荐(0)