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

#include <leetcode.h>

静态 Public 成员函数

static char slowestKey (vector< int > &releaseTimes, string keysPressed)
 

详细描述

在文件 leetcode.h310 行定义.

成员函数说明

◆ slowestKey()

char leetcode::slowest_key::Solution::slowestKey ( vector< int > &  releaseTimes,
string  keysPressed 
)
static

在文件 leetcode.cpp723 行定义.

723 {
724 int max = releaseTimes[0];
725 int maxi = 0;
726 for(int i = 1; i < releaseTimes.size(); i++) {
727 const int time = releaseTimes[i] - releaseTimes[i - 1];
728 if(max < time) {
729 max = time;
730 maxi = i;
731 } else if(max == time) {
732 if(keysPressed[i] > keysPressed[maxi]) {
733 maxi = i;
734 }
735 }
736 }
737 return keysPressed[maxi];
738 }

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


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