PASCAL Triangle | Leetcode | C++ | Java | 3 problems asked in Interviews related to Pascal discussed

preview_player
Показать описание

Find DSA, LLD, OOPs, Core Subjects, 1000+ Premium Questions company wise, Aptitude, SQL, AI doubt support and many other features that will help you to stay focussed inside one platform under one affordable subscription. Have a hassle free one stop solution for up-skilling and preparing.

Рекомендации по теме
Комментарии
Автор

learned 2 new things:
1. combination trick
2.resize function
As usual, everytime i learn something new, even if i have solved the question by my own

kartiksuman
Автор

Hey Striver! Your channel inspired me to work hardd leading to getting an on campus MS Summer '21 Internship Offer! Thanks man! ❤⚡

sanskaarpatni
Автор

In case it is helpful to others, one way to derive the formula is to look at the recurrence relation for Pascal's triangle. Say f(r, c) gives the value at row r and column c. We know that f(r, c) = f(r-1, c-1) + f(r-1, c). This formula is identical to the recurrence relation for generating all combinations of size c from a set of r elements. Since we know the formula for counting all combinations, we can say f(r, c) = (r-1)C(n-1).

michael-pasquale
Автор

How the hell u make it easily understandable compared with other teachers? Great thanks, SIR.

josephkingstonleomariamich
Автор

Hey striver, This is the second video of your dsa sheet which I have started.
I am an application developer in a small company which doesn't pay much so I have decided to follow your DSA sheet with the hope that It will help me get the good job. Thanks for this wonderful DSA Sheet.

shadmannehalkhan
Автор

at 6:40, in the third case, where we have to find a particular row in the pascal triangle, the time complexity will be O(n^2) and not O(n). Reason being, an O(n) loop will traverse every element and nCr will find the value of that particular element in O(n).
nCr is not O(1), it's O(n).

Time complexity of nCr = O(min(r, n-r)) = O(min(column, row-column)) = O(Column/2) = O(column) = O(row) [row=column in pascal triangle].

devanshmesson
Автор

Never expect Pascal triangle has these many variations.Good work bhaiya.

madhubabu
Автор

Formula for a particular element R-1nC-1 was really good

yashgupta-rgit
Автор

Starting my sde sheet 1st day i.e 11th nov 2022 and planning to complete it before 10th dec. Enjoying the learning with u striver thanks a lot.

ReadingRecess
Автор

Easy Running Interviewbit Code
vector<vector<int> > Solution::solve(int A) {
vector<vector<int>> v;

for(int i=0;i<A;i++){
vector<int> r;
int res=1;
r.push_back(1);
int temp=i;
for(int j=1;j<i+1;j++){
res=res*temp;
res/=j;
temp--;
r.push_back(res);

}
v.push_back(r);
}
return v;
}

sauravchaudhary
Автор

Sir, , , your graph +dp tutorial was best for me, , , .now running the placement series... plzz make a playlist on number theory &
Another thing could you plzz post a list of programs that you are going to explain in future in your placement series.. ??.... bcz i wanna prepare with your series in parallel.. ""Thanks"" iz just a little word on your efforts, , really so grateful to you...💕💕💕💗💗💗

Fictional_universe
Автор

Hey Striver, Please Please continue the Educational DP Series 🙏🙏🙏
Specially the one's after problem G, H...
(At least the ones that are very important from interview point of view)

evergreen
Автор

python efficient solution:
def solve(n):
l = [0]*n+1
l[0]= 1
for i in range(1, n+1):
for j in range(i, 0, -1):
l[j] += l[j-1]
return l

BoostedPLAYER
Автор

void generateNthrow(int N)
{
// nC0 = 1
int prev = 1;
cout << prev;

for (int i = 1; i <= N; i++) {
// nCr = (nCr-1 * (n - r + 1))/r
int curr = (prev * (N - i + 1)) / i;
cout << ", " << curr;
prev = curr;
}
}

Those who want to find Nth row of pascal triangle. As explained by Striver brother.

vrashankraom
Автор

what could be better, than to start my DSA journey with Striver bhaiya..Thanks bhaiya.Will return to the comment section after some achievement in my bucket

prabhatece
Автор

Bhaiya, Please upload daily videos.Your videos inspires me lot

hrithikrudra
Автор

@take U forward @striver this problem will go in tc(1) if the pascal triangle are done in 11 power 0, 1, 2, 3
the trainle will come 1
11
121
14641
and to find the element at that posion run a while loop (while(n-j+1)
{
//where n is no of row and j is the posion
temp=n%10;
n=n/10;}

Anupamshaw
Автор

This Board color is better, thanks ❤️

shivanshpratap
Автор

for 3rd time complexity should be written as o(n^2) instead of o(n) at 6:53

kaushalwaghela
Автор

Brilliant ! You nailed it though, yah !

malkeetsapien
join shbcf.ru