Skip to content

Latest commit

 

History

History
15 lines (8 loc) · 443 Bytes

File metadata and controls

15 lines (8 loc) · 443 Bytes

Shift Array

Insert a value into the center of an array.

Challenge Description

Write a function called insertShiftArray which takes in an array and the value to be added. Without utilizing any of the built-in methods available to your language, return an array with the new value added at the middle index.

Approach & Efficiency

The length of the array affects the time and space 1 to 1.

Solution

  • !()[assets/ShiftArray.png]