Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1137. N-th Tribonacci Number #23

Open
F4NT0 opened this issue Apr 24, 2024 · 0 comments
Open

1137. N-th Tribonacci Number #23

F4NT0 opened this issue Apr 24, 2024 · 0 comments
Assignees
Labels
Easy Easy Questions Ready to code Description from the Question was updated with code and text

Comments

@F4NT0
Copy link
Owner

F4NT0 commented Apr 24, 2024

The Tribonacci sequence T_n is defined as follows:

T_0 = 0, T_1 = 1, T_2 = 1, and T_(n+3) = T_n + T_(n+1) + T_(n+2) for n >= 0.

Given n, return the value of T_n.

Example 1:

  • Input: n = 4
  • Output: 4
  • Explanation:
    • T_3 = 0 + 1 + 1 = 2
      - T_4 = 1 + 1 + 2 = 4

Example 2:

  • Input: n = 25
  • Output: 1389537

Constraints:

  • 0 <= n <= 37
  • The answer is guaranteed to fit within a 32-bit integer, ie. answer <= 2^31 - 1.
@F4NT0 F4NT0 added the Easy Easy Questions label Apr 24, 2024
@F4NT0 F4NT0 added this to the April Leetcode milestone Apr 24, 2024
@F4NT0 F4NT0 self-assigned this Apr 24, 2024
@F4NT0 F4NT0 added the Ready to code Description from the Question was updated with code and text label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Easy Questions Ready to code Description from the Question was updated with code and text
Projects
None yet
Development

No branches or pull requests

1 participant