Hello, a simple way to solve this is by using the 1st approach sir mentioned in the video: class Solution { public: int missingNumber(vector& nums) { int n=nums.size(); int sum=n*(n+1)/2; int s=0; for(int i=0;i
@sauravchandra106 ай бұрын
We can also use cyclic sort in this problem, which is both time and memory efficient. Code: class Solution { public: int missingNumber(vector& nums) { int n = nums.size(); int i = 0; for(;i
@theOmKumar6 ай бұрын
when we do l m){//we are on res idx or res is on left r = m; } else{//everything is fine till this idx,check for next l = m+1; } } return l or r doesn't matter;
@ugcwithaddi6 ай бұрын
Well explained as always
@learnwithazhar17036 ай бұрын
Amazingly explained!
@adik36806 ай бұрын
Please make the pending video on delete implementation in trie.
@codestorywithMIK6 ай бұрын
Noted on this 👍🏻
@TheBusaSinger6 ай бұрын
Thanks for this!
@manimanohar_0016 ай бұрын
Bhaiya bit manipulation pe bhi playlist bana do pls
@souravjoshi22936 ай бұрын
Thank mik. if you get time, can you please post weekly contest Qn-4 of this week
@project_eth6 ай бұрын
can we solve this question by using hash sets, since one main property of hash sets is we cannot add repeated numbers and that way the time complexity will also be O(1)
@aws_handles6 ай бұрын
Yes but space will become O(n)
@prajwalshaw92176 ай бұрын
Hello bhaiya . Can u please make a video on q no.4 of leetcode biweekly 124...which happened on last saturday. Thanks.
@oqant04246 ай бұрын
solved on my own using 2 approaches came here to learn something new Thanks POTD DONE[20.2.24] ✅✅
@dayashankarlakhotia49436 ай бұрын
good explanation sir.one correction in java code in 3rd approach int result =n;
@ujjawaltyagi85406 ай бұрын
can any one tell me when we use sort(v.begin(, v.end()) in c++ which type of sort it is? we take worst case complexity as nlogn then what is best case and average case ?
@viditvaish73176 ай бұрын
sir please leetcode ques number 621 (Task Scheduler) bata dejiye
@anuppatankar42946 ай бұрын
Great video 👌🏻
@nish07986 ай бұрын
@codestorywithmik. I have a doubt if we store 0 in res instead of n this code is not working why so is any other way to make changes in code if we want to store 0 in res instead of n one more how we will come to know in these types of questions whether we have to store n in result or 0 in res plz reply bro
@gauravbanerjee28986 ай бұрын
Thanks a lot bhaiya ❤❤
@faizanalam88236 ай бұрын
amazing !
@aws_handles6 ай бұрын
Niceee. Thanks
@Abhay146 ай бұрын
bhaiya jo 3rd approach me code likha h vha O(nlogn) time complexity nhi aaeggi