Thanks Ayushi! You are doing great job. Just one feedback - Before going into the actual solution please try to provide a dry run on any test case so that the question will be more clear to us.
I feel u solve the imp and problems whose chances of coming in interviews is mots! do u have any list of problems concatinated somehwere so that i solve those? like over some doc?
Hi Darshan, keep looking for openings and if opening is there, then check if the job requirements matches your resume. In some startups, they ask DSA and in some they ask related to development or whatever skill they are looking for, so you need to prepare accordingly :)
Maam I have tried writing down the solution in java : class Solution { public int findMinArrowShots(int[][] points) { Arrays.sort(points,(a,b)-> a[1]- b[1]); int end=points[0][1]; int arrows=1; for(int i=1;iend) { ++arrows; end =points[i][1]; } } return arrows;
} } but just 1 test case is not getting executed : points = [[-2147483646,-2147483645],[2147483646,2147483647]] Output : 1 Expected : 2 Please help me out in rectifying the issue in my code ma'am.
class Solution { public int findMinArrowShots(int[][] points) { Arrays.sort(points,(a,b)->a[1]-b[1]); int arrows=1; int end=points[0][1]; for(int i=1;iend){ end= points[i][1]; arrows++; } } return arrows; } } but dont know why it fails in 1 case [[-2147483646,-2147483645],[2147483646,2147483647]] this one
int findMinArrowShots(vector& points) { int ans=1; sort(points.begin(), points.end()); int xend=points[0][1]; for(int i=1; i points[i][1])?points[i][1]:xend; } } return ans; }
Nice xplanation sis However if you are workin on java... * [[-2147483646,-2147483645],[2147483646,2147483647]] this testcase might fail if you use Arrays.sort(intervals, (a, b) -> a[0] - b[0]); to sort the array... Now I did a quick analysis on why it doesn't work? You would understand it clearly if you clearly understand the working mechanism of compare(a-b) #Analysis if(a-b) is > 0 means, b comes before a else if (a-b) b)||(a
Thanks a lot 😊 , feels like because of you I will go consistency solving problem everyday.
Welcome Rohit😄😄🥺
Thanks a lot for the great explanation and consistency!
Welcome Chandra, glad they are helpful :)
thank you! understood it well, was close to my intuition, but i didn't think about sorting the arrays within and was thinking the other way!
Welcome! 😄 glad it was helpful
Thank you for explaining this problem in easier way..
You are most welcome🤗
due to u,i got more confidence in coding
Thank you, this means a lot 🤗
Very nice explanation! Understood perfactly.
Glad it was helpful!🤗🤗
nice explanation... very easy to undertand
Thank you Soumya 😊
Great explanation.
Thanx, for new approach ,i am doing this question ,merge interval
Welcome, glad it was helpful :)
Very Informative, Thank You
Glad it was helpful!🤗🤗🤩
Clearly explained video and explanation
daily its a motivation, doing daily challenges with you.
Great :)
grt explanation ayushi as always
Thank you, glad it was helpful :)
Thanks Ayushi! You are doing great job. Just one feedback - Before going into the actual solution please try to provide a dry run on any test case so that the question will be more clear to us.
Hi Rohit, thanks sure, will keep in mind :)
clear explanation🙌
Glad you think so!🤗
Clearly explained. Thank you for your video
Welcome :) glad it was helpful
Thanks Ayushi. It helps me alot.
Welcome Ashwani, glad it is helpful :)
Thanks didi , great explaination.
Welcome 🤗 glad it was helpful
Thanks for being consistent !
Welcome, glad the videos are helpful :)
Di consistency ke liye respect++ !!!!!!!!
🥺🥺🥺 thanks mate
wow, great explanation
Thank you, glad it was helpful :)
Nice Explanation!
Thanks 😊
Thanks so much for the video !!!!
You are so welcome!🤗
thanks sis aag lgadi dont stop 😅
Thanks yrrr🤩🥹
I feel u solve the imp and problems whose chances of coming in interviews is mots! do u have any list of problems concatinated somehwere so that i solve those?
like over some doc?
It took some time to understand the if condition part, nevertheless nice explaination.
thank you :)
thank you!
thank you aisha akka
7 ,12 is also overlapping.. why we cant burst it ?
OP Solution
Thank you, glad it was helpful :)
Hii Ayushi dii, can you tell me How to get intership in good startup off campus ?
Hi Darshan, keep looking for openings and if opening is there, then check if the job requirements matches your resume. In some startups, they ask DSA and in some they ask related to development or whatever skill they are looking for, so you need to prepare accordingly :)
@@AyushiSharmaDSA ohk thanks
Is this some kind of series',
Found your channel on LinkedIn!!
It's leetcode daily challenge :)
Didi I wanted to ask you what effect does declaration of comparator inside and outside class have on complexity ?
There is no difference in the complexity
why we not sort according to start, why with the end?
That can also be done :) try doing it with a test case
Maam I have tried writing down the solution in java :
class Solution
{
public int findMinArrowShots(int[][] points)
{
Arrays.sort(points,(a,b)-> a[1]- b[1]);
int end=points[0][1];
int arrows=1;
for(int i=1;iend)
{
++arrows;
end =points[i][1];
}
}
return arrows;
}
}
but just 1 test case is not getting executed :
points =
[[-2147483646,-2147483645],[2147483646,2147483647]]
Output :
1
Expected :
2
Please help me out in rectifying the issue in my code ma'am.
Thanks di
Welcome, glad it was helpful :)
anyone has java solution with same approach?
class Solution {
public int findMinArrowShots(int[][] points) {
Arrays.sort(points,(a,b)->a[1]-b[1]);
int arrows=1;
int end=points[0][1];
for(int i=1;iend){
end= points[i][1];
arrows++;
}
}
return arrows;
}
}
but dont know why it fails in 1 case
[[-2147483646,-2147483645],[2147483646,2147483647]] this one
int findMinArrowShots(vector& points) {
int ans=1;
sort(points.begin(), points.end());
int xend=points[0][1];
for(int i=1; i points[i][1])?points[i][1]:xend;
}
}
return ans;
}
Nice xplanation sis
However if you are workin on java...
* [[-2147483646,-2147483645],[2147483646,2147483647]] this testcase might fail if you use
Arrays.sort(intervals, (a, b) -> a[0] - b[0]); to sort the array...
Now I did a quick analysis on why it doesn't work?
You would understand it clearly if you clearly understand the working mechanism of compare(a-b)
#Analysis
if(a-b) is > 0 means, b comes before a
else if (a-b) b)||(a