Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
LC 136 β€” Single Number (XOR Trick)
Play lesson

LeetCode 75 C++ | Step-by-Step Solutions (LAN Academy) - LC 136 β€” Single Number (XOR Trick)

4.0 (1)
12 learners

What you'll learn

This course includes

  • 5.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

LeetCode 136 β€” Single Number (C++): The XOR Trick (O(n) / O(1)) If every number appears twice… how do you find the one that doesn’t β€” in linear time and constant space? This video shows the clean XOR pattern interviewers expect for LeetCode 136: Single Number. What you’ll learn: β€’ The XOR properties that cancel pairs instantly β€’ Why it works for any integers (including negatives) β€’ A clean, minimal C++ implementation β€’ Complexity + edge cases Key idea (XOR): a ^ a = 0 a ^ 0 = a So XOR-ing all values cancels duplicates and leaves the unique number. Complexity: Time: O(n) Extra space: O(1) Watch next (Bit Manipulation playlist): https://www.youtube.com/playlist?list=PLF0G-7pZcOza_jyAxwMpa5KnK3vST5smK Subscribe for more clear C++ LeetCode explanations: youtube.com/channel/UCdKpV0t_sLv9gUsxHOYrt7g?sub_confirmation=1 Video: https://youtu.be/ZTxFzZOQcrA #LeetCode #BitManipulation #XOR #CodingInterview #CPlusPlus #leetcodecoding #leetcodesolution #leetcodechallenge #faang #fang #computerscience #cs #codingtiktok #coding #codinglife #boostofhope #fyp #codinginterview #softwareengineer #swe #tech #foryou #python #learntocode #google #techtok #programming #algorithms #learntocode @reper #foryou #viral #reper #urmaritori #for

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

FAQs

Course Hive
Download CourseHive
Keep learning anywhere