Array Mathematics Hackerrank Solution For Dynamic Array