2022-11-15 07:38:15 +00:00
|
|
|
#include "s0027_remove_element.hpp"
|
|
|
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
TEST(Problem27, Case1) {
|
|
|
|
vector<int> nums{3, 2, 2, 3};
|
|
|
|
int val{3};
|
|
|
|
int o{2};
|
2022-11-30 10:20:36 +00:00
|
|
|
S0027 solution;
|
2022-11-15 07:38:15 +00:00
|
|
|
EXPECT_EQ(solution.removeElement(nums, val), o);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST(Problem27, Case2) {
|
|
|
|
vector<int> nums{0, 1, 2, 2, 3, 0, 4, 2};
|
|
|
|
int val{2};
|
|
|
|
int o{5};
|
2022-11-30 10:20:36 +00:00
|
|
|
S0027 solution;
|
2022-11-15 07:38:15 +00:00
|
|
|
EXPECT_EQ(solution.removeElement(nums, val), o);
|
|
|
|
}
|