AmArg& AmArg::get(size_t idx) { assertArray(); if (idx >= v_array->size()) throw OutOfBoundsException(); return (*v_array)[idx]; }
TEST(removeIITest, Positive01){ Solution s; int arr[] = {1, 1, 2, 3, 3, 3, 4, 5, 5, 5, 6}; const int n = sizeof(arr) / sizeof(int); int expected[] = {1, 1, 2, 3, 3, 4, 5, 5, 6}; int resultLength = s.removeII(arr, n); assertArray(expected, resultLength, arr); }
void AmArg::push(const AmArg& a) { assertArray(); v_array->push_back(a); }
const size_t AmArg::size() const { assertArray(); return v_array->size(); }
AmArg& AmArg::operator[](size_t idx) { assertArray(idx+1); return (*v_array)[idx]; }