[LeetCode] Search for a Range

Search for a RangeGiven 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 O(log n).If ...

[LeetCode] Search in Rotated Sorted Array

Search in Rotated Sorted ArraySuppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to ...

[LeetCode] Longest Valid Parentheses

大哭

Longest Valid ParenthesesGiven a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For &qu...

[LeetCode] Isomorphic Strings

Isomorphic StringsGiven two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences o...

JS 、CSS开源工具包

1、Masonry,流式布局包http://masonry.desandro.com/ 2、Jquery,强大的js包https://jquery.com/3、css88,前端学习网http://www.css88.com/4、bootstrap,前端css框架http://www.bootcss.com/ 5、甘特图,http://www.kangry.net/blog/?type=articl...

[LeetCode] Next Permutation



Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the low...

[LeetCode] Count Primes

Count PrimesDescription:Count the number of prime numbers less than a non-negative number, n解题思路:题意为求小于n的质数的个数。有两种方法:1、naive办法,对小于n的每个数,检查是否为质数。而检查m是否为质数,需要验证是否都不能被2~pow(m, 0.5)整除。这个方法的时间复杂度为O(n^...

在线工具集

1、反编译swf工具http://www.showmycode.com/ 2、代码格式化工具,包括HTML/XML、CSS、JSON、Javascript、Java、SQLhttp://tool.oschina.net/codeformat/xml 3、一款非常好的PDF编辑,合并,拆分工具pdfcombinehttp://www.pdfcombine.com/https://smallpdf.c...

[LeetCode] Substring with Concatenation of All Words

Substring with Concatenation of All WordsYou are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that...

[LeetCode] Implement strStr()

Implement strStr()Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.解题思路:1、暴力法。逐一匹配,然后回溯。代码如下,但是产生超时错误。class Solution&nbs...