Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to solve the problem of frog jumping steps by leetcode

Shulou Source: shulou.com Published: 2022-06-01 13:08:51 09月26日 Update

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

Tags: Steps sequences recursion numbers problems frogs space complexity complexity arrays dynamics principles situations planning output differences two code content variables Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi vpn MariaDB macOS Apple