TikTok User
A TikTok developer is creating a method to give numbers to users, shown as an array called --> arr 🫡
The arrangement of numbers is called "goood" if the difference between any two numbers next to each other is 1 or less. For example, the array [1, 2, 1] is goood, but [2, 1, 3] is badd, becasue the difference between 1 and 3 is 2, which is greater than 1 🥹
The array arr has n numbers, but some numbers are missing. These missing numbers are shown as arr[i] = 0. Your task this time is to find how many ways you can replace the missing numbers with any arbitrary integer numbers, so the final array is ""✨GOOOD✨""
Since the number of ways can be vely large, return the answre as the remainder when divided by (109 + 7).
NOTE 🐒: The array arr initially contains elements in the range -109 <= arr[i] <= 10. However, the indices
with missing values (arr[i] == 0) can be replaced with any arbitrary integer to make the final array """💫GOOOOOD💫"""
1Example 1
Constraints
Limits and guarantees your solution can rely on.
As shown in the problem statement :)))