Commit 4b663343 by 牛家玺

批改作业

parent 4f1f98ac
...@@ -20,6 +20,7 @@ class Latin: ...@@ -20,6 +20,7 @@ class Latin:
if vowel.find(word[0:1].lower()) >=0: if vowel.find(word[0:1].lower()) >=0:
new_str += word new_str += word
new_str += s new_str += s
#这里可以使用 乘法 python支持字符串乘法
for k in range(i): for k in range(i):
new_str +='a' new_str +='a'
new_str += ' ' new_str += ' '
......
...@@ -56,3 +56,4 @@ regular = Regular() ...@@ -56,3 +56,4 @@ regular = Regular()
#result = regular.get_phone_numbers(url) #result = regular.get_phone_numbers(url)
result = regular.get_urls(url) result = regular.get_urls(url)
print(result) print(result)
#ok
...@@ -26,6 +26,7 @@ class SortUtils: ...@@ -26,6 +26,7 @@ class SortUtils:
i += 1 i += 1
a[i], a[j] = a[j], a[i] a[i], a[j] = a[j], a[i]
a[i], a[start_index] = a[start_index], 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, start_index, i - 1)
SortUtils.__quick_sort(self,a, i + 1, end_index) SortUtils.__quick_sort(self,a, i + 1, end_index)
return a return a
......
...@@ -27,3 +27,4 @@ class Solution: ...@@ -27,3 +27,4 @@ class Solution:
matrix = [[1,2,3,4], [5,1,2,3], [9,5,1,2]] matrix = [[1,2,3,4], [5,1,2,3], [9,5,1,2]]
solu = Solution() solu = Solution()
print(solu.isToeplitzMatrix(matrix)) print(solu.isToeplitzMatrix(matrix))
#ok
\ No newline at end of file
...@@ -20,4 +20,7 @@ class Solution: ...@@ -20,4 +20,7 @@ class Solution:
else: else:
l = 1 + self.maxDepth(root.left) # 递归 l = 1 + self.maxDepth(root.left) # 递归
r = 1 + self.maxDepth(root.right) r = 1 + self.maxDepth(root.right)
return max(l,r) return max(l,r)
\ No newline at end of file
#ok
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment