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 #220

Open
mah-shamim opened this issue Aug 1, 2024 Discussed in #219 · 0 comments
Open

1137. N-th Tribonacci Number #220

mah-shamim opened this issue Aug 1, 2024 Discussed in #219 · 0 comments
Labels
easy Difficulty hacktoberfest-accepted hacktoberfest accepted question Further information is requested

Comments

@mah-shamim
Copy link
Owner

Discussed in #219

Originally posted by mah-shamim August 2, 2024
The Tribonacci sequence Tn is defined as follows:

T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >= 0.

Given n, return the value of Tn.

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, i.e. answer <= 2^31 - 1.
@mah-shamim mah-shamim added question Further information is requested easy Difficulty labels Aug 1, 2024
@mah-shamim mah-shamim added the hacktoberfest-accepted hacktoberfest accepted label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Difficulty hacktoberfest-accepted hacktoberfest accepted question Further information is requested
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant