[LeetCode] Valid Sudoku
Valid SudokuDetermine 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 character '.'.A...
[LeetCode] Sudoku Solver
Sudoku SolverWrite a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will be only one unique solution....
[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] 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 ...
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] 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...
[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^...
[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...
在线工具集
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] Remove Duplicates from Sorted Array
Remove Duplicates from Sorted ArrayGiven 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 for anot...
[LeetCode] Remove Element
Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the ne...
[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...
[LeetCode] Swap Nodes in Pairs
Swap Nodes in PairsGiven 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.Your algori...
[LeetCode] Remove Linked List Elements
Remove Linked List ElementsRemove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Retu...
[LeetCode] Reverse Nodes in k-Group
Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out...
[LeetCode] Happy Number
Happy NumberWrite an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the ...
[LeetCode] Merge k Sorted Lists
Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.解题思路:1、分治方法,两两合并。设每个链表的长度为n,有k个链表,那么每次合并最多扫描所有的元素,共扫描k/2+k/4+...+1...
[LeetCode] Generate Parentheses
Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))&...