Kth Missing Positive Number || Binary Search || 2-Pointers || Leetcode-1539
VloĆŸit
- Äas pĆidĂĄn 4. 03. 2023
- In this video, I'll talk about how to solve the problem - Kth Missing Positive Number - here we solve this by || 2-Pointers || Binary Search Algorithm.
Let's Connect:
đLinkedin: / aryan-mittal-0077
đž Instagram: / aryan_mittal_007
đ±Telegram : t.me/aryan_mittal_group
Resources you can try:
Learn Coding: âą Complete RoadMap for C...
đ„Channel Playlists
Dynamic Programming: âą Complete Dynamic Progr...
Bit Manipulation: âą Complete BIT MANIPULAT...
Mathematics for DSA: âą Complete Mathematics f...
Leetcode Top Interview Questions: âą FAANG & Leetcode Inter...
Codeforces Problem B Ladder: âą Complete PROBLEM B LAD...
Codeforces Problem C Ladder: âą Codeforces PROBLEM C L...
Codeforces Problem D Ladder: âą Complete PROBLEM D LAD...
About Channel:
We teach about how you can grow in life & educate about programming in Fun way.
About Me:
I am Aryan Mittal - a Software Engineer, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
âš Tags âš
âš Hashtags âš
#skills #college #studentslife #students #teenager #life #teenagers #makemoney #students
Code: leetcode.com/problems/kth-missing-positive-number/solutions/3262503/white-board-solution-binary-search-2-pointers-video-solution-intution/?orderBy=most_votes
great explianation
Not working with testcase k =1 and array {32,59,77} ans should be 33 according to gfg.
Thank you sir
THANKS BROOOOOOOOOOOOOOOOOOOO
What if k > last element of arr?
why there is l+k at the last, and why not r+k?
Both are possible and will give correct result as l==r , hope that solves the doubt :)
public int findKthPositive(int[] arr, int k) { //brute force(Two pointer)(O(n))
int num=1;
int count=0;
for(int i=0;i
Why at last l+k and not r+k
Both are possible and will give correct result as l==r , hope that solves the doubt :)