Total Waviness of Numbers in Range I

Solution Code
Video GuideLeetcode Daily

Time Complexity

O(N L)

Space Complexity

O(L)