Problem 11 of Arrays with Custom Solution