generate int[] peak(with bugs)