Custom Solution for Problem 1 Array