Skip to content

Commit 6031776

Browse files
committed
Create README - LeetHub
1 parent 54ec984 commit 6031776

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

fizz-buzz/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<h2>412. Fizz Buzz</h2><h3>Easy</h3><hr><div><p>Given an integer <code>n</code>, return <em>a string array</em> <code>answer</code> (<strong>1-indexed</strong>) <em>where</em>:</p>
2+
3+
<ul>
4+
<li><code>answer[i] == "FizzBuzz"</code> if <code>i</code> is divisible by <code>3</code> and <code>5</code>.</li>
5+
<li><code>answer[i] == "Fizz"</code> if <code>i</code> is divisible by <code>3</code>.</li>
6+
<li><code>answer[i] == "Buzz"</code> if <code>i</code> is divisible by <code>5</code>.</li>
7+
<li><code>answer[i] == i</code> if non of the above conditions are true.</li>
8+
</ul>
9+
10+
<p>&nbsp;</p>
11+
<p><strong>Example 1:</strong></p>
12+
<pre><strong>Input:</strong> n = 3
13+
<strong>Output:</strong> ["1","2","Fizz"]
14+
</pre><p><strong>Example 2:</strong></p>
15+
<pre><strong>Input:</strong> n = 5
16+
<strong>Output:</strong> ["1","2","Fizz","4","Buzz"]
17+
</pre><p><strong>Example 3:</strong></p>
18+
<pre><strong>Input:</strong> n = 15
19+
<strong>Output:</strong> ["1","2","Fizz","4","Buzz","Fizz","7","8","Fizz","Buzz","11","Fizz","13","14","FizzBuzz"]
20+
</pre>
21+
<p>&nbsp;</p>
22+
<p><strong>Constraints:</strong></p>
23+
24+
<ul>
25+
<li><code>1 &lt;= n &lt;= 10<sup>4</sup></code></li>
26+
</ul>
27+
</div>

0 commit comments

Comments
 (0)