Sainnhe Park
1de1398897
All checks were successful
continuous-integration/drone/push Build is passing
20 lines
473 B
C++
20 lines
473 B
C++
#include "s0018_4sum.hpp"
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
TEST(Problem18, Case1) {
|
|
vector<int> nums{1, 0, -1, 0, -2, 2};
|
|
int target{0};
|
|
vector<vector<int>> sum{{-2, -1, 1, 2}, {-2, 0, 0, 2}, {-1, 0, 0, 1}};
|
|
Solution solution;
|
|
EXPECT_EQ(solution.fourSum(nums, target), sum);
|
|
}
|
|
|
|
TEST(Problem18, Case2) {
|
|
vector<int> nums{2, 2, 2, 2, 2};
|
|
int target{8};
|
|
vector<vector<int>> sum{{2, 2, 2, 2}};
|
|
Solution solution;
|
|
EXPECT_EQ(solution.fourSum(nums, target), sum);
|
|
}
|