Maximum Count of Positive Integer and Negative Integer | Leetcode 2529 | codestorywithMIK
iPad PDF Link - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/iPad PDF Notes/STLs:JCF Video - 8.pdf
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
Sliding Window Playlist - • Sliding Window : Popular Interview Pr...
Similar Better Version of this problem : • Count of Substrings Containing Every ...
Hi Everyone, this is the 8th video of our Playlist "Solving only using C++ STLs/JAVA JCF".
Now we will be solving a very easy problem - Maximum Count of Positive Integer and Negative Integer | Learn Something New | Leetcode 2529 | codestorywithMIK
Since this is a very easy problem, I have explained how to do it using STLs/JCF only. We will learn a lot of things from this video.
Problem Name : Maximum Count of Positive Integer and Negative Integer | Learn Something New | Leetcode 2529 | codestorywithMIK
Company Tags : will update later
My solutions on Github(C++ & JAVA) : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/Arrays/Leetcode Easy/Maximum Count of Positive Integer and Negative Integer.cpp
Leetcode Link : https://leetcode.com/problems/maximum-count-of-positive-integer-and-negative-integer
My DP Concepts Playlist : • Roadmap for DP | How to Start DP ? | ...
My Graph Concepts Playlist : • Graph Concepts & Qns - 1 : Graph will...
My Segment Tree Concepts Playlist : • Segment Tree | Introduction | Basics ...
My Recursion Concepts Playlist : • Introduction | Recursion Concepts And...
Trie Playlist - • Word Search II (Google, Amazon, Meta,...
Difference Array Technique: Concepts & Qns : • Introduction | What | How | Differenc...
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 :
Approach 1 (Using STL count_if)
This approach counts positive and negative numbers separately using the count_if function with lambda expressions. It then returns the maximum of the two counts, ensuring we find the dominant sign in the array.
Approach 2 (Using lower_bound)
This approach leverages binary search to find the first occurrence of 1 (for positives) and 0 (for non-negatives). Using these indices, it determines the count of positive and negative numbers efficiently and returns the maximum of the two.
✨ Timelines✨
00:00 - Introduction
0:18 - Motivation
0:40 - Problem Explanation
1:34 - C++ count_if()
5:14 - JAVA stream and filters
12:49 - Coding C++ & Java using count
16:29 - Follow Up using Binary Search
18:19 - C++ lowerbound
23:15 - Java apnaLowerBound
27:03 - Coding C++ Java follow 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