Commit ec36c835 by 牛家玺

ok

parent cc315b06
......@@ -22,6 +22,8 @@
def uniqueMorseRepresentations(words):
r = [".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-", ".-..", "--", "-.", "---",
".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.."]
# w 可以使用 {chr(i + 97): morse[i] for i in range(0, len(morse))} 来生成
w = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z']
dic = dict(zip(w, r))
......
......@@ -18,6 +18,9 @@ def convert(s, numRows):
s = convert("PAYPALISHIRING", 4)
print(s)
s = convert("LEETCODEISHIRING",4)
#输出结果 LDREOEIIECIHN 正确是LDREOEIIECIHNTSG 检查一下那一步少了什么操作
print(s)
# def convert(s, numRows):
......
......@@ -13,6 +13,7 @@ def toGoatLatin(S):
print(toGoatLatin("I speak Goat Latin"))
#正确
......
......@@ -74,3 +74,6 @@ def findRadius(houses, heaters):
houses, heaters = [1, 3, 5, 9], [1, 4]
findRadius(houses, heaters)
houses = [282475249, 622650073, 984943658, 144108930, 470211272, 101027544, 457850878, 458777923]
heaters = [823564440, 115438165, 784484492, 74243042, 114807987, 137522503, 441282327, 16531729, 823378840, 143542612]
findRadius(houses, heaters)
......@@ -15,4 +15,6 @@ matrix = [
[9, 5, 1, 2]
]
print(isToeplitzMatri(matrix))
\ No newline at end of file
print(isToeplitzMatri(matrix))
#正确
\ No newline at end of file
......@@ -12,3 +12,4 @@ class Solution:
#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