Загрузка страницы

Duplicate number in an immutable array | Floyd cycle detection algo | Leetcode #287

This video explains an important programming interview problem which is to find the duplicate element in an immutable array where the duplicate element can repeat more than twice and all other elements are unique.The array is of size (N+1) having maximum of N unique elements ranging from 1 to N.The constraint is that the array is READ-ONLY, which means we cannot modify the array.We are also required to solve this problem in just O(N) time and using O(1) extra space.I have shown 2 very effective solutions for this problem with required TIME & SPACE.The first method is very simple but works only when array is mutable.The second method works for both mutable and immutable array.I have shown both the algorithms using proper examples.At the end of the video, i have also shown the code walk through.

CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)

=================================================================
INSTAGRAM: https://www.instagram.com/surya.pratap.k/
LinkedIn: https://www.linkedin.com/in/surya-pratap-kahar-47bb01168
WEBSITE: https://techdose.co.in/
=================================================================

CODE LINK: https://gist.github.com/SuryaPratapK/ed85514504753801d68c75e7f44797a0

Видео Duplicate number in an immutable array | Floyd cycle detection algo | Leetcode #287 канала TECH DOSE
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
26 июня 2020 г. 3:12:43
00:19:18
Яндекс.Метрика