Added code for new task - class DynamicArray