Bitwise ORs of Subarrays | Detailed Explanation | Why Linear Time | Leetcode 898 | codestorywithMIK

Subscribers:
112,000
Published on ● Video Link: https://www.youtube.com/watch?v=Jlj4LUJhQJY



Duration: 0:00
10,446 views
566


Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A

Hi Everyone, this is the 21st video of our Playlist "Bit Manipulation : Popular Interview Problems".
Now we will be solving a good hashset and bit-magic related problem - Bitwise ORs of Subarrays | Detailed Explanation | Why Linear Time | Leetcode 898 | codestorywithMIK

I will explain it in full detail so that it becomes easy to understand. Each line will be explained and you will know the WHY behind everything.

Problem Name : Bitwise ORs of Subarrays | Detailed Explanation | Why Linear Time | Leetcode 898 | codestorywithMIK
Company Tags : will update later
Code Github(C++ & JAVA) - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/HashSet/Bitwise ORs of Subarrays.cpp
Leetcode Link - https://leetcode.com/problems/bitwise-ors-of-subarrays


My DP Concepts Playlist :    • Roadmap for DP | How to Start DP ? | Topic...  
My Graph Concepts Playlist :    • Graph Concepts & Qns - 1 : Graph will no m...  
My Segment Tree Concepts Playlist :    • Segment Tree | Introduction | Basics | Bui...  
My Recursion Concepts Playlist :    • Introduction | Recursion Concepts And Ques...  
Trie Playlist -    • Word Search II (Google, Amazon, Meta, Micr...  
Difference Array Technique: Concepts & Qns :    • Introduction | What | How | Difference Arr...  
Monotonic Data Structure Concepts & Qns :    • Monotonic Data Structures Concepts & Qns  
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Interview_DS_Algo
Instagram : https://www.instagram.com/codestorywithmik/
Facebook : https://www.facebook.com/people/codestorywithmik/100090524295846/
Twitter : https://twitter.com/CSwithMIK
Subscribe to my channel :    / @codestorywithmik  

╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝


Video Summary :
The approach involves iterating through each element of the input array and calculating the unique bitwise OR results of all possible subarrays. For each element, the algorithm maintains two sets: one for the results from the previous iteration (prev) and another for the current calculations (curr). By applying the bitwise OR operation on elements from prev with the current element and adding both the current element and the results to a global set (result), the algorithm ensures that all unique results are captured. Ultimately, the size of the result set, which represents the count of unique bitwise OR results, is returned.


00:00 - Introduction
0:16 - Motivation
0:45 - Problem Explanation
4:30 - Thought Process - Brute Force
5:00 - Improving Approach
12:38 - Why time complexity is linear O(n*32)
24:05 - Coding it up



#MIK #mik #Mik
#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #coding #programming #100daysofcode #developers #techjobs #datastructures #algorithms #webdevelopment #softwareengineering #computerscience #pythoncoding #codinglife #coderlife #javascript #datascience #leetcode #leetcodesolutions #leetcodedailychallenge #codinginterview #interviewprep #technicalinterview #interviewtips #interviewquestions #codingchallenges #interviewready #dsa #hindi #india #hindicoding #hindiprogramming #hindiexplanation #hindidevelopers #hinditech #hindilearning #helpajobseeker #jobseekers #jobsearchtips #careergoals #careerdevelopment #jobhunt #jobinterview #github #designthinking #learningtogether #growthmindset #digitalcontent #techcontent #socialmediagrowth #contentcreation #instagramreels #videomarketing #codestorywithmik #codestorywithmick #codestorywithmikc #codestorywitmik #codestorywthmik #codstorywithmik #codestorywihmik #codestorywithmiik #codeistorywithmik #codestorywithmk #codestorywitmick #codestorymik #codestorwithmik




Other Videos By codestorywithMIK


2025-08-10Reordered Power of 2 | 4 APPROACHES | Leetcode 869 | codestorywithMIK
2025-08-08Unboxing My YouTube Silver Play Button | 100K Special Video | My Message To The Community | MIK
2025-08-08Work hard for them | codestorywithMIK
2025-08-07100K Special Video Coming Soon | codestorywithMIK
2025-08-07Find the Maximum Number of Fruits Collected | Recursion | Bottom Up | Leetcode 3363 | DP On Grids
2025-08-05Fruits Into Baskets II & III | Segment Tree Concepts & Qns | Video 13 | Leetcode 3477 | 3479 | MIK
2025-08-04Fruit Into Baskets | Simple Observation | Leetcode 904 | codestorywithMIK
2025-08-03Happy Friendship Day To All ❤️ | codestorywithMIK
2025-08-03Maximum Fruits Harvested After at Most K Steps | Detailed Explanation | Leetcode 2106 | MIK
2025-08-02Rearranging Fruits | Detailed Explanation | Minute Details | Leetcode 2561 | codestorywithMIK
2025-07-30Bitwise ORs of Subarrays | Detailed Explanation | Why Linear Time | Leetcode 898 | codestorywithMIK
2025-07-29Smallest Subarrays With Maximum Bitwise OR | Detailed Explanation | Leetcode 2411 | codestorywithMIK
2025-07-27Remembering where it all started from | codestorywithMIK
2025-07-26Count Hills and Valleys in an Array | Simple Explanation | Leetcode 2210 | codestorywithMIK
2025-07-26Maximize Subarrays After Removing One Conflicting Pair | Detailed Explanation | Leetcode 3480 | MIK
2025-07-24Maximum Unique Subarray Sum After Deletion | Constant Space | Leetcode 3487 | codestorywithMIK
2025-07-24Minimum Score After Removals on a Tree | Detailed Explanation | Leetcode 2322 | codestorywithMIK
2025-07-22Are bhai 🥺 | codestorywithMIK
2025-07-22Ever heard of Recursion Leap Of Faith | codestorywithMIK
2025-07-22That feeling ❤️🙏 | codestorywithMIK
2025-07-22Maximum Erasure Value | 2 Approaches | Leetcode 1695 | codestorywithMIK