Skip to content

Commit 527a74c

Browse files
committed
做了道题
1 parent ea167a9 commit 527a74c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

main.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ def compute(left, right):
8282
ans += compute(op, ed)
8383
return ans
8484

85+
def isSumEqual(self, firstWord: str, secondWord: str, targetWord: str) -> bool:
86+
87+
def compute(s):
88+
temp = ""
89+
base = ord('a')
90+
for c in s:
91+
temp += str(ord(c) - base)
92+
return int(temp)
93+
print(compute(firstWord), compute(secondWord), compute(targetWord))
94+
return compute(firstWord) + compute(secondWord) == compute(targetWord)
95+
8596
s = Solution()
86-
print(s.minOperations( queries = [[2,6]]))
97+
print(s.isSumEqual(firstWord = "acb", secondWord = "cba", targetWord = "cdb"))
8798

0 commit comments

Comments
 (0)