Problem 14 solve + add confirmation function