Variable Sized Arrays Hackerrank Solution