← All problemsSign in

3751. Total Waviness of Numbers in Range I

LeetCodeMathDynamic ProgrammingEnumerationOpen on judge ↗

You are given two integers num1 and num2 representing an inclusive range [num1, num2]. The waviness of a number is defined as the total count of its peaks and valleys: - A digit is a peak if it is strictly greater than both of its immediate neighbors. - A digit is a valley if it is strictly less than both of its immediate neighbors. - The first and last digits of a number cannot be peaks or va

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start