#include <leetcode.h>
◆ maximumSubsequenceCount()
long long leetcode::maximize_number_of_subsequences_in_a_string::Solution::maximumSubsequenceCount |
( |
string |
text, |
|
|
string |
pattern |
|
) |
| |
|
static |
在文件 leetcode.cpp 第 4701 行定义.
4703 long long count = 0;
4704 vector<long long> p1count(text.length());
4705 long long p0count = 0;
4707 p1count[text.length() - 1] = 0;
4708 for(
int i = text.length() - 1; i >= 0; i--) {
4709 if(text[i] == pattern[1]) {
4711 }
else if(text[i] == pattern[0]) {
4715 p1count[i - 1] = count;
4718 for(
int i = 0; i < text.length(); i++) {
4719 if(text[i] == pattern[0]) {
4723 ans += max(p0count, count);
被这些函数引用 leetcode::maximize_number_of_subsequences_in_a_string::TEST().
该类的文档由以下文件生成: