adding array exercise

array exercise with automatic array resize