Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
homework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ligang
homework
Commits
4b663343
Commit
4b663343
authored
Feb 25, 2019
by
牛家玺
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批改作业
parent
4f1f98ac
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
0 deletions
+9
-0
05-homework-ligang/coat_latin.py
+1
-0
05-homework-ligang/regular.py
+1
-0
05-homework-ligang/sort.py
+1
-0
07-homework-ligang/matrix.py
+2
-0
08-homework-ligang/maxDepth.py
+4
-0
No files found.
05-homework-ligang/coat_latin.py
View file @
4b663343
...
...
@@ -20,6 +20,7 @@ class Latin:
if
vowel
.
find
(
word
[
0
:
1
]
.
lower
())
>=
0
:
new_str
+=
word
new_str
+=
s
#这里可以使用 乘法 python支持字符串乘法
for
k
in
range
(
i
):
new_str
+=
'a'
new_str
+=
' '
...
...
05-homework-ligang/regular.py
View file @
4b663343
...
...
@@ -56,3 +56,4 @@ regular = Regular()
#result = regular.get_phone_numbers(url)
result
=
regular
.
get_urls
(
url
)
print
(
result
)
#ok
05-homework-ligang/sort.py
View file @
4b663343
...
...
@@ -26,6 +26,7 @@ class SortUtils:
i
+=
1
a
[
i
],
a
[
j
]
=
a
[
j
],
a
[
i
]
a
[
i
],
a
[
start_index
]
=
a
[
start_index
],
a
[
i
]
#这里可以直接使用self 来引用
SortUtils
.
__quick_sort
(
self
,
a
,
start_index
,
i
-
1
)
SortUtils
.
__quick_sort
(
self
,
a
,
i
+
1
,
end_index
)
return
a
...
...
07-homework-ligang/matrix.py
View file @
4b663343
...
...
@@ -27,3 +27,4 @@ class Solution:
matrix
=
[[
1
,
2
,
3
,
4
],
[
5
,
1
,
2
,
3
],
[
9
,
5
,
1
,
2
]]
solu
=
Solution
()
print
(
solu
.
isToeplitzMatrix
(
matrix
))
#ok
\ No newline at end of file
08-homework-ligang/maxDepth.py
View file @
4b663343
...
...
@@ -21,3 +21,6 @@ class Solution:
l
=
1
+
self
.
maxDepth
(
root
.
left
)
# 递归
r
=
1
+
self
.
maxDepth
(
root
.
right
)
return
max
(
l
,
r
)
#ok
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment