Skip to content

Commit 8ab534a

Browse files
committed
Update one-edit-distance.py
1 parent 98896c2 commit 8ab534a

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Python/one-edit-distance.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
# Given two strings S and T, determine if they are both one edit distance apart.
55
#
66

7-
class Solution:
8-
# @param s, a string
9-
# @param t, a string
10-
# @return a boolean
7+
class Solution(object):
118
def isOneEditDistance(self, s, t):
9+
"""
10+
:type s: str
11+
:type t: str
12+
:rtype: bool
13+
"""
1214
m, n = len(s), len(t)
1315
if m > n:
1416
return self.isOneEditDistance(t, s)
@@ -26,4 +28,4 @@ def isOneEditDistance(self, s, t):
2628
return i == m
2729

2830
if __name__ == "__main__":
29-
print Solution().isOneEditDistance("teacher", "acher")
31+
print Solution().isOneEditDistance("teacher", "acher")

0 commit comments

Comments
 (0)