Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit471c6c4

Browse files
authored
Merge pull requestneetcode-gh#1283 from harjotsbhatia/patch-2
str change to s like in question
2 parents9ce7dd0 +6312f16 commit471c6c4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎python/271-Encode-and-Decode-Strings.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ def encode(self, strs):
1111
returnres
1212

1313
"""
14-
@param:str: A string
14+
@param:s: A string
1515
@return: dcodes a single string to a list of strings
1616
"""
1717

18-
defdecode(self,str):
18+
defdecode(self,s):
1919
res,i= [],0
2020

21-
whilei<len(str):
21+
whilei<len(s):
2222
j=i
23-
whilestr[j]!="#":
23+
whiles[j]!="#":
2424
j+=1
25-
length=int(str[i:j])
26-
res.append(str[j+1 :j+1+length])
25+
length=int(s[i:j])
26+
res.append(s[j+1 :j+1+length])
2727
i=j+1+length
2828
returnres

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp