
LeetCode
Matrix1254
爱代码,爱加班,爱咖啡可乐
爱挑战,爱钻研,爱打游戏
爱晚起,也爱工作到深夜。
我擅长技术,崇尚简单和懒惰
我神秘而孤僻,沉默而爱憎分明
我行我素,我是程序员
展开
-
LeetCode-Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()原创 2014-03-29 09:53:48 · 718 阅读 · 0 评论 -
LeetCode-Implement strStr()
Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.[Code]class Solution {public: char *strStr(char *haystack原创 2014-03-22 08:13:03 · 711 阅读 · 0 评论 -
LeetCode-Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe原创 2014-03-22 02:13:21 · 632 阅读 · 0 评论 -
LeetCode-Valid Palindrome
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原创 2014-03-22 07:30:46 · 780 阅读 · 0 评论 -
LeetCode-Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321Have you thought about this?Here are some good questions to ask before coding. Bonus points for you原创 2014-03-22 08:20:37 · 690 阅读 · 0 评论 -
LeetCode-Container With Most Water
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 endpoints of line i is at (i, ai) and (i, 0). Fin原创 2014-03-22 06:27:35 · 594 阅读 · 0 评论