- Two Sum
- Add Two Numbers
- Longest Substring Without Repeating Characters
- Median of Two Sorted Arrays
- Longest Palindromic Substring
- ZigZag Conversion
- Reverse Integer
- String to Integer (atoi)
- Palindrome Number
- Regular Expression Matching
- Container With Most Water
- Integer to Roman
- Roman to Integer
- Longest Common Prefix
- 3Sum
- 3Sum Closest
- Letter Combinations of a Phone Number
- 4Sum
- Remove Nth Node From End of List
- Valid Parentheses
- Merge Two Sorted Lists
- Generate Parentheses
- Merge k Sorted Lists
- Swap Nodes in Pairs
- Reverse Nodes in k-Group
- Remove Duplicates from Sorted Array
- Remove Element
- Implement strStr()
- Divide Two Integers
- Substring with Concatenation of All Words
- Next Permutation
- Longest Valid Parentheses
- Search in Rotated Sorted Array
- Search for a Range
- Search Insert Position
- Valid Sudoku
- Sudoku Solver
- Count and Say
- Combination Sum
- Combination Sum II
- First Missing Positive
- Trapping Rain Water
- Multiply Strings
- Wildcard Matching
- Jump Game II
- Permutations
- Permutations II
- Rotate Image
- Group Anagrams
- [Pow(x, n)](./algorithms/50.Pow%20x, n .md)
- N-Queens
- N-Queens II
- Maximum Subarray
- Spiral Matrix
- Jump Game
- Merge Intervals
- Insert Interval
- Length of Last Word
- Spiral Matrix II
- Permutation Sequence
- Rotate List
- Unique Paths
- Unique Paths II
- Minimum Path Sum
- Valid Number
- Plus One
- Add Binary
- Text Justification
- [Sqrt(x)](./algorithms/69.Sqrt%20x .md)
- Climbing Stairs
- Simplify Path
- Edit Distance
- Set Matrix Zeroes
- Search a 2D Matrix
- Sort Colors
- Minimum Window Substring
- Combinations
- Subsets
- Word Search
- Remove Duplicates from Sorted Array II
- Search in Rotated Sorted Array II
- Remove Duplicates from Sorted List II
- Remove Duplicates from Sorted List
- Largest Rectangle in Histogram
- Maximal Rectangle
- Partition List
- Scramble String
- Merge Sorted Array
- Gray Code
- Subsets II
- Decode Ways
- Reverse Linked List II
- Restore IP Addresses
- Binary Tree Inorder Traversal
- Unique Binary Search Trees II
- Unique Binary Search Trees
- Interleaving String
- Validate Binary Search Tree
- Recover Binary Search Tree
- Same Tree
- Symmetric Tree
- Binary Tree Level Order Traversal
- Binary Tree Zigzag Level Order Traversal
- Maximum Depth of Binary Tree
- Construct Binary Tree from Preorder and Inorder Traversal
- Construct Binary Tree from Inorder and Postorder Traversal
- Binary Tree Level Order Traversal II
- Convert Sorted Array to Binary Search Tree
- Convert Sorted List to Binary Search Tree
- Balanced Binary Tree
- Minimum Depth of Binary Tree
- Path Sum
- Path Sum II
- Flatten Binary Tree to Linked List
- Distinct Subsequences
- Populating Next Right Pointers in Each Node
- Populating Next Right Pointers in Each Node II
- Pascal's Triangle
- Pascal's Triangle II
目录生成脚本:
(function a(begin,end){
var tbody = document.querySelector("tbody"),temp = "";
if(begin && end)
while(begin<=end){
var name = tbody.children[begin-1].children[2].getAttribute("value");
temp += begin + ". [" + name + "](./algorithms/" + begin + "." + name.replace(/\s/g,"%20") + ".md)\r\n";
begin++;
}
console.log(temp);
})(1,200)
页面转markdown脚本:
不是100%正确,转换后需要修正
(function(){
var temp = "# " + document.querySelector("h3").textContent.trim() + "\r\n";
function a(ele){
((ele instanceof Text) && (temp+=(ele.data.trim().length==0)?"\r\n":ele.data))
|| ((ele.matches("code")) && (temp+="``"+ele.textContent+"``"))
|| ((ele.matches("pre")) && (temp+="\r\n```\r\n"+ele.textContent+"```\r\n"))
|| ((ele.matches("b")) && (temp+="**"+ele.textContent+"**"))
|| ((ele.matches("img")) && (temp+="\r\n!(图片名)["+ele.src+"]\r\n"))
|| ((ele.matches("li")) && (temp+="* "+ele.textContent))
|| ele.matches("div")
|| Array.from(ele.childNodes).forEach((e) => {a(e);});
}
Array.from(document.querySelector("div.question-content").childNodes).forEach((e)=>{a(e);});
temp += "**Solution:**\r\n\r\n```java\r\n\r\n```"
console.log(temp);
})()