I am stuck with one problem , please anyone help me to do this . The question is

Write a function to modify a list ( *one dimensional array* ) of numbers such that every number is replaced by the average of its immediate neighbours ( *the value just above and just below* ). Include appropriate special steps for the first and last elements .