problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
leetcode::count_the_hidden_sequences::Solution类 参考

#include <leetcode.h>

静态 Public 成员函数

static int numberOfArrays (vector< int > &differences, int lower, int upper)
 

详细描述

在文件 leetcode.h599 行定义.

成员函数说明

◆ numberOfArrays()

int leetcode::count_the_hidden_sequences::Solution::numberOfArrays ( vector< int > &  differences,
int  lower,
int  upper 
)
static

在文件 leetcode.cpp1324 行定义.

1324 {
1325 long long current = 0;
1326 long long maximum = 0;
1327 long long minimum = 0;
1328 for(const auto difference: differences) {
1329 current += difference;
1330 maximum = max(maximum, current);
1331 minimum = min(minimum, current);
1332 }
1333 return max(static_cast<long long>(0), upper - lower - (maximum - minimum) + 1);
1334 }

被这些函数引用 leetcode::count_the_hidden_sequences::TEST().


该类的文档由以下文件生成: