#include <leetcode.h>
◆ partitionLabels()
vector< int > leetcode::partition_labels::Solution::partitionLabels |
( |
string |
s | ) |
|
|
static |
在文件 leetcode.cpp 第 7254 行定义.
7255 unordered_map<char, unsigned> last;
7257 for(
int i = 0; i < s.length(); i++) {
7260 for(
int i = 0; i < s.length();) {
7261 unsigned last_pos = i;
7263 for(
int j = i; j <= last_pos; j++) {
7264 last_pos = max(last_pos, last[s[j]]);
7266 ans.emplace_back(last_pos - i + 1);
被这些函数引用 leetcode::partition_labels::TEST().
该类的文档由以下文件生成: