Skip to content

Commit 1ac9ea5

Browse files
committed
Create README - LeetHub
1 parent 6e076f9 commit 1ac9ea5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

0069-sqrtx/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/sqrtx">69. Sqrt(x)</a></h2><h3>Easy</h3><hr><p>Given a non-negative integer <code>x</code>, return <em>the square root of </em><code>x</code><em> rounded down to the nearest integer</em>. The returned integer should be <strong>non-negative</strong> as well.</p>
2+
3+
<p>You <strong>must not use</strong> any built-in exponent function or operator.</p>
4+
5+
<ul>
6+
<li>For example, do not use <code>pow(x, 0.5)</code> in c++ or <code>x ** 0.5</code> in python.</li>
7+
</ul>
8+
9+
<p>&nbsp;</p>
10+
<p><strong class="example">Example 1:</strong></p>
11+
12+
<pre>
13+
<strong>Input:</strong> x = 4
14+
<strong>Output:</strong> 2
15+
<strong>Explanation:</strong> The square root of 4 is 2, so we return 2.
16+
</pre>
17+
18+
<p><strong class="example">Example 2:</strong></p>
19+
20+
<pre>
21+
<strong>Input:</strong> x = 8
22+
<strong>Output:</strong> 2
23+
<strong>Explanation:</strong> The square root of 8 is 2.82842..., and since we round it down to the nearest integer, 2 is returned.
24+
</pre>
25+
26+
<p>&nbsp;</p>
27+
<p><strong>Constraints:</strong></p>
28+
29+
<ul>
30+
<li><code>0 &lt;= x &lt;= 2<sup>31</sup> - 1</code></li>
31+
</ul>

0 commit comments

Comments
 (0)