在线工具集
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:"((()))&...
[LeetCode] Valid Parentheses
Valid ParenthesesGiven a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the inpu...
[LeetCode] 3Sum Closest
3Sum ClosestGiven 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. You may...
[LeetCode] Remove Nth Node From End of List
Remove Nth Node From End of ListGiven a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->...
[LeetCode] 4Sum
4SumGiven an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = targ...
[LeetCode] 3Sum
3SumGiven 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...
[LeetCode] Roman to Integer
Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.解题思路:罗马数字转化成数字。一种方法是映射法,每一位(阿拉伯数字)的字符到阿拉伯数字的映射。如下所示:class Solution {...
[LeetCode] Container With Most Water
Container With Most WaterGiven n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such tha...
[LeetCode] Integer to Roman
Integer to RomanGiven an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.解题思路:数字转罗马字符。并不是非常复杂,罗马字符的表示如维基百科所述http://zh.wikipedia.org/wiki/%E7%BD%97%E9%A...
[LeetCode] Longest Palindromic Substring
Longest Palindromic SubstringGiven a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest...