problemscpp
A collection of my answers to algorithm problems in c++.
| 函数
leetcode::sliding_window_maximum 命名空间参考

  1. 滑动窗口最大值
更多...

class  Solution
 

函数

 TEST (sliding_window_maximum, case1)
 
 TEST (sliding_window_maximum, case2)
 

详细描述

  1. 滑动窗口最大值

函数说明

◆ TEST() [1/2]

leetcode::sliding_window_maximum::TEST ( sliding_window_maximum  ,
case1   
)

在文件 leetcode_test.cpp3668 行定义.

3668 {
3669 vector nums = {1, 3, -1, -3, 5, 3, 6, 7};
3670 const vector ans = {3, 3, 5, 5, 6, 7};
3671 ASSERT_EQ(ans, Solution::maxSlidingWindow(nums, 3));
3672 }

引用了 leetcode::sliding_window_maximum::Solution::maxSlidingWindow().

◆ TEST() [2/2]

leetcode::sliding_window_maximum::TEST ( sliding_window_maximum  ,
case2   
)

在文件 leetcode_test.cpp3674 行定义.

3674 {
3675 vector nums = {1};
3676 const vector ans = {1};
3677 ASSERT_EQ(ans, Solution::maxSlidingWindow(nums, 1));
3678 }

引用了 leetcode::sliding_window_maximum::Solution::maxSlidingWindow().