leetcode/tests/s0018_4sum.cpp

20 lines
473 B
C++
Raw Normal View History

2022-11-04 08:35:55 +00:00
#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);
}