Skip to content

Commit 6549053

Browse files
authored
Update lexicographically-smallest-string-after-operations-with-constraint.py
1 parent 93591d4 commit 6549053

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/lexicographically-smallest-string-after-operations-with-constraint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def getSmallestString(self, s, k):
1111
"""
1212
result = map(lambda x: ord(x)-ord('a'), s)
1313
for i in xrange(len(result)):
14-
d = min(result[i], -result[i]+26)
14+
d = min(result[i]-0, 26-result[i])
1515
result[i] = 0 if d <= k else result[i]-k
1616
k -= min(d, k)
1717
if k == 0:

0 commit comments

Comments
 (0)