#include <leetcode.h>
◆ decodeString()
string leetcode::decode_string::Solution::decodeString |
( |
string |
s | ) |
|
|
static |
在文件 leetcode.cpp 第 8268 行定义.
8271 vector<string> strs;
8272 while(i < s.length()) {
8273 if(isalpha(s[i]) != 0) {
8274 cnt.emplace_back(1);
8275 strs.emplace_back(
string(1, s[i]));
8277 }
else if(isdigit(s[i]) != 0) {
8279 while(j < s.length() && isdigit(s[j]) != 0) {
8282 cnt.emplace_back(stoi(s.substr(i, j - i)));
8289 }
else if(s[j] ==
']') {
8293 strs.emplace_back(
decodeString(s.substr(i + 1, j - i - 1)));
8298 for(i = 0; i < cnt.size(); i++) {
8299 for(
int j = 0; j < cnt[i]; j++) {
static string decodeString(string s)
引用了 decodeString().
被这些函数引用 decodeString() , 以及 leetcode::decode_string::TEST().
该类的文档由以下文件生成: