Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteae2afa

Browse files
committed
testing md file
1 parent8c8ecd2 commiteae2afa

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

‎1-Two-Sum.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
##Description
2-
Given an array of integers, find two numbers such that they add up to a specific target number.
3-
The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-based.
4-
You may assume that each input would have exactly one solution.
5-
Input:
6-
numbers={2, 7, 11, 15}, target=9
7-
Output:
1+
##Two Sum
2+
Source:https://oj.leetcode.com/problems/two-sum
3+
###Description
4+
Given an array of integers, find two numbers such that they add up to a specific target number.
5+
The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-based.
6+
You may assume that each input would have exactly one solution.
7+
Input:
8+
numbers={2, 7, 11, 15}, target=9
9+
Output:
810
index1=1, index2=2
9-
##Tags:
10-
Array, Hash Table
11-
"""
11+
###Tags
12+
Array, Hash Table
13+
###Solutions

‎util.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ def write_to_solution_file(num, title):
2323
printproblem_desc
2424

2525
withopen(num+"-"+title.replace(" ","-")+".md",'w')asf:
26-
f.write('##Description\n')
26+
f.write('##'+title+'\n')
27+
f.write('Source: '+problem_url+"\n")
28+
f.write('###Description\n')
2729
index=problem_desc.index("Tags:")
28-
f.write("\n".join(problem_desc[:index])+"##Tags:\n"+", ".join(problem_desc[index+1:]))
29-
f.write('\n"""')
30+
f.write("\n".join(problem_desc[:index])+"###Tags\n"+", ".join(problem_desc[index+1:])+"\n")
31+
f.write('###Solutions')
3032

3133
defgetAllproblems(url):
3234
problem_set_root=get_doc_root(url)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp