#include <leetcode.h>
◆ numberOfWays()
int leetcode::number_of_ways_to_divide_a_long_corridor::Solution::numberOfWays |
( |
string |
corridor | ) |
|
|
static |
在文件 leetcode.cpp 第 1388 行定义.
1389 unsigned int s_count = 0;
1390 auto p = vector<unsigned int>();
1391 for(
const char ch: corridor) {
1396 if(s_count == 0 || s_count % 2 != 0) {
1402 unsigned int start = 0;
1403 unsigned int end = corridor.length() - 1;
1404 for(; start < end; start++) {
1405 if(corridor[start] ==
'S') {
1409 for(; end > start; end--) {
1410 if(corridor[end] ==
'S') {
1415 unsigned int p_count = 0;
1417 for(
unsigned int i = start + 1; i <= end; i++) {
1418 if(corridor[i] ==
'S') {
1428 }
else if(s_count == 1) {
1430 p.push_back(p_count + 1);
1436 unsigned long long ans = 1;
1437 for(
const auto i: p) {
被这些函数引用 leetcode::number_of_ways_to_divide_a_long_corridor::TEST().
该类的文档由以下文件生成: