Solving Sqrt(x) with Binary Search on LeetCode

Day 39 | LeetCode Learning Journal 🚀 Today I solved Sqrt(x) using Binary Search. This problem helped me understand how searching techniques can be applied beyond arrays to mathematical problems! 🔑 Key Points: • Find the integer square root of a number. • Avoid using built-in sqrt functions. • Applied Binary Search to reduce time complexity. • Stored the last valid answer (floor value). 🌱 What I Learned: • How Binary Search can be used on answer space. • Importance of avoiding overflow using long long. • Efficient way to handle large inputs. • Strengthened problem-solving with math + logic. #LeetCode #100DaysOfCode #DSA #CodingJourney #Day39 🚀

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories