Skip to content

Commit 61b22a7

Browse files
authored
clean up readme.md
1 parent 9ee2bd4 commit 61b22a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sqrt(x)/readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ For this problem, I approached it by identifying the range in which the square r
3131

3232
## Time and Space Complexity
3333

34-
The time complexity of the initial solution, where you're incrementing i one by one until i * i exceeds x, is indeed O(√x). This is because you're essentially searching for the square root by trying each integer value up to the square root of x.
35-
The space complexity is O(1) since you're only using a constant amount of extra space (the variable i).
34+
The time complexity of the initial solution, where you're incrementing **i** one by one until **i * i** exceeds **x**, is indeed **O(√x)**. This is because you're essentially searching for the square root by trying each integer value up to the square root of **x**.
35+
The space complexity is **O(1)** since you're only using a constant amount of extra space (the variable **i**).
3636
However, the time complexity can be improved by using a more efficient method ... (coming soon)
3737

3838
🌟Thinking in this way is also useful for live coding practice. Because you're often asked how else it could be written.

0 commit comments

Comments
 (0)