How to solve the problem of frog jumping steps by leetcode
This article introduces the relevant knowledge of "how to solve the problem of frog jumping steps by leetcode". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
A frog can jump up one or two steps at a time. Find out how many ways the frog can jump on an n-step step.
The answer needs to be modular 1e9+7 (1000000007). If the initial result is 1000000008, please return 1.
Example 1:
Input: n = 2
Output: 2
Example 2:
Input: n = 7
Output: 21
Tip:
0