yan chuanli 2 years ago
parent
commit
f2ec1f221b
1 changed files with 9 additions and 0 deletions
  1. 9 0
      long_common_pre.py

+ 9 - 0
long_common_pre.py

@@ -1,4 +1,13 @@
 from typing import List
 
 def longestCommonPrefix(strs: List[str]):
+    res = ""
+    lcs = ""
     lens = len(strs)
+    for i in range(lens):
+        if len(strs[i]) < len(strs[i+1]):
+            lcs = strs[i]
+            num = i
+
+
+