Skip to content

Commit 2cb95a5

Browse files
committed
Convert the camelCase to snake_case
1 parent fcb9e03 commit 2cb95a5

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

map/longest_common_subsequence.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
"""
22
Given string a and b, with b containing all distinct characters,
3-
find the longest common subsequence's
3+
find the longest common subsequence's
44
55
length. Expected complexity O(nlogn).
66
"""
77

88

9-
def maxCommonSubString(S1,S2):
10-
##Assuming S2 has all unique chars
11-
S2Dic = {S2[i]:i for i in xrange(len(S2))}
12-
maxR = 0
13-
subS = ''
9+
def max_common_sub_string(s1, s2):
10+
# Assuming s2 has all unique chars
11+
s2dic = {s2[i]: i for i in xrange(len(s2))}
12+
maxr = 0
13+
subs = ''
1414
i = 0
15-
while i < len(S1):
16-
if S1[i] in S2Dic:
17-
j = S2Dic[S1[i]]
15+
while i < len(s1):
16+
if s1[i] in s2dic:
17+
j = s2dic[s1[i]]
1818
k = i
19-
while j < len(S2) and k < len(S1) and S1[k] == S2[j]:
19+
while j < len(s2) and k < len(s1) and s1[k] == s2[j]:
2020
k += 1
2121
j += 1
22-
if k - i > maxR:
23-
maxR = k-i
24-
subS = S1[i:k]
22+
if k - i > maxr:
23+
maxr = k-i
24+
subs = s1[i:k]
2525
i = k
2626
else:
2727
i += 1
28-
return subS
28+
return subs

map/valid_sudoku.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
the character '.'.
66
"""
77

8-
def isValidSudoku(self, board):
8+
def is_valid_sudoku(self, board):
99
seen = []
1010
for i, row in enumerate(board):
1111
for j, c in enumerate(row):

0 commit comments

Comments
 (0)