Let's march ahead, and create an unmatchable DSA course! ❤ Do consider to give us a like, and a subscribe, means a world to us..
@giit85 Жыл бұрын
❤️
@bhanupratapsharma6158 Жыл бұрын
competitive programming content plz sir how to reach candidate master i was stucked on specialist
@tuhindas9777 Жыл бұрын
Thank you dada love from Kolkata
@23cash86 Жыл бұрын
STL next?
@techyouknow8026 Жыл бұрын
Happy new Year , Please Sir upload all the basics lecture within 2 months as I trust you so I can request you please upload frequency maintain , I like all your video after watching it completely, also you are helping others to achieve their new year resolution.
@sachinboreoffl Жыл бұрын
Tip: When you're printing spaces in a pattern, replace the space with any other symbol like this "-", it helps in understanding what we are doing.
@RahulChacko Жыл бұрын
❤
@jaydeeppatil7936 Жыл бұрын
Thanks a lot it really helped me
@anusha6033 Жыл бұрын
nice one thanks for sharing
@suryasaipalthi11 ай бұрын
thanks for sharing that did change my way of thinking somewhat
@harshyadav12149 ай бұрын
very good approach
@sumitapathak2900 Жыл бұрын
I was losing confidence in my DSA skills after being away for so long. This video sharpened my thinking as well as brought back that confidence. Thanks a lot !!
@FRACTALUMAR2 ай бұрын
did you solve them by your own or first watched ,then, practice them ....
@vahramirpunit23 күн бұрын
@@FRACTALUMAR i first watched whole video once, then i solved most of the problems on my own, if needed i came back to video.
I literally did the same... because there was error that character can not add with int..so i did with your method
@honourable88165 ай бұрын
@@dllychoudhary7586 You can use cout
@TiyaBhatt4-de8sq5 ай бұрын
@@dllychoudhary7586 I am facing the same error in question 16 . What should I do?
@yashiktaneja6734 ай бұрын
@@TiyaBhatt4-de8sq char ch='A'; for(int i=1; i
@rajeshvarma21625 ай бұрын
In Pattern18, we should not hardcode the value 'E', It should be dynamic. void pattern_18(int n) { for (int i=0; i
@Hades02104 ай бұрын
Exactly
@ictfan-ly8ghАй бұрын
Yes bro u are 👍
@ictfan-ly8ghАй бұрын
He could have use Char ch= 64+n
@kartikgautam6769Ай бұрын
its wrong bro...The correct solution is.... for(int i=0;i
@ImaamJIJ26 күн бұрын
we can use this for coding ninjas practice for (int i = 1; i ='A'+(n-i); ch--) { System.out.print(ch+" "); } System.out.println(); }
@nisha1841 Жыл бұрын
Bhaiya learning DSA from your AtoZ sheet . i am in final year I can't thank you enough for bring light in my dark future..when everyone is saying that "tumse an ho payega "I finally decided that "ab mujhse hi ho payega" thank you bhaiya .and please agle 3 month take intermediate level ka DSA sikha do.
@AryanKumar-qj9ud Жыл бұрын
Same stry wish the best
@uniquescience7047 Жыл бұрын
All the best to you😁
@known878 Жыл бұрын
Bhai tumne bola ki 3 month takk intermediate DSA sikha do aur tumhare comment ke bhi 3 months ho gaye to sikh liye kya intermediate wala?
@nisha1841 Жыл бұрын
@@known878 ha bhai intermediate level ka almost complete hai . Strive ki AtoZ sheet se padha hai maine usme se question bnao shi rhega
@prajjwal5520 Жыл бұрын
placement lg gyi?
@md.ualiurrahmanrahat2400 Жыл бұрын
saw a lot of videos before to understand pattern 22. But never got it. The way you solved it!!! What can I say. We owe you big time brother.
@chiragPatel22c Жыл бұрын
last pattern is mind blowing!!! hard to get that logic at first sight.
@dhruvdonsahu99723 күн бұрын
i am still confused
@raavanan007925 ай бұрын
Thanks for the great content ❤ @tip for the pattern 18 the logic in the video is hardcoded for 'E' letter alone . Kindly utilize the below solution. void alphaTriangle(int n) { for(int i=0;i
@samuelfernandes33018 ай бұрын
striver i think you made a little mistake in pattern18 your considering j as E, but the start letter depends on number of rows, therefore the code will work for more test cases void pattern18(int n){ for (int i = 1; i
@ankushhv6972 Жыл бұрын
Hey Striver, i think for the pattern 18, we should not directly start from 'E', I think according to pattern we should be starting form ('A' + n - i + 1) until ('A' + n), for(int i = 0; i < n; i++) { for(char ch = 'A' + (n - i - 1); ch < 'A' + n; ch++) { cout
@shaharslan3372 Жыл бұрын
Yes, Ankush I also noticed this. Using this approach makes it dynamic for all inputs of 'n'. Good Job
@soubhikghosh6564 Жыл бұрын
It doesnot come interviews i agree. But still i would urge all to do this exercise... It will help all Software engineers or aspirants to improve their problem solving skills by seeing patterns
@sasmitsirroco3 ай бұрын
For pattern 7, why print spaces after astrix? Simply cout
@nehathakur40 Жыл бұрын
you are an inspiration for programming faternity! loved the way you teach. The ease with which you have taught recursion and dp is commendable. i get to learn every day from you. Thank you for being light in lives of programmers.
@raunak276 Жыл бұрын
fr
@sainaid Жыл бұрын
no doubt striver bhaiya has made this playlist the best way.
@mehtabmultani3194 Жыл бұрын
39:22 tip for pattern 11: if the sum of every single (row+column) is 'even' then have to print 1 else 0 if((i + j) % 2 === 0) print(1) else print(0)
@satyam-seth7 ай бұрын
void printPattern(int n) { for (int i = 0; i < n; i++) { for (int j = 0; j
@012srishtisaini74 ай бұрын
@@satyam-seth thankss.. i was having a bad time because of this
@Cvx_ishere Жыл бұрын
Literally, breaking whole concepts into 3 steps really really help me as beginner to understand patterns. Thankyou striver b :)
@shuskane Жыл бұрын
UNDERSTOOD 👍 👍👍 👍👍👍 👍👍👍👍 👍👍👍👍👍
@kshitijsingh1990Ай бұрын
haha smart!
@zakirabhabhi317518 күн бұрын
let n=5 for (let i=0;i
@udaykumar-jj1gw14 күн бұрын
@@zakirabhabhi3175 😂 😂😂 😂😂😂 😂😂😂😂 😂😂😂😂😂
@debashmansarbadhikari6196 Жыл бұрын
For pattern number 12 we could also have done the following : int space = 2 * ( n - i )...ofcourse this variable would have to be defined within the scope of the outer loop. Besides, the problem given on the sheet and the problem redirected to by the link are actually slightly different. Here's the code snippet for solving the problem redirected to by the link : void printTriangle(int n) { for(int i = 1; i
@abhisheksantoshbhambe76177 ай бұрын
thanks dude!! i thought y im not getting it, and u coreected me
@prathameshdhanajigandule42996 ай бұрын
The better and correct code for pattern no.18 1:01:00 would be : void pattern18(int n){ for(int i = 0 ; i < n ; i++){ for(int j = i ; j >= 0 ; j--) cout
@keisergg87015 ай бұрын
yep! I did same as you, here is my java code if anyone cares public static void pattern18(int n) { for (int i = 0; i < n; i++) { char ch = 'A'; char chs = (char)(ch + (n-i-1)); for(int j=0; j
@prathameshdhanajigandule42995 ай бұрын
@@keisergg8701 Yes bro it's correct I care
@vikasverma56853 ай бұрын
@@keisergg8701 public static void pattern18(int n){ for(int i = 0; i < n; i++){ for(char ch = (char)('E'- i); ch
@sabashh8208 Жыл бұрын
For pattern18 if we don't want to hardcode 'E' and use it for other row numbers then we can make small change as char initial = (char) ('A'+ (n-1)); for (int i = 0; i < n; i++) { for (char c = (char) (initial - i); c
@NikitaNair Жыл бұрын
I was looking for this!!!
@anishchhabra60859 ай бұрын
Python code for the same: for i in range(n): char = 65 for j in range(i+1): print(chr((n-i-1)+char),end="") char += 1 print(' ',end="")
@lekhanachidananda Жыл бұрын
Thank you Striver! I really love your videos. Small suggestion: you could have calculated time and space complexity for all the patterns.
@sathvikvutukuri9179 Жыл бұрын
I think most of them took O(n^2)
@Manish-wk8ni Жыл бұрын
Thank You, we are all hooked up. This is gonna be a Great Series.
@ritusingh86165 ай бұрын
Thank you for this content! This video helped a lot! Kindly correct the code for pattern 18 to adapt to different values of input... void print18(int n){ for(int i=1; i
@tusharkumar7963 Жыл бұрын
The best video on solving patterns on KZbin! Can't thank you enough!!!😀😀
@shaharslan3372 Жыл бұрын
Edited : Saw you correct it in the next question :-D For pattern 19 , I don't think we should hard code the number of spaces as 8 and then keep on decreasing the number by 2 with each iteration , as it will only work for input n = 5. Rather there should be a general formula : for(int i = n ; i >=1; i--){ for(int j =1; j
@AdityaVerma-hh1ox11 ай бұрын
This is wrong bro
@SpewFactsBeTrueToYourselvesАй бұрын
i did pattern 19 myself by running 6 for loops and without seeing strivers explanation based on previous patterns knowledge , it took me 2 hrs to first draw it on book and break it into smaller chunks and then write code, row number is the game changer in second half rhombus
@damolaOnikoyi4 ай бұрын
Thank you Striver, preciate ya!!. I just completed all the pattern problems. The last one was quite tricky as I did not quickly understand your solution. However, I have provided my solution below for others that might find it helpful and maybe easier to understand. Intuition: Fill the 2D array (named result) with the values (n, n-1, n-2 ...) then just simply print it out (row x column)👍🏾. You can fill the result array like this : 1. Outer loop fills the layer (A layer is a square ring of numbers). 2. Get the number to be filled per layer => int num = n - layer. Hence if n = 3, layer = 0 (first one) -> n , n - 1, n - 2 ... so we print 3, 2, & 1 per square ring. 3. Middle loop iterates over the rows of the current layer. 4. Inner loop iterates over the columns of the current layer. static void pattern22() { int size = 2 * n - 1; int[][] result = new int[size][size]; for (int layer = 0; layer < n; ++layer) { int num = n - layer; for (int i = layer; i < size - layer; ++i) { for (int j = layer; j < size - layer; ++j) { result[i][j] = num; } } } for (int[] row : result) { for (int col : row) { System.out.print(col + " "); } System.out.println(); } }
@ramfattah211 Жыл бұрын
The last pattern took me some time but I just figured it out and i'm so happy 🧠🤯. Such a great feeling😊. Thank you Striver for this amazing content.
@abhisheksahu345318 күн бұрын
for pattern 15 even more simpler code : void printPattern(int n) { int i; for(i=0;i
@hasanuzzamananuz8270 Жыл бұрын
More than the premium course I have learned a lot. The lecture delivery, explanation, and expression are great, and that makes me concentrate more to watch the video. I have done all the problems on my own using your 4 pattern-solving rules. Hats off sir ❤❤❤❤❤❤❤❤❤❤
@zenmonk293 ай бұрын
today i lost my phone. it was 19 days old. went to police station to file a report, the inspector had the same name as you
@hasanuzzamananuz82703 ай бұрын
@@zenmonk29 So what, Multiple people have under the same name.
@vidhveshchangalasetty4 ай бұрын
18th pattern We should define a const char starting alphabet of each line by taking the char ch='A'+n-i (before starting the outer for loop) void alphaTriangle(int n) { char ch = 'A' + n - 1; for (int i = 0; i < n; i++) { for (char c = ch; c >= ch - i; c--) { cout
@karthikeyabollu7121 Жыл бұрын
pattern 20 is same as pattern 19 but just interchanging the spaces and stars variables. that means no.of stars in pattern 20 will be same as no.of spaces in pattern 19 and vice-versa.
@takeUforward Жыл бұрын
Good observation
@jayeshb93237 ай бұрын
Absolutely loved the video..the way you explained it made it very easy to understand complicated problems
@gunasekarb31004 ай бұрын
whoever found the logic for the pattern 22 must be an alien.
@winter_hope_3 ай бұрын
🤣
@LUchiha-dt6xv2 ай бұрын
I did found the logic myself(different but same answer though) but the logic used here is damn crazy🥲
@gunasekarb31002 ай бұрын
@@LUchiha-dt6xv did you use spiral way?
@LUchiha-dt6xv2 ай бұрын
@@gunasekarb3100 Idk about that😅, but divided the whole patter into 4 parts & designed the parts & framed them one by one(basically the brute force approach u could say)
@abhishekpattanayak14432 ай бұрын
@@LUchiha-dt6xv you can also try using chebyshev distance for each (i,j) from the middle-most index
@PrabhjotSingh-o4s2 ай бұрын
If You Start From Loop from 0 the formula will be lil bit easier helps more to understand for a beginner 23:18 For Printing ***** **** *** ** * for(int i=0;i
@neoteric_nk Жыл бұрын
Nice explanation sir! Just wanna give a general code for Pattern 18. void pattern18(int n){ char ch= 'A'+n-1; for(int i=0; i
@keerthanasathish36848 ай бұрын
Alternate code for pattern 5 has runtime 17ms void seeding(int n) { for(int i=0;i
@k-gos Жыл бұрын
What will be the frequency of lectures and will you teach the complete DSA in this course? Also what will be the tentative duration of this course? Great lec btw
@shivendradwivedi88874 ай бұрын
In pattern 20 , for stars and spaces we can do this way also int stars = i; int spaces = 2*n - 2*i; if(i > n){ stars = 2*n - i; space = 2*i - 2*n; }
@spdks3485 Жыл бұрын
HAPPY NEW YEAR SIR HAVE A GREAT YEAR AHEAD AND WE ARE VERY GLAD TO GET THE HELPING PERSON LIKE YOU FOR BEGINERS LIKE US.
@anil-chaturvedi Жыл бұрын
Thank you for this logic-building lecture. I'm feeling confident about pattern questions.
@detaqwer Жыл бұрын
Hey Raj, for pattern 11 we can try this code as well which is simpler void print11(int n) { for (int i = 1; i
@chethanprabhu4475 Жыл бұрын
Can simplify even further void print11(int n) { for (int i = 1; i
@blockyquasar4 ай бұрын
@@sagarshah5341 kaise bhai? same hi hai dono me, n square hai dono me
@sagarshah53414 ай бұрын
@@blockyquasar I do not remember why I said that!
@nexxerjm34811 ай бұрын
Patter seventeen :@58:53 Solution is very Here is approach first print space then print ascending order charcater till i Then print descending order till i-1 First loop for space: j=1 to j
@mrnonsenseju Жыл бұрын
New exciting videos in new year... Thanks Striver Bhaiya.... Love from Jalpaiguri
@swapnilkhandekar4157 Жыл бұрын
for gfg 18 pattern another type void printTriangle(int n) { for(int i = 0 ; i < n ; i++){ int alpha = 26 - n; char ch = 'Z' - alpha; for(int j = 0 ; j
@UECHarshaVardhanRavipalli Жыл бұрын
Done these all max by my own... feels confident enough to go ahead!! TQ Bhai!!😇
@Seraexplores3 ай бұрын
Pattern 19 simpler: def pattern19(n): for i in range(1, 2*n + 1): stars = n-i+1 if i > n: stars = i-n spaces = 2*n - 2*stars for j in range(stars): print("*", end="") for k in range(spaces): print(" ", end="") for j in range(stars): print("*", end="") print()
@Narasimha-ms2up Жыл бұрын
Really amazing teaching after listening 8th to 11th pattern , without any error i do 12th by my own❤❤❤
@mahirshah763Ай бұрын
In Pattern 22, if someone is coding in c language, there is no min() function so it can be written like this by creating a function: #include int minimum(int a,int b, int c, int d); int main() { int num=4; int n=2*num-1; for(int i=0;i
@sukhpreetsingh5200 Жыл бұрын
Revision done😄
@mr.batman23483 ай бұрын
hello paji koi dc ya linkedin profile wagera
@amit1305 Жыл бұрын
thanks for the hardwork man i completely understood pattern now
@HemasaicharanKАй бұрын
Thank you for your clear and concise explanation. I used to follow you for so long on LinkedIn, but didn't get a chance to watch your content. Now is the time for me to get prepared for a DSA interview.
@rishabh_pant Жыл бұрын
Source code ? I have learned Star space star patterns with your trick ❤️🔥. It would be better if you normalize and use loop from 0 or 1 for every problem :) cheers !!!
@sagarshah5341 Жыл бұрын
Hey Striver do you think this is a better solution for Pattern 07, Pattern 08: This is in Python. But the logic can be replicated to any other language. Pattern 07: n = temp = "" content = (n*2)-1 count = 0 for i in range(1,n+1): count = (i*2)-1 spaces = int((content-count)/2) temp = (" " * spaces) + ("*"*count) print(temp) Pattern 08: n = temp = '' content = (n*2)-1 count = 0 for i in range(n,0,-1): count = (i*2)-1 spaces = int((content-count)/2) temp = (" " * spaces) + ("*"*count) print(temp) Please correct me if I am wrong. Just a newbie.
@luckshaeey Жыл бұрын
last pattern was awesome. I followed another method and figured out some another pattern and symmetricity in it. But your approach was very informative too.
@darkexodus6404 Жыл бұрын
Same. From outermost square to the innermost square. I did it like this.
@Jaishreeram-ly2jmАй бұрын
can u share your method?
@saisameer7808 күн бұрын
Thank you GOAT !!! Never understood patterns this good .
@thewave1996 Жыл бұрын
Thanks bro, you are giving your best to teach us and i will assure u that i will also give my 100% so that your efforts will not be a vain. I will complete this course and solve your 180 questions so that that i can place in a good company. once again thank u so much for your in depth assistance. 🙌
@user-zy3mz6ml7c7 ай бұрын
You're answer for question 18 only gets correct answer when n is 5 because you hardcoded E into the for loop. The answer should be: void print18(int n){ for (int i=0;i
@4444-c4s Жыл бұрын
A little catch for Pattern-7. Don't need to print last spaces. Just 2 inner for loops will work.
@ChetanRajput-ju2sd4 ай бұрын
problem 22 - For Python: I found below approach most optimised. If u observe (row wise): 1st half and 2nd half is a mirror (ignore middle for a while.) 1st half of a row is a combination of two parts: a - fix part b - decremental part for eg , for n = 6 (considering just 1st half of a row) row1 : 666666 -> all fix , no decremental row2 : 655555 -> 6- decremental , 55555 - fix row3 : 654444 -> 65 - dec , 4444 - fix row4 : 654333 -> 654 - dec , 333 - fix derive the code for dec and fix , then combine the string to generate 1st part of a row , then neglet last character and reverse the result , concatenate both original and reverse to get full row. time difference (n = 500 ) 1. n - min() approach : 256ms 2. above approach : 54 ms
@cinime Жыл бұрын
Understood! Super amazing explanation as always, thank you very much!!
@frekkytanishАй бұрын
for pattern 16 : int n; cin>>n; for(char ch = 'A' ; ch < 'A'+ n ; ch++ ){ for(int cha = 'A' ; cha
@user-jy3sc2df7y6 ай бұрын
Is anyone doing it using Java?
@xihadityajaiswal87975 ай бұрын
Me
@harikrishnapatel75145 ай бұрын
yes
@shaunakmajumdar52785 ай бұрын
Ofc
@vikrant36405 ай бұрын
Ofc😊
@ProgramerRaj5 ай бұрын
Yeah bro
@yuuji-kun30614 ай бұрын
1:01:25 In Pattern18, we should not hardcode the value 'E', It should be dynamic. void pattern_18(int n) { for (int i=0; i
@mx5enthusiast4 ай бұрын
Exactly what I was thinking.
@rishav144 Жыл бұрын
one of the best videos 🔥
@GauravThinks Жыл бұрын
bhai poori to dekh le pehle
@yikes3807 Жыл бұрын
@@GauravThinks xd
@itz-aksh7 ай бұрын
pattern 19: we can also combine both upper and inner part by declaring variables for conditions and so avoid writing loops for 3 more times.. void print19(int n){ for(int i=1;in/2){ conditionstar=i-n/2; conditionspace=2*(n-i); } else{conditionstar=n/2-i+1; conditionspace=2*i-2;} for(int stars1=0;stars1
@tgxgaming58807 ай бұрын
31:00 What if we don't print the last space ? Like, After the stars. Does it improve TC(Time Complexity)?
@stith_pragya8 ай бұрын
UNDERSTOOD......Thank You So Much for this wonderful video..........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@SoumeshRanger111 Жыл бұрын
Thank you for the video, If possible could you please share the tasks.json file here, i.e. how you're writing to the output file simultaneously.😊😊
@neotetra02882 ай бұрын
thank you for this video, i think i need a lot of practice with patterns but this was good to get a basic idea.
@Yash_Raj_J Жыл бұрын
If possible can you tell us another method for pattern 22? I did not understand. BTW THANKS A LOT BHAIYA
@BhuvaneswariSura9 ай бұрын
import java.util.*; class Pattern { public static void main(String args[]) { int n=7; int c=((n+1)/2); for(int i=0;i
@lavanya_m018 ай бұрын
Understood! Can't thank you enough, God bless you for your wonderful contribution to the community
@Sagardeep_Das6 ай бұрын
For pattern 18 this can be tried too. It can print decreasing pattern for any no of alphabets (don't exceed n = 25 in input) void pattern18(int n) { int count = n; for(int i = 0; i
@yogeshverma7366 Жыл бұрын
Hey Striver, for the pattern 18, I guess the code will not work for n > 5, it will start printing characters lesser than 'A'.
@varunsde95338 ай бұрын
to make it as per any value of n, make the following changes: char ch = (char)((int)'A'+n-i-1); for(int j=0;j
@amansinghrajput182 ай бұрын
Understood..Great way of teaching
@KeepCoding69 Жыл бұрын
Better solution for Pattern no.12 (using only 2 for loop) : #include using namespace std; int main() { int n = 9; int start = 1; int end = n*2; int temp; for (int row = 1; row
@Manishgupta200 Жыл бұрын
The last one patttern is so tricky. Thanks, for the complete tutorial.. Very optimized way you explained to solve pattern of any type in a very easy way. Thankyou Striver.
@nihalwaseem710628 күн бұрын
Started this playlist on 22nd sep 2024, great video covering various types of patterns questions
@aayushjain37312 ай бұрын
Pattern 11 can also be written using a matrix like concept under the inner loop if((i+j)%2 == 0) cout
@mintobit6 ай бұрын
As an alternative solution for pattern #22: every number equals to the distance from center + 1. private static void numberPattern(int n) { for (int i = -n+1; i < n; i++) { for (int j = -n+1; j < n; j++) { System.out.print(1 + Math.max(Math.abs(i), Math.abs(j))); } System.out.print(" "); } }
@niranjanniru41156 ай бұрын
BRO GUD TUTOR FOR DSA AND AS WELL AS FOR C++..... WE NEED MORE UPDATEZ LIKE THIX AND THANKS FOR YOUR LECTURE BRO
@graviton0013 ай бұрын
Pattern 5 my way of doing :- void print5(int n){ int a,b; for(a=1; a=a; b--){ cout
@sarthakpatwari79884 ай бұрын
The logic for last one is something out of the box, great work man!!
@programmingwallah29058 ай бұрын
One of the best man in coding community
@ravikiranm-en4jr5 ай бұрын
These patterns have helped me a lot to understand the loops. Thank you!!
@SmailOujaoura-ty8ui28 күн бұрын
Nicely presented lecture and crystal clear explanations.
believe me I watched the petterns videos earlier from another youtubers too but I myself wasn't able to solve a single pattern but this time this person made me do the complex patterns by my self.He is something different .Hatss off to youu bhaiya
@PriyankaKumari-cm3kq2 ай бұрын
Problem no. 18 code- void alphaTriangle(int n) { for(int i=0;i
@ninadkulkarni49513 ай бұрын
for the pattern 22 we can also have another logic we consider each number as a boundary of a square starting from 4 as the outer boundary moving in to 1 and put 4 conditionals just like pattern 21 if(i==0 || i==2n-1 || if j==0 || j==2n-1) printf("4"); if(i==1 || i==2n-2 || if j==2 || j==2n-2) printf("3"); if(i==2 || i==2n-3 || if j==3 || j==2n-3) printf("2"); if(i==3 || i==2n-4 || if j==4 || j==2n-3) printf("2");
@pramodkumarverma84753 ай бұрын
We have to make it for n You can't fix it to 4 only
@pramodkumarverma84753 ай бұрын
With this method n conditional statements will be needed
@ninadkulkarni49513 ай бұрын
@@pramodkumarverma8475 ya my bad Time bht le rahi hai ye approach Not at all optimised
@bhaveshpatil92716 ай бұрын
Understood. Thanks!
@kumaraditya55137 ай бұрын
A different yet similar approach to Pattern 11 (java) 39:22 int num = 1; for (int i=1; i
@Mansi_JavascriptАй бұрын
one of the best video ever on patterns!
@sunny-teaches-sometimes2 ай бұрын
For pattern 18, instead of assuming output always begins with char 'E', we could do this instead. Character A is 65 in ASCII, so the ending character at start would be => 65 + n -1 Since we are then decrementing the ending character at the start of every row => 65 + n - 1 - i While printing characters on a row's columns, we are incrementing the character to be printed => ord(rowStart) retrieves ASCII for the starting character for that row. ord(rowStart)+j retrieves the ASCII for the next character to be printed in that row chr(ord(rowStart)+j) retrieves the character for the respective ASCII Here's the python code for this pattern def pattern18(n): for i in range(n): rowStart = chr(65 + n - 1 - i) for j in range(i + 1): print(chr(ord(rowStart) + j), end='') print()
@NerdOverPhysics28 күн бұрын
for pattern 18 it will always start from 'E'. Instead, we can code this way better : void pattern18(int n){ char ch = 'A'+n; for(int i=0;i
@nikhilmalhotra1986Ай бұрын
really glad a time you spent to explain this small topic in depth 🙂
@susmitha5g627 Жыл бұрын
Really happy to get it all for free! Thank you so much Striver!
@_TashfiqTaif8 ай бұрын
IN problem 7 : No i think no need last space . I mean, space and star print the same thing .. Thank you sir code: #include using namespace std; #define ll long long int main() { int n; cin>>n; for(int i=1;i
@krishnagarg25837 ай бұрын
for the 5th pattern you can also do for (int i = 1; i = i; j--) { cout
@ankushshandilya3 ай бұрын
Awesome Sir! Its truly insightful and interesting.