nnhp: Problem 18: slice implementation