Skip to content

Commit

Permalink
fix writing style
Browse files Browse the repository at this point in the history
  • Loading branch information
billryan committed Jan 17, 2016
1 parent 223b57f commit 5f3a40c
Show file tree
Hide file tree
Showing 214 changed files with 290 additions and 290 deletions.
8 changes: 4 additions & 4 deletions scripts/parse_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ def main(argv):
if url.startswith(lintcode_url):
lintcode = Lintcode()
src_body = lintcode.get_src_detail(url)['body']
print("### Problem")
print("### Problem Statement")
print("")
print(h.handle(src_body))
elif url.startswith(leetcode_url):
leetcode = Leetcode()
src_body = leetcode.get_src_detail(url)['body']
print("### Problem")
print("### Problem Statement")
print("")
print(h.handle(src_body))
else:
Expand All @@ -117,9 +117,9 @@ def main(argv):
src_body = hihocoder.get_src_detail(url)['body']
print("# " + src_title)
print("")
print("## Source")
print("## Question")
print("")
print("### Problem")
print("### Problem Statement")
print("")
print(h.handle(src_body))

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/basics_algorithm/binary_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class Main {

[POJ No.1064](http://poj.org/problem?id=1064) 为例。

### Problem
### Problem Statement

$$N$$ 条绳子,它们的长度分别为 $$L_i$$. 如果从它们中切割出 $$K$$ 条长度相同的绳子的话,这 $$K$$ 条绳子每条最长能有多长?答案保留到小数点后两位。

Expand Down Expand Up @@ -226,7 +226,7 @@ class Solution {
}
```

### Problem
### Problem Statement
[Search for a Range](http://www.lintcode.com/zh-hans/problem/search-for-a-range/)

#### 样例
Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/binary_search.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Binary Search - 二分查找

## Source
## Question

- lintcode: [lintcode - (14) Binary Search](http://www.lintcode.com/en/problem/binary-search/)

### Problem
### Problem Statement

For a given sorted array (ascending order) and a `target` number, find the
first index of this number in `O(log n)` time complexity.
Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/find_minimum_in_rotated_sorted_array.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Find Minimum in Rotated Sorted Array

## Source
## Question

- leetcode: [Find Minimum in Rotated Sorted Array | LeetCode OJ](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/)
- lintcode: [(159) Find Minimum in Rotated Sorted Array](http://www.lintcode.com/en/problem/find-minimum-in-rotated-sorted-array/)

### Problem
### Problem Statement

Suppose a sorted array is rotated at some pivot unknown to you beforehand.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Find Minimum in Rotated Sorted Array II

## Source
## Question

- leetcode: [Find Minimum in Rotated Sorted Array II | LeetCode OJ](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/)
- lintcode: [(160) Find Minimum in Rotated Sorted Array II](http://www.lintcode.com/en/problem/find-minimum-in-rotated-sorted-array-ii/)

### Problem
### Problem Statement

Suppose a sorted array is rotated at some pivot unknown to you beforehand.

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/find_peak_element.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Find Peak Element

## Source
## Question

- leetcode: [Find Peak Element | LeetCode OJ](https://leetcode.com/problems/find-peak-element/)
- lintcode: [(75) Find Peak Element](http://www.lintcode.com/en/problem/find-peak-element/)

### Problem
### Problem Statement

A peak element is an element that is greater than its neighbors.

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/first_bad_version.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# First Bad Version

## Source
## Question

- lintcode: [(74) First Bad Version](http://www.lintcode.com/en/problem/first-bad-version/)

### Problem
### Problem Statement

The code base version is an integer start from 1 to n. One day, someone
committed a bad version in the code case, so it caused this version and the
Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/median_of_two_sorted_arrays.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Median of two Sorted Arrays

## Source
## Question

- leetcode: [Median of Two Sorted Arrays | LeetCode OJ](https://leetcode.com/problems/median-of-two-sorted-arrays/)
- lintcode: [(65) Median of two Sorted Arrays](http://www.lintcode.com/en/problem/median-of-two-sorted-arrays/)

### Problem
### Problem Statement

There are two sorted arrays *A* and *B* of size *m* and *n* respectively. Find the **median** of the two sorted arrays.

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/search_a_2d_matrix.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Search a 2D Matrix

## Source
## Question

- leetcode: [Search a 2D Matrix | LeetCode OJ](https://leetcode.com/problems/search-a-2d-matrix/)
- lintcode: [(28) Search a 2D Matrix](http://www.lintcode.com/en/problem/search-a-2d-matrix/)

### Problem
### Problem Statement

Write an efficient algorithm that searches for a value in an _m_ x _n_ matrix.

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/search_a_2d_matrix_ii.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Search a 2D Matrix II

## Source
## Question

- leetcode: [Search a 2D Matrix II | LeetCode OJ](https://leetcode.com/problems/search-a-2d-matrix-ii/)
- lintcode: [(38) Search a 2D Matrix II](http://lintcode.com/en/problem/search-a-2d-matrix-ii/)

### Problem
### Problem Statement

Write an efficient algorithm that searches for a value in an m x n matrix, return the occurrence of it.

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/search_for_a_range.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Search for a Range

## Source
## Question

- leetcode: [Search for a Range | LeetCode OJ](https://leetcode.com/problems/search-for-a-range/)
- lintcode: [(61) Search for a Range](http://www.lintcode.com/en/problem/search-for-a-range/)

### Problem
### Problem Statement

Given a sorted array of _n_ integers, find the starting and ending position of
a given target value.
Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/search_in_rotated_sorted_array.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Search in Rotated Sorted Array

## Source
## Question

- leetcode: [Search in Rotated Sorted Array | LeetCode OJ](https://leetcode.com/problems/search-in-rotated-sorted-array/)
- lintcode: [(62) Search in Rotated Sorted Array](http://www.lintcode.com/en/problem/search-in-rotated-sorted-array/)

### Problem
### Problem Statement

Suppose a sorted array is rotated at some pivot unknown to you beforehand.

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/search_in_rotated_sorted_array_ii.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Search in Rotated Sorted Array II

## Source
## Question

- leetcode: [Search in Rotated Sorted Array II | LeetCode OJ](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/)
- lintcode: [(63) Search in Rotated Sorted Array II](http://www.lintcode.com/en/problem/search-in-rotated-sorted-array-ii/)

### Problem
### Problem Statement

Follow up for "Search in Rotated Sorted Array":
What if _duplicates_ are allowed?
Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/search_insert_position.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Search Insert Position

## Source
## Question

- lintcode: [(60) Search Insert Position](http://www.lintcode.com/en/problem/search-insert-position/)

### Problem
### Problem Statement

Given a sorted array and a target value, return the index if the target is
found. If not, return the index where it would be if it were inserted in
Expand Down
2 changes: 1 addition & 1 deletion zh-hans/binary_search/sqrt_x.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sqrt x

## Source
## Question

- leetcode: [Sqrt(x) | LeetCode OJ](https://leetcode.com/problems/sqrtx/)
- lintcode: [(141) Sqrt(x)](http://www.lintcode.com/en/problem/sqrtx/)
Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_search/wood_cut.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Wood Cut

## Source
## Question

- lintcode: [(183) Wood Cut](http://www.lintcode.com/en/problem/wood-cut/)

### Problem
### Problem Statement

Given n pieces of wood with length `L[i]` (integer array). Cut them into small
pieces to guarantee you could have equal or more than k pieces with the same
Expand Down
2 changes: 1 addition & 1 deletion zh-hans/binary_search_tree/binary_search_tree_iterator.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Binary Search Tree Iterator

## Source
## Question

- lintcode: [(86) Binary Search Tree Iterator](http://www.lintcode.com/en/problem/binary-search-tree-iterator/) <i class="fa fa-star"></i><i class="fa fa-star"></i>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Convert Sorted Array to Binary Search Tree

## Source
## Question

- leetcode: [Convert Sorted Array to Binary Search Tree | LeetCode OJ](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/)
- lintcode: [(177) Convert Sorted Array to Binary Search Tree With Minimal Height](http://www.lintcode.com/en/problem/convert-sorted-array-to-binary-search-tree-with-minimal-height/)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Convert Sorted List to Binary Search Tree

## Source
## Question

- leetcode - [Convert Sorted List to Binary Search Tree | LeetCode OJ](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/)
- lintcode - [(106) Convert Sorted List to Binary Search Tree](http://www.lintcode.com/en/problem/convert-sorted-list-to-binary-search-tree/)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Insert Node in a Binary Search Tree

## Source
## Question

- lintcode: [(85) Insert Node in a Binary Search Tree](http://www.lintcode.com/en/problem/insert-node-in-a-binary-search-tree/)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Search Range in Binary Search Tree

## Source
## Question

- lintcode: [(11) Search Range in Binary Search Tree](http://www.lintcode.com/en/problem/search-range-in-binary-search-tree/)

### Problem
### Problem Statement

Given two values k1 and k2 (where k1 &lt; k2) and a root pointer to a Binary
Search Tree. Find all the keys of tree in range k1 to k2. i.e. print all x
Expand Down
2 changes: 1 addition & 1 deletion zh-hans/binary_search_tree/validate_binary_search_tree.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validate Binary Search Tree

## Source
## Question

- lintcode: [(95) Validate Binary Search Tree](http://www.lintcode.com/en/problem/validate-binary-search-tree/)

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_tree/balanced_binary_tree.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Balanced Binary Tree

## Source
## Question

- leetcode: [Balanced Binary Tree | LeetCode OJ](https://leetcode.com/problems/balanced-binary-tree/)
- lintcode: [(93) Balanced Binary Tree](http://www.lintcode.com/en/problem/balanced-binary-tree/)

### Problem
### Problem Statement

Given a binary tree, determine if it is height-balanced.

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_tree/binary_tree_inorder_traversal.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Binary Tree Inorder Traversal

## Source
## Question

- leetcode: [Binary Tree Inorder Traversal | LeetCode OJ](https://leetcode.com/problems/binary-tree-inorder-traversal/)
- lintcode: [(67) Binary Tree Inorder Traversal](http://www.lintcode.com/en/problem/binary-tree-inorder-traversal/)

### Problem
### Problem Statement

Given a binary tree, return the _inorder_ traversal of its nodes' values.

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_tree/binary_tree_level_order_traversal.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Binary Tree Level Order Traversal

## Source
## Question

- leetcode: [Binary Tree Level Order Traversal | LeetCode OJ](https://leetcode.com/problems/binary-tree-level-order-traversal/)
- lintcode: [(69) Binary Tree Level Order Traversal](http://www.lintcode.com/en/problem/binary-tree-level-order-traversal/)

### Problem
### Problem Statement

Given a binary tree, return the _level order_ traversal of its nodes' values.
(ie, from left to right, level by level).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Binary Tree Level Order Traversal II

## Source
## Question

- leetcode: [Binary Tree Level Order Traversal II | LeetCode OJ](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/)
- lintcode: [(70) Binary Tree Level Order Traversal II](http://www.lintcode.com/en/problem/binary-tree-level-order-traversal-ii/)
Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_tree/binary_tree_maximum_path_sum.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Binary Tree Maximum Path Sum

## Source
## Question

- leetcode: [Binary Tree Maximum Path Sum | LeetCode OJ](https://leetcode.com/problems/binary-tree-maximum-path-sum/)
- lintcode: [(94) Binary Tree Maximum Path Sum](http://www.lintcode.com/en/problem/binary-tree-maximum-path-sum/)

### Problem
### Problem Statement

Given a binary tree, find the maximum path sum.

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_tree/binary_tree_postorder_traversal.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Binary Tree Postorder Traversal

## Source
## Question

- leetcode: [Binary Tree Postorder Traversal | LeetCode OJ](https://leetcode.com/problems/binary-tree-postorder-traversal/)
- lintcode: [(68) Binary Tree Postorder Traversal](http://www.lintcode.com/en/problem/binary-tree-postorder-traversal/)

### Problem
### Problem Statement

Given a binary tree, return the _postorder_ traversal of its nodes' values.

Expand Down
4 changes: 2 additions & 2 deletions zh-hans/binary_tree/binary_tree_preorder_traversal.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Binary Tree Preorder Traversal

## Source
## Question

- leetcode: [Binary Tree Preorder Traversal | LeetCode OJ](https://leetcode.com/problems/binary-tree-preorder-traversal/)
- lintcode: [(66) Binary Tree Preorder Traversal](http://www.lintcode.com/en/problem/binary-tree-preorder-traversal/)

### Problem
### Problem Statement

Given a binary tree, return the preorder traversal of its nodes' values.

Expand Down
2 changes: 1 addition & 1 deletion zh-hans/binary_tree/binary_tree_serialization.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Binary Tree Serialization

## Source
## Question

- lintcode: [(7) Binary Tree Serialization](http://www.lintcode.com/en/problem/binary-tree-serialization/)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Binary Tree Zigzag Level Order Traversal

## Source
## Question

- leetcode: [Binary Tree Zigzag Level Order Traversal | LeetCode OJ](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/)
- lintcode: [(71) Binary Tree Zigzag Level Order Traversal](http://www.lintcode.com/en/problem/binary-tree-zigzag-level-order-traversal/)
Expand Down
Loading

0 comments on commit 5f3a40c

Please sign in to comment.