
leetcode
zzxboy1
励志成为优秀的前端攻城狮。
展开
-
[leetcode javascript解题]Valid Parentheses
leetcode 20题 Valid Parentheses 描述如下 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct or原创 2016-12-21 19:41:10 · 669 阅读 · 2 评论 -
[leetcode javascript解题]Next Permutation
leetcode 第31题 “Next Permutation”描述如下,有点长: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible,原创 2016-12-23 19:21:29 · 588 阅读 · 0 评论 -
[leetcode javascript解题]Letter Combinations of a Phone Number
leetcode的17题”Letter Combinations of a Phone Number”描述如下: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on原创 2016-12-20 21:05:57 · 808 阅读 · 0 评论 -
[leetcode javascript解题]3Sum
leetcode 第15题”3Sum”描述如下: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solut原创 2016-12-20 15:39:24 · 1956 阅读 · 0 评论 -
[leetcode javascript解题]Valid Sudoku
leetcode 36题’Valid Sudoku’,描述如下 Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled with the characte原创 2016-12-30 10:28:35 · 656 阅读 · 0 评论 -
[leetcode javascript解题]Multiply Strings
leetcode 第43题“Multiply Strings”描述如下: 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.原创 2017-01-04 22:20:23 · 590 阅读 · 0 评论 -
[leetcode javascript解题]Longest Common Prefix
leetcode第14题 “Longest Common Prefix”描述是这样的: Write a function to find the longest common prefix string amongst an array of strings.也就是从一个字符串数组中寻找出公共的最长前缀字符串,首先考虑的是这个最长前缀字符串肯定要小于最短字符串长度,所以先找到最短字符串的长度m原创 2016-12-19 21:39:27 · 1357 阅读 · 0 评论 -
[leetcode javascript解题]Container With Most Water
开始在leetcode上用Javascript解题了,本来是打算把代码放在github上,然后开issues来和大家讨论,但是想了想一方面是自己不太喜欢去公开场合宣传自己的github所以基本没人关注到我的github,另一方面是自己的很多题目解法和大神们的解法对比毕竟存在差距。所以还是把自己觉得有意思的,有代表性值得讨论的题放在博客上和大家一套讨论。 当然如果对我其他题的解法有兴趣可以Star一下原创 2016-12-18 16:10:56 · 581 阅读 · 0 评论 -
[leetcode javascript解题]Search for a range
leetcode 第34题”Search for a range”描述如下: Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm’s runtime complexity must be in the order of原创 2016-12-23 22:32:05 · 601 阅读 · 0 评论 -
[leetcode javascript解题]Divide Two Integers
leetcode第29题,“Divide Two Integers” 的描述如下: Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT.题目就是要大家不使用乘除法和模运算来实现除法。同时要考虑边界条件。 这道题在lee原创 2016-12-23 11:36:43 · 911 阅读 · 0 评论 -
[leetcode javascript解题]Combination Sum
leetcode第39题Combination Sum描述如下: Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The sam原创 2017-01-02 00:18:40 · 725 阅读 · 0 评论 -
[leetcode javascript解题]Swap Nodes in Pairs
leetcode 24题 “ Swap Nodes in Pairs”描述如下: Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as `2->1->4->3.这道题乍一看原创 2016-12-22 10:38:30 · 513 阅读 · 0 评论 -
[leetcode javascript解题]Generate Parentheses
leetcode第22题”Generate Parenthese”描述如下: 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: [原创 2016-12-21 21:30:13 · 1216 阅读 · 0 评论 -
[leetcode javascript解题]N-Queens
该题描述如下: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens原创 2017-07-18 11:22:21 · 671 阅读 · 0 评论