subject : The original title is link ( Simple )
label : character string
solution
Time complexity
Spatial complexity
Execution time
Ans 1 (Python)
O ( L )
O ( L )
56ms (66.55%)
Ans 2 (Python)
Ans 3 (Python)
Solution 1 :
class Solution:
def replaceSpaces(self, S: str, length: int) -> str:
return S[:length].replace(" ", "%20")