Download 10-week-algorithm-excercise-master/OneQuestionPerDay/LCOF5/replace_space.py from Dorothydu/gitrepo_20: direct link, hf CLI and curl.
- Browser
- Download file 231 Bytes
-
https://huggingface.co/datasets/Dorothydu/gitrepo_20/resolve/main/10-week-algorithm-excercise-master/OneQuestionPerDay/LCOF5/replace_space.py
- Command line
-
hf download hf://datasets/Dorothydu/gitrepo_20/10-week-algorithm-excercise-master/OneQuestionPerDay/LCOF5/replace_space.py
-
curl -L -o replace_space.py https://huggingface.co/datasets/Dorothydu/gitrepo_20/resolve/main/10-week-algorithm-excercise-master/OneQuestionPerDay/LCOF5/replace_space.py
231 Bytes
| class Solution: | |
| def replaceSpace(self, s: str) -> str: | |
| res = [] | |
| for c in s: | |
| if c == " ": | |
| res.append("%20") | |
| else: | |
| res.append(c) | |
| return "".join(res) | |