Single non-repeating element in an array (LeetCode 136) | Full solution with Examples

Описание к видео Single non-repeating element in an array (LeetCode 136) | Full solution with Examples

Single Number is a programming challenge on LeetCode. You are given an array of all positive integers. All the integers are repeated exactly twice except one. We need to find that number with a linear time complexity and using the minimum space possible. Watch the video to understand the problem in a simplified manner. I then work along with you to solve it first using a Brute Force approach, and then an efficient approach. All along with visuals and explanations.

00:00 - Intro
00:27 - Problem Statement and Test Case
01:26 - Method 1 (Brute Force)
03:17 - Method 2 (Using Map)
04:46 - Method 3 (Using XOR)
07:15 - Dry-run of code

📚 Links I talk about in the video:
Actual problem on LeetCode: https://leetcode.com/problems/single-...
Code on Github: https://github.com/nikoo28/java-solut...
Test cases on GitHub: https://github.com/nikoo28/java-solut...

📘 A text based explanation is available at: https://studyalgorithms.com/array/sin...

Further Reading:
Some low-level bit hacks you must know: https://studyalgorithms.com/theory/lo...

To see more videos like this, you can show your support on https://www.buymeacoffee.com/studyalg...

💻 Get Social 💻
Follow on Facebook at:   / studyalgos  
Follow on Twitter at:   / studyalgorithms  
Follow on Tumblr at:   / studyalgos  
Subscribe to RSS feeds: https://studyalgorithms.com/feed/

#leetcode #programming #tutorial

Комментарии

Информация по комментариям в разработке