An undulating number is a number where the digits alternately increase and decrease. More formally, a number is considered undulating if, for every pair of adjacent digits in the number, either the left digit is greater than the right digit or the left digit is less than the right digit, with no two adjacent digits being equal.
New to topics? Read the docs here!