Best way of explanation. Whenever I have doubts on LeetCode problem, I come here and find solution with great explanation. Thank you for this much efforts.💕
I have a doubt, In the for loop we are finding the SUM of given array which is cool, When we are doing the n(n+1)/2 formula- Here also we are checking the sum of nums array only (nums.length). I think we need to do do int n= nums.length+1; then int actualSum= (n*(n+1))/2 works. Is this approach correct. How it is showing correct output in your code is my confusion.
You are keeping eyes on the index only but thhe real thing is that the logic knows how many elements are the logic has defined elements of n but the indexing is only from 0 that can be mostly seen in the loop. I hope you get this.
Best way of explanation. Whenever I have doubts on LeetCode problem, I come here and find solution with great explanation. Thank you for this much efforts.💕
Happy to help :)
This is the most very easy and efficient approach. Thank you.
Iam getting error i cannot be resolved to a variable
This is actually great the solution is much better than other
Tq so much. very clear explanation.
Great Explanation! Thank you so much...please keep uploading leetcode problems..
This is a very interesting approach. Cyclic sort and follow up with locating the missing value also works too.
Simple and sweet explanantion ever seen;
Same ...so I subscribe it
thank you so much, your way of explaination is awesome
Nice and easy explained ❤😊 di
#23/02/2024
if more than one number are missing then ?
wonderful approach
I have a doubt, In the for loop we are finding the SUM of given array which is cool, When we are doing the n(n+1)/2 formula- Here also we are checking the sum of nums array only (nums.length). I think we need to do do int n= nums.length+1; then int actualSum= (n*(n+1))/2 works. Is this approach correct. How it is showing correct output in your code is my confusion.
You are keeping eyes on the index only but thhe real thing is that the logic knows how many elements are the logic has defined elements of n but the indexing is only from 0 that can be mostly seen in the loop. I hope you get this.
amazing solution
this asked me in yestarday interview
maam what if there is two missing number then this code will be failed
int arr[]= {2,3,4,5,6,7}; this case it will fail above programme works only if array number starts with 1 for one missing number
di plz tell me which graphic tablet you use plz its a humbel request plz plz plz plz plz
Not very fancy one, just using Huion pen tablet
Nice
bhai sab test cases nahi pass karta
Are sab pass ho rhe hai..Kaun sa ni ho rha..Tell me
@@TechnosageLearningnahi horaha he madam you are not intialize the value of i so that is the error i can not be resolved