Skip to content

Commit 0275866

Browse files
committed
Added README.md file for N-th Tribonacci Number
1 parent a6d5c71 commit 0275866

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

1236-n-th-tribonacci-number/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<h2><a href="https://leetcode.com/problems/n-th-tribonacci-number">N-th Tribonacci Number</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>The Tribonacci sequence T<sub>n</sub> is defined as follows:&nbsp;</p>
2+
3+
<p>T<sub>0</sub> = 0, T<sub>1</sub> = 1, T<sub>2</sub> = 1, and T<sub>n+3</sub> = T<sub>n</sub> + T<sub>n+1</sub> + T<sub>n+2</sub> for n &gt;= 0.</p>
4+
5+
<p>Given <code>n</code>, return the value of T<sub>n</sub>.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
10+
<pre>
11+
<strong>Input:</strong> n = 4
12+
<strong>Output:</strong> 4
13+
<strong>Explanation:</strong>
14+
T_3 = 0 + 1 + 1 = 2
15+
T_4 = 1 + 1 + 2 = 4
16+
</pre>
17+
18+
<p><strong class="example">Example 2:</strong></p>
19+
20+
<pre>
21+
<strong>Input:</strong> n = 25
22+
<strong>Output:</strong> 1389537
23+
</pre>
24+
25+
<p>&nbsp;</p>
26+
<p><strong>Constraints:</strong></p>
27+
28+
<ul>
29+
<li><code>0 &lt;= n &lt;= 37</code></li>
30+
<li>The answer is guaranteed to fit within a 32-bit integer, ie. <code>answer &lt;= 2^31 - 1</code>.</li>
31+
</ul>

0 commit comments

Comments
 (0)