---
title: "Discussion on \"LeetCode: Find Sqrt(x)\" | Hashnode"
description: "Discussion on \"LeetCode: Find Sqrt(x)\". Problem:\nhttps://leetcode.com/problems/sqrtx/description/\nCode:\nclass Solution:\n    def mySqrt(self, x: int) -> int:\n        if x <= 1:\n            return x\n\n        low, high = 1, x // 2\n        while low <= high:\n            mid = (low + high) // 2..."
url: "https://hashnode.com/posts/leetcode-find-sqrtx/6940ee4cfd6ae8252541938e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [LeetCode: Find Sqrt(x)](https://is-power-of-two.hashnode.dev/leetcode-find-sqrtx?utm_source=hashnode&utm_medium=feed)

Problem: https://leetcode.com/problems/sqrtx/description/ Code: class Solution: def mySqrt(self, x: int) -> int: if x <= 1: return x low, high = 1, x // 2 while low <= high: mid = (low + high) // 2...

Dec 16, 2025 · 2 min read · is-power-of-two.hashnode.dev  
Read the article

-   [#leetcode](https://hashnode.com/tag/leetcode)
-   [#binary-search-algorithm](https://hashnode.com/tag/binary-search-algorithm)
-   [#square-root](https://hashnode.com/tag/square-root)

## Written by

[Shahwar Alam Naqvi](https://hashnode.com/@shahwar01)

@shahwar01

  
[View profile](https://hashnode.com/@shahwar01)

Coder

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
