Commit b39ee352 by 牛家玺

ok

parent ffd65ffa
# def quicksort1(array):
# doquicksort1(array, 0, len(array)-1)
#
#
# def doquicksort1(array, low, height):
# if low < height:
# mid = (low + height) // 2
# partition1(mid, array)
# doquicksort1(array, low, mid - 1)
# doquicksort1(array, mid + 1, height)
#
#
# def partition1(mid, array):
#
#
# def quicksort2(array):
# print(array)
#
#
# quicksort1([1, 5, 7, 8, 2, 34, 6, 0, 3])
# quicksort2([1, 5, 7, 8, 2, 34, 6, 0, 3])
def convert(s, numRows): def convert(s, numRows):
# 初始化数组 # 初始化数组
if numRows != 1: if numRows == 1:
return s return s
rows = [''] * numRows rows = [''] * numRows
index = 0 index = 0
...@@ -23,9 +23,8 @@ def convert(s, numRows): ...@@ -23,9 +23,8 @@ def convert(s, numRows):
# #
# str = "0123456789" # str = "0123456789"
# str = "LEETCODEISHIRING" str = "LEETCODEISHIRING"
# #
# convert(str, 3) # convert(str, 3)
# convert(str, 4) # convert(str, 4)
str = "AB" print(convert(str, 4))
print(convert(str, 1))
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