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

  1. Product of Array Except Self
更多...

class  Solution
 

函数

 TEST (product_of_array_except_self, case1)
 
 TEST (product_of_array_except_self, case2)
 

详细描述

  1. Product of Array Except Self

函数说明

◆ TEST() [1/2]

leetcode::product_of_array_except_self::TEST ( product_of_array_except_self  ,
case1   
)

在文件 leetcode_test.cpp3387 行定义.

3387 {
3388 vector nums = {1, 2, 3, 4};
3389 const vector output = {24, 12, 8, 6};
3390 ASSERT_EQ(output, Solution::productExceptSelf(nums));
3391 }

引用了 leetcode::product_of_array_except_self::Solution::productExceptSelf().

◆ TEST() [2/2]

leetcode::product_of_array_except_self::TEST ( product_of_array_except_self  ,
case2   
)

在文件 leetcode_test.cpp3393 行定义.

3393 {
3394 vector nums = {-1, 1, 0, -3, 3};
3395 const vector output = {0, 0, 9, 0, 0};
3396 ASSERT_EQ(output, Solution::productExceptSelf(nums));
3397 }

引用了 leetcode::product_of_array_except_self::Solution::productExceptSelf().