yuripe
1 months ago
le廢
latest #10
Hey Man BOT
1 months ago
笑死bot
1 months ago
笑死
掰噗~
1 months ago
蛤?
立即下載
yuripe
1 months ago
怕爆,愣了一下這題在 medium 反而抖了一下
yuripe
1 months ago
python 中字串是 immutable 的,所以你以為是在當前字串實例上修改,實則是建立一個新的實例作為新字串
yuripe
1 months ago
所以想了想還是用 list 比較保險,卻表 append 都是 O(1)
yuripe
1 months ago
越想越不對勁==
yuripe
1 months ago
但其實好像也還好,對 spaces 遍歷並更新 start index 好像也還行?
yuripe
1 months ago
沒事,修到 98% 了
yuripe
1 months ago
2109. Adding Spaces to a String
back to top