Question: remove _ at _ index ( self , index: int ) - > None: This method removes the element at the specified index in the
removeatindexself index: int None:
This method removes the element at the specified index in the dynamic array. Index
refers to the beginning of the array. If the provided index is invalid, this method must
raise a custom DynamicArrayException If the array contains N elements, valid
indices for this method are N inclusive.
When the number of elements stored in the array before removal is STRICTLY LESS THAN
of its current capacity, the capacity must be reduced to TWICE the number of current
elements. This check and capacity adjustment must occur BEFORE removal of the element.
If the current capacity before reduction is elements or less, reduction should not occur
at all. If the current capacity before reduction is greater than elements, the reduced
capacity cannot become less than elements. Please see the examples below, especially
example # for clarification.
Future assignments will depend on this method being able to run in O best case
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
