Skip to content

Commit 2fbdc63

Browse files
committed
Create README - LeetHub
1 parent 234c570 commit 2fbdc63

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

69-sqrtx/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<h2><a href="https://leetcode.com/problems/sqrtx/">69. Sqrt(x)</a></h2><h3>Easy</h3><hr><div><p>Given a non-negative integer <code>x</code>,&nbsp;compute and return <em>the square root of</em> <code>x</code>.</p>
2+
3+
<p>Since the return type&nbsp;is an integer, the decimal digits are <strong>truncated</strong>, and only <strong>the integer part</strong> of the result&nbsp;is returned.</p>
4+
5+
<p><strong>Note:&nbsp;</strong>You are not allowed to use any built-in exponent function or operator, such as <code>pow(x, 0.5)</code> or&nbsp;<code>x ** 0.5</code>.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong>Example 1:</strong></p>
9+
10+
<pre><strong>Input:</strong> x = 4
11+
<strong>Output:</strong> 2
12+
</pre>
13+
14+
<p><strong>Example 2:</strong></p>
15+
16+
<pre><strong>Input:</strong> x = 8
17+
<strong>Output:</strong> 2
18+
<strong>Explanation:</strong> The square root of 8 is 2.82842..., and since the decimal part is truncated, 2 is returned.</pre>
19+
20+
<p>&nbsp;</p>
21+
<p><strong>Constraints:</strong></p>
22+
23+
<ul>
24+
<li><code>0 &lt;= x &lt;= 2<sup>31</sup> - 1</code></li>
25+
</ul>
26+
</div>

0 commit comments

Comments
 (0)