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

LeetCode 747. 至少是其他数字两倍的最大数 更多...

class  Solution
 

函数

 TEST (largest_number_at_least_twice_of_others, case1)
 
 TEST (largest_number_at_least_twice_of_others, case2)
 
 TEST (largest_number_at_least_twice_of_others, case3)
 
 TEST (largest_number_at_least_twice_of_others, case4)
 
 TEST (largest_number_at_least_twice_of_others, case5)
 

详细描述

LeetCode 747. 至少是其他数字两倍的最大数

函数说明

◆ TEST() [1/5]

leetcode::largest_number_at_least_twice_of_others::TEST ( largest_number_at_least_twice_of_others  ,
case1   
)

在文件 leetcode_test.cpp569 行定义.

569 {
570 int input[] = {3, 6, 1, 0};
571 auto vec = vector(begin(input), end(input));
572 ASSERT_EQ(1, Solution::dominantIndex(vec));
573 }
int vec[100010]
Definition: pat.cpp:5095

引用了 leetcode::largest_number_at_least_twice_of_others::Solution::dominantIndex() , 以及 pat::a::a7_2::vec.

◆ TEST() [2/5]

leetcode::largest_number_at_least_twice_of_others::TEST ( largest_number_at_least_twice_of_others  ,
case2   
)

在文件 leetcode_test.cpp575 行定义.

575 {
576 int input[] = {1, 2, 3, 4};
577 auto vec = vector(begin(input), end(input));
578 ASSERT_EQ(-1, Solution::dominantIndex(vec));
579 }

引用了 leetcode::largest_number_at_least_twice_of_others::Solution::dominantIndex() , 以及 pat::a::a7_2::vec.

◆ TEST() [3/5]

leetcode::largest_number_at_least_twice_of_others::TEST ( largest_number_at_least_twice_of_others  ,
case3   
)

在文件 leetcode_test.cpp581 行定义.

581 {
582 int input[] = {1};
583 auto vec = vector(begin(input), end(input));
584 ASSERT_EQ(0, Solution::dominantIndex(vec));
585 }

引用了 leetcode::largest_number_at_least_twice_of_others::Solution::dominantIndex() , 以及 pat::a::a7_2::vec.

◆ TEST() [4/5]

leetcode::largest_number_at_least_twice_of_others::TEST ( largest_number_at_least_twice_of_others  ,
case4   
)

在文件 leetcode_test.cpp587 行定义.

587 {
588 int input[] = {0, 0, 0, 1};
589 auto vec = vector(begin(input), end(input));
590 ASSERT_EQ(3, Solution::dominantIndex(vec));
591 }

引用了 leetcode::largest_number_at_least_twice_of_others::Solution::dominantIndex() , 以及 pat::a::a7_2::vec.

◆ TEST() [5/5]

leetcode::largest_number_at_least_twice_of_others::TEST ( largest_number_at_least_twice_of_others  ,
case5   
)

在文件 leetcode_test.cpp593 行定义.

593 {
594 int input[] = {0, 0, 3, 2};
595 auto vec = vector(begin(input), end(input));
596 ASSERT_EQ(-1, Solution::dominantIndex(vec));
597 }

引用了 leetcode::largest_number_at_least_twice_of_others::Solution::dominantIndex() , 以及 pat::a::a7_2::vec.