Skip to content

Commit 8f7f6fd

Browse files
committed
omit upperbound of s[1:...]
1 parent e4f10ae commit 8f7f6fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/chapter01/1.6 - String Compression/miguel_1.6_sol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def str_compression(s: str) -> str:
2525
compressed = []
2626
prev_char = s[0]
2727
count = 1
28-
for c in s[1:len(s)]:
28+
for c in s[1:]:
2929
if c == prev_char:
3030
count += 1
3131
continue

0 commit comments

Comments
 (0)