We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 938534e commit bbea1b3Copy full SHA for bbea1b3
C++/chapString.tex
@@ -206,10 +206,10 @@ \subsubsection{代码}
206
// 时间复杂度O(n),空间复杂度O(1)
207
class Solution {
208
public:
209
- int atoi(const char *str) {
+ int myAtoi(const string &str) {
210
int num = 0;
211
int sign = 1;
212
- const int n = strlen(str);
+ const int n = str.length();
213
int i = 0;
214
215
while (str[i] == ' ' && i < n) i++;
C++/leetcode-cpp.pdf
43 Bytes
0 commit comments