mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 16:54:50 +08:00
update 1047.删除字符串中的所有相邻重复项: 添加复杂度分析
This commit is contained in:
@ -77,6 +77,9 @@ public:
|
||||
}
|
||||
};
|
||||
```
|
||||
* 时间复杂度: O(n)
|
||||
* 空间复杂度: O(n)
|
||||
|
||||
|
||||
当然可以拿字符串直接作为栈,这样省去了栈还要转为字符串的操作。
|
||||
|
||||
@ -99,6 +102,8 @@ public:
|
||||
}
|
||||
};
|
||||
```
|
||||
* 时间复杂度: O(n)
|
||||
* 空间复杂度: O(1),返回值不计空间复杂度
|
||||
|
||||
## 题外话
|
||||
|
||||
|
Reference in New Issue
Block a user