Lecture 4: Solving Pattern Questions (Part-2)

preview_player
Показать описание
In this Video, we are going to solve a lot of Pattern questions.

There is a lot to learn, Keep in mind “ Mnn boot karega k chor yrr apne se nahi yoga ya maza nahi para, Just ask 1 question “ Why I started ? “

Homework: Added in Video already
Homework Timestamps [13:20, 17:09, 27:58, 29:28, 33:30, 37:25, 41:40, 51:30, 52:35, 53:35, 53:45, 54:10, 01:00:43]

Telegram Group Link: Love Babbar CODE HELP

Do provide you feedback in the comments, we are going to make it best collectively.

Connect with me here:

Intro Sequence: We have bought all the required Licenses of the Audio, Video & Animation used.

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

Pattern's Timestamps:-

Pattern 3 : 0:25
Pattern 4 : 2:36
Pattern 5 : 5:09
Pattern 6 : 7:48
Pattern 7 : 10:19
Pattern 8 : 13:06
Pattern 9 : 13:43
Pattern 10 : 17:57
Pattern 11 : 22:43
Pattern 12 : 22:47
Pattern 13 : 28:57
Pattern 14 : 29:55
Pattern 15 : 33:48
Pattern 16 : 37:52
Pattern 17 : 38:44
Pattern 18 : 41:55
Pattern 19 : 47:31
Pattern 20 : 51:42
Pattern 21 : 52:56
Pattern 22 : 53:49
Pattern 23 : 54:01
Pattern 24 : 54:13
Pattern 25 : 54:28
Pattern 26 : 54:51
Pattern 27 : 1:01:09

divyanshuvig
Автор

Pattern Problem 17:50
Code N Explanation

=> Code :-

int n;
cin>>n;

int i=1;
while(i<=n){
int j = i;
while(j<2*i){
cout<<j<<" ";
j =j+1;
}
cout<<endl;
i =i+1;
}


=> Explanation :
Observe the pattern carefully
1
2 3
3 4 5
4 5 6 7

we set the condition while (j<2*i) in 2nd while loop cuz in above pattern
every row starts with the the row number(value of i) N ends before the twice of its row value..

1 (row number, i = 1 So, j<2*1, i.e 2)
2 3 Similarly, 2*2 =4 & lastValue : 3
3 4 5
4 5 6 7

vent_down_
Автор

I found it very challenging at first..I'll practice them as much as i can for getting a grip and keep revising these important and brainstorming questions.Thankyou babbar bhaiya, you are helping us children a lot with your videos.

ardent
Автор

for 36:00 this seems a better approach

int n;
cin >> n;

int i=1;
char ch = 'A';

while(i<=n){
int j=1;
while(j<=i){
cout << ch ;
j=j+1;
}
ch++;
cout << endl;
i++;
}

sakshamaggarwal
Автор

17:44 formula
Cout << row + column -1 ;
Row from 1 to n
Column from 1 to row

Gaurav-imdf
Автор

Programming is not so difficult but with the right explanation. It turns out programming is just fun learning it from you.

tanzeelahmed
Автор

21:47 You dont need to put +1 in (i-j+1) if you initialise j with 0 and put j<i in inner while loop, it will make people understand more easily.

qvvedck
Автор

sach mai bhai bohot madat ho rahi hai solution dekhane se pehele jab question try kar ke sahi ho raha hai tab alag hi khushi ho rahi hai

Atharvsp
Автор

Pattern's Timestamps:-

Pattern 3 : 0:25
Pattern 4 : 2:36
Pattern 5 : 5:09
Pattern 6 : 7:48
Pattern 7 : 10:19
Pattern 8 : 13:06
Pattern 9 : 13:43
Pattern 10 : 17:57
Pattern 11 : 22:43
Pattern 12 : 22:47
Pattern 13 : 28:57
Pattern 14 : 29:55
Pattern 15 : 33:48
Pattern 16 : 37:52
Pattern 17 : 38:44
Pattern 18 : 41:55
Pattern 14's Easy Approach : 47:02
Pattern 19 : 47:31
Pattern 20 : 51:42
Pattern 21 : 52:56
Pattern 22 : 53:49
Pattern 23 : 54:01
Pattern 24 : 54:13
Pattern 25 : 54:28
Pattern 26 : 54:51
Pattern 27 : 1:01:09 ( Dabangg Pattern )

engineerbae
Автор

Done with this lecture..😍
Solved all the questions and ab toh alag hi level confidence aara hai patterns me🙃
Thank you for making it happen Bhaiya..🤗

shwetagupta
Автор

This is how completed the DABANGG pattern question (breaking it into 4 parts for a better understanding). Thanks a lot Babbar Sir for making the playlist of this course❤


#include<iostream>
using namespace std;
int main(){
int n, i=1;
cin>>n;


//first triangle

while(i<=n){
int j=1;
while(j<=n-i+1){
cout<<j;
j=j+1;

}


//second triangle(half of stars ke liye)

int star1=i-1;
while(star1){
cout<<"*";
star1=star1-1;
}


//third triangle(rest of stars ke liye)

int star2=i-1;
while(star2){
cout<<"*";
star2=star2-1;
}


// last triangle

int start=j-1;
while(start){
cout<<start;
start=start-1;
}

cout<<endl;
i=i+1;
}

}

sujalsharma
Автор

Anyone's there who's doing it rn?

Oliver_johnsonns
Автор

52:50. Formula
Int star=n-row+1;
While(col<=star){
Cout<<"*";
Col=col+1;

deepakbehera
Автор

These questions remembering me my College days... When we used to do that patterns... I wanted to start my coding and DSA skills again... and these videos came out... Thankyou for making these kind of series... Now I am enjoying programming again... And doing all the problems into JavaScript...😊

akanshaagrawal
Автор

Your explanation is so good. Actually, I know only python but now the way you explain I am doing it in both the languages properly. Thanks for providing us this awesome DSA course. We all are always support you, Our Elder Brother. ❤❤

mauryadharmendra
Автор

22:50 in this timestamp the better code for pattern.( Using 'ASCII TABLE')

cout<<"Enter no. ";
int n;
cin>>n;

int a=1;
char val=65;
while (a<=n){
int b=1;
while (b<=n){
cout<<val<<' ';
b++;
}
cout<<endl;
a++;
val++;
}

InspirationalStories-brsj
Автор

Your explaination is amazing, I hope this video reaches every student.

amankharwal
Автор

Never felt this much confident while doing pattern problems. Thankyou so much bhaiya.

amansinghal
Автор

aapki wajah se mujhe apni khoyi hui sakti yaad aane lagi hai + god

kabir
Автор

32:27
You can also use
int i = 1;
int j = 1;
char k = 'A';
while(i<=n){
while(j<=n){
cout << k << " ";
k++; // incrementing k and resetting it to 'A' + row number later
j++;
}
cout << "\n";
k = 'A' + i;
j=1;
i++;
}

muzamilahmed