This is a very old video, for better sound and camera quality DSA videos, learn from the below playlist! Java Plus DSA ( Java + DSA + Problem Solving ) ruclips.net/p/PLQ7ZAf76c0ZPVdhV1bAjFv0bQc1xHURzE
All the videos are out. Check below playlist, First 3 lectures have answers to your queries, ruclips.net/p/PLQ7ZAf76c0ZNSyf7ZiW5MO4onN2FId5Xw&si=x9JLO4UNPc6xjZqM
good job bro, your explanation went right through the head. Please do organise your DSA question playlist topic wise so that if someone has to do a string, they can find all string's questions at one place.
bhaiya java me string plus integer allowed h kya ? i did it in cpp so i had to convert the counter to string by to_string() method while concatenating.
@@shashwat_tiwari_st bhaiya ek video large factorial number wala me bana dijiye ho sake toh. Q. we have been given an array and need to find large factorial of evry element in it. Gfg ka solution dekha tha par utna clear ni hua.
Say n is 4. F4 calls F3, F3 calls F2, F2 calls F1 and ans of n=1 we know.. So F1 gets executed, After that F2 uses the result of F1 and executes itself. F3 uses result of F2 and executes itself. Finally F4 uses result of F3 and executes itself. Since F4 was called by main function, so recursion ends here. Order is as follows CALLING : Main->F4->F3->F2->F1. RETURNING : Main
Java has a concept of String Constant pool which says that no matter how many times we generate a string, it will be created only once in the pool and other will just point towards it or refer to it. This is because same string reference is used across various platforms. Say a String is used in database, at the server side and on the portal. Now if I want to change it on the portal, but I don't want to change it in database and on the server, so, if String is mutable, it will be changed at all 3 places. So, therefore it's made immutable in java. What I mean by immutable is: Suppose when I create a string x="shashwat" It will be created in String pool. Now if I create y="shashwat" Here in this case, both x and y will refer to same "shashwat" String, and no new string will be created. Now suppose, I want to change "shashwat" to "ShashwAT", The string pool will now have two string one "shashwat" and the other one as "ShashwAT". So, every time I make a change to the String "shashwat", a new string will be generated. But, this is not the case with StringBuilder, here we change the same String. So, we have to choose where to use what. There is one more type StringBuffer. Read all three, it's a very interesting concept. Anyways, this is why string is slower than StringBuilder.
itne videos dekhne k baad ek acha video mila... good work bas video baar baar hazy ho jaa rha hai.. uspe thoda sa kaam krlo.. baki explanation perfect hai
This is a very old video, for better sound and camera quality DSA videos, learn from the below playlist!
Java Plus DSA ( Java + DSA + Problem Solving )
ruclips.net/p/PLQ7ZAf76c0ZPVdhV1bAjFv0bQc1xHURzE
learned three things from it, one the if statement condition thing, second StringBuilder thing third obviously the code, thank you.
Great explanation!!! keep doing more videos like these your channel will see an exponential growth
Very underrated channel yet the best channel I found on youtube to understand the approach of problem statement
You are very supportive and helpful..Thanks a lot for your valuable contents...
yes please make a dedicated video on String and StringBuilder concatenation . btw great explaination
All the videos are out.
Check below playlist, First 3 lectures have answers to your queries,
ruclips.net/p/PLQ7ZAf76c0ZNSyf7ZiW5MO4onN2FId5Xw&si=x9JLO4UNPc6xjZqM
good job bro, your explanation went right through the head.
Please do organise your DSA question playlist topic wise so that if someone has to do a string, they can find all string's questions at one place.
Mast bro.. maja aa gya... aapki video suggestions me aati thi to me nhi dekhata tha lekin aaj dekha achhe se samjha kadak🤠🤠
Superbbb 🔥🔥🔥🔥
You had solved & explained this tough question very easily 🥳🥳🥳
Thank you for explain the question. Very hard to understand the question before your video. You explain the logic in a very easy way. Thanks again.
Beautiful solution. You explained this so clearly and the approach is soo different it's amazing.
Thank you for explaining this problem so easily.
best explanation of this question across youtube 😍
You explained it very nicely Thanks Sir
A very good explanation. Kindly provide c++ solution too.
Explanation was excellent , thank you so much 😇❤❤
Great Explanation sir.❤❤
Thank you so much sir 😊😊❤️❤️
nice explanation bhaiya
explained really well brother
Great Explanation !
Great explanation of the problem statement!
Thank you
really good explaination 🙂
no need to put i=s.length()-1 because your loop is i
very good explanation ..
I love your content ..... Also its very helpfull to me.... Keep it up and thank you
Beautifully explained!!
Nicely explained bro 🙂
Just a small doubt why we use .toString() in the end ?
Is it always necessary when we are using string builder?
Yes accepted return type of the function is String, that is why we need to convert StringBuilder to String.
awesome.....................
great explanations
bhaiya java me string plus integer allowed h kya ?
i did it in cpp so i had to convert the counter to string by to_string() method while concatenating.
Haan, Java me allowed hai, string and interger "+" sign se concatenate ho jate hai.
@@shashwat_tiwari_st bhaiya ek video large factorial number wala me bana dijiye ho sake toh.
Q. we have been given an array and need to find large factorial of evry element in it.
Gfg ka solution dekha tha par utna clear ni hua.
@@kunalhoro8882 👌🆗️
@@shashwat_tiwari_st bhaiyya cpp mai bhi memory and time jyada consume karra hai iske liye kiya kare....
this video really helped.. thank you bhaiya
thanks for explanation
Great work bro
Man gya tiwari bhai
Thanks bro....
Keep it up...
good approach
Very nice explanation man 🔥
thanks vaya from Bangladesh😀😀😀😀
Thanks bro it.helped a lot 🙏🏻🙏🏻
counter =0;
loop ke bahar hona after 1 it will get back to 0 in if conditon
Can you tell me the time complexity. for this solution ?
yaar maza aa gya
Nice explanation 🎊🎊🎊
Hello sir.
Once n=1 it returns from the current function to main function, how countandsay() execute for 2,3 and 4?... Can u please explain this?
Say n is 4.
F4 calls F3, F3 calls F2, F2 calls F1 and ans of n=1 we know..
So F1 gets executed,
After that F2 uses the result of F1 and executes itself.
F3 uses result of F2 and executes itself.
Finally F4 uses result of F3 and executes itself. Since F4 was called by main function, so recursion ends here.
Order is as follows
CALLING : Main->F4->F3->F2->F1.
RETURNING : Main
@@shashwat_tiwari_st
Thank you sir.
Pls, explain the difference between java string and javabuilder.
why the string is un mutable in java??
Java has a concept of String Constant pool which says that no matter how many times we generate a string, it will be created only once in the pool and other will just point towards it or refer to it. This is because same string reference is used across various platforms. Say a String is used in database, at the server side and on the portal. Now if I want to change it on the portal, but I don't want to change it in database and on the server, so, if String is mutable, it will be changed at all 3 places. So, therefore it's made immutable in java.
What I mean by immutable is:
Suppose when I create a string x="shashwat"
It will be created in String pool.
Now if I create y="shashwat"
Here in this case, both x and y will refer to same "shashwat" String, and no new string will be created.
Now suppose, I want to change "shashwat" to "ShashwAT",
The string pool will now have two string one "shashwat" and the other one as "ShashwAT".
So, every time I make a change to the String "shashwat", a new string will be generated.
But, this is not the case with StringBuilder, here we change the same String. So, we have to choose where to use what. There is one more type StringBuffer. Read all three, it's a very interesting concept.
Anyways, this is why string is slower than StringBuilder.
@@shashwat_tiwari_st got it! Thank you so much, sir.
Wgat is the time complexity?
Thanku 😁😁
itne videos dekhne k baad ek acha video mila... good work bas video baar baar hazy ho jaa rha hai.. uspe thoda sa kaam krlo.. baki explanation perfect hai
thnks :)
tq
Bhaiya c++ mai bhi code explain kor na plz it's a request
Same he hai ..bas counter ko string mai convert karna hoga ..to_string function use karlo ho jayega ..
Bhai apka video dekhte ho aap shoot karne ke baad , focus hi set nahi hai har 10 sec. mein hil raha hai .
Counter was an integer type , how can be that append to a string variable without any type conversion?😅
It gets implicitly converted to String in java.
@@shashwat_tiwari_st oh okok... I'm a python programmer...so was just curious to know about java
But while we are writting the "res" section, the res one is string+int+string, why isnt it throwing error here.
Java String concatenation.
String + int + String , plus sign implicitly converts int to String.
@@shashwat_tiwari_st can you tell me about C++.. Coz I'm getting g error bcz of that
@@khushiagarwal2889 use to_string function in cpp to convert counter to String and then concatenate.
res = res + std::to_string(counter) + res;
Something like this.
@@shashwat_tiwari_st yeah I got the answer thanks😁
work on video clearity please rest is perfect
I will try my best. Please watch java dsa vidoes, for better clarity
nice explanation
good explanation