- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Square Root | Leetcode 69(C++) | Binary Search & Numbers
🚀 LeetCode 69 — Sqrt(x) | C++ Solution Explained
In this video, we solve LeetCode Problem 69 – Sqrt(x) in a simple and beginner-friendly way using C++.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 TOPICS COVERED
✅ Binary Search
✅ Math
✅ Searching Algorithms
✅ Integer Manipulation
✅ Optimization Techniques
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 PROBLEM OVERVIEW
Given a non-negative integer x, return the square root of x rounded down to the nearest integer.
👉 You must not use any built-in exponent function or operator.
Example:
Input:
C++
x = 8
Output:
C++
2
Explanation: The square root of 8 is 2.828..., so return 2.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛠️ APPROACH COVERED
✅ Use Binary Search on the range [1, x]
✅ Find the middle value
✅ Compare mid * mid with x
✅ Store the possible answer and continue searching
Method → Binary Search
Language → C++
Time → O(log x)
Space → O(1)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT YOU WILL LEARN
✔ Binary search fundamentals
✔ Efficient searching techniques
✔ Avoiding overflow using long long
✔ Writing optimized mathematical logic
✔ Time & space complexity analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Видео Square Root | Leetcode 69(C++) | Binary Search & Numbers канала Anisha Chhajer
In this video, we solve LeetCode Problem 69 – Sqrt(x) in a simple and beginner-friendly way using C++.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 TOPICS COVERED
✅ Binary Search
✅ Math
✅ Searching Algorithms
✅ Integer Manipulation
✅ Optimization Techniques
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 PROBLEM OVERVIEW
Given a non-negative integer x, return the square root of x rounded down to the nearest integer.
👉 You must not use any built-in exponent function or operator.
Example:
Input:
C++
x = 8
Output:
C++
2
Explanation: The square root of 8 is 2.828..., so return 2.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛠️ APPROACH COVERED
✅ Use Binary Search on the range [1, x]
✅ Find the middle value
✅ Compare mid * mid with x
✅ Store the possible answer and continue searching
Method → Binary Search
Language → C++
Time → O(log x)
Space → O(1)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT YOU WILL LEARN
✔ Binary search fundamentals
✔ Efficient searching techniques
✔ Avoiding overflow using long long
✔ Writing optimized mathematical logic
✔ Time & space complexity analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Видео Square Root | Leetcode 69(C++) | Binary Search & Numbers канала Anisha Chhajer
Комментарии отсутствуют
Информация о видео
8 ч. 46 мин. назад
00:02:47
Другие видео канала




















