wonderful strings

This commit is contained in:
2026-10-29 22:51:38 +00:00
parent 88b634d82d
commit 89d604e076
11 changed files with 215 additions and 0 deletions
@@ -0,0 +1,13 @@
// driver.h - generated by 'usaco new' from LeetCode's metadata (edit freely).
// Reads number-of-wonderful-substrings.in in LeetCode's testcase format, cases back to back:
// one argument per line
// and writes one answer per case to number-of-wonderful-substrings.out, formatted the way LeetCode
// shows its output. Parsing/printing helpers: leetcode.h.
int main() {
freopen("number-of-wonderful-substrings.in", "r", stdin);
freopen("number-of-wonderful-substrings.out", "w", stdout);
for (vector<string> in; lc::read_case(in, 1);) {
auto word = lc::parse<string>(in[0]);
cout << lc::show(Solution().wonderfulSubstrings(word)) << '\n';
}
}