Kth Missing Positive Number || Binary Search || 2-Pointers || Leetcode-1539
ฝัง
- เผยแพร่เมื่อ 24 ส.ค. 2024
- 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_mit...
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
public int findKthPositive(int[] arr, int k) { //brute force(Two pointer)(O(n))
int num=1;
int count=0;
for(int i=0;i
great explianation
Thank you sir
Not working with testcase k =1 and array {32,59,77} ans should be 33 according to gfg.
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 :)
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 :)