Problem 13 of Array with custom Solution