-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d25765
commit 3ef8224
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<h2><a href="https://leetcode.com/problems/fizz-buzz/">412. Fizz Buzz</a></h2><h3>Easy</h3><hr><div><p>Given an integer <code>n</code>, return <em>a string array </em><code>answer</code><em> (<strong>1-indexed</strong>) where</em>:</p> | ||
|
||
<ul> | ||
<li><code>answer[i] == "FizzBuzz"</code> if <code>i</code> is divisible by <code>3</code> and <code>5</code>.</li> | ||
<li><code>answer[i] == "Fizz"</code> if <code>i</code> is divisible by <code>3</code>.</li> | ||
<li><code>answer[i] == "Buzz"</code> if <code>i</code> is divisible by <code>5</code>.</li> | ||
<li><code>answer[i] == i</code> (as a string) if none of the above conditions are true.</li> | ||
</ul> | ||
|
||
<p> </p> | ||
<p><strong class="example">Example 1:</strong></p> | ||
<pre><strong>Input:</strong> n = 3 | ||
<strong>Output:</strong> ["1","2","Fizz"] | ||
</pre><p><strong class="example">Example 2:</strong></p> | ||
<pre><strong>Input:</strong> n = 5 | ||
<strong>Output:</strong> ["1","2","Fizz","4","Buzz"] | ||
</pre><p><strong class="example">Example 3:</strong></p> | ||
<pre><strong>Input:</strong> n = 15 | ||
<strong>Output:</strong> ["1","2","Fizz","4","Buzz","Fizz","7","8","Fizz","Buzz","11","Fizz","13","14","FizzBuzz"] | ||
</pre> | ||
<p> </p> | ||
<p><strong>Constraints:</strong></p> | ||
|
||
<ul> | ||
<li><code>1 <= n <= 10<sup>4</sup></code></li> | ||
</ul> | ||
</div> |