Skip to content

Commit 80b01b3

Browse files
committed
1-6-24
1 parent c2e3ec3 commit 80b01b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Jun-1-24.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def scoreOfString(self, s: str) -> int:
3+
l = [ord(i) for i in s]
4+
Sum,i = 0,0
5+
while i<len(s)-1:
6+
Sum += abs(l[i]-l[i+1])
7+
i += 1
8+
return Sum

0 commit comments

Comments
 (0)