Example #1
0
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);
}
Example #3
0
void AmArg::push(const AmArg& a) {
  assertArray();
  v_array->push_back(a);
}
Example #4
0
const size_t AmArg::size() const {
  assertArray();  
  return v_array->size(); 
}
Example #5
0
AmArg& AmArg::operator[](size_t idx) { 
  assertArray(idx+1); 
  return (*v_array)[idx];
}