Problem solving is more like backtracking. You start with some notion and then try to validate deep further where the deepest idea which has met all the constraints and requirements by definition is the correct answer. Most computer problems/programming challenges/interview challenges are always tricky, hence the thinking has to be fast which comes with practice. But starting off by writing sample testcases/possible inputs to the problem and reverse engineering the problem could also help in some cases if the solution fails to meet a certain criteria. As far with computer programming challenges are concerned, its all about pattern mapping to problems which we have already solved before(thats how brain works) and then try to figure out a solution from that.
Gaurav, I love the way you communicate and are able to formulate your thought-process into words. In my opinion, that is the ability which makes you stand out from others. Yes, being good at competitive and System design is one thing, but you are a natural teacher.
Hi Gaurav, You have given a wonderful roadmap to develop problem solving strategy. This reminds me of the first principles approach to deconstruct the problem into smaller pieces and then work methodically. Once again thanks a lot.
aaaaahh, whenever i am just getting started with something, you come up with a video related to it! Amazing!. I am totally for this method of problem solving. Recently, i have been stuck on some problems by simply either writing code straight away or making changes to it and what not. I try by changing "
Thank you Gurav!, Your general approach to Problem solving, make me more confident in solving problems. I use it in college to pass finals and really works!
I am an aspiring coder and twice I have cracked Google code jam round 1. Two days back on 9th Feb ,i went to an interview in a product based company. I was asked to write a code on fibonacci series. Believe me , I started thinking of the for loops and damn I wsnt able to code it :( . I was just thinking of a reason and I guess ur video pretty much answers it. It's not how much u can code.but with what approach u get the solution . Thankful to u . Will be exploring the links in the description . And would be thankful if u can comment some examples where u have used the above approach or maybe post a video
I wish we were in same college and we did interesting things like this🙆♂️😂...I mean there is so much to learn from you and it's such a fun.... I would also appreciate if you can make a video on...How are you learning all this😂..so resourceful.
Have you applied this approach anywhere ? And what are your results regarding the same? PS: I will experiment with the exact framework for a week or so, thanks Gaurav for this :)
Hello Gaurav, I always dream of becoming good engineer who knows everything like time complexity, space complexity etc but when I try to read or solve Data structure it seems to be very boring to me, I am having 2year exp in JavaScript (Angular) etc
What the hell? I was searching about youtube algorithm and I clicked on it expecting something like that but its a maths problem 🤣🤣🤣At first I got confused but now I understood 🤦🏻♀️
You have a 1000-card deck with cards numbered from 0 to 999 that you'd like to sort. You have a small table to sort the cards on, which can hold up to 64 piles of cards. You can't stick cards in the middle of a pile, but you can split a pile into additional piles (as long as you don't go over the limit). Can you describe out a good way to sort the entire deck of cards?
Hi Gaurav i recently came to know about your channel and im glad i found it. I need a few suggestions before i start solving problems in coding platforms such as Hackerrank, codeforces etc pls share you experience in learning data structures and algorithms ,im lacking the skill to apply the right algorithm for a given problem How do I overcome this??
Maybe we can look at Approach and Strategy as different points...I could say I have multiple approaches, for each approach I have multiple strategies..what is your view on this?? Finally you mentioned that this works in long term contests and not in short term contests.. I assume you mean there is no time to go through the entire waterfall and just dive into some of these areas and attempt to get a solution. But is there a specific approach for quick solutions.
All the AI videos needed it. When dealing with a complex problem, representation is a key part of problem solving. My recent system design videos are very focused on the representation aspect.
yep! this approach wouldn't be that helpful in short contests, where you see the first solution on the table in minutes. It would be very helpful if you make a video on optimising dp problems after finding the recursive solution. Things like eliminating parameters and changing the state of the problem.
You still go through this procedure, just in your head :). And since problems in short contests are relatively easier to crack we think i just coded the solution right away!
Solving problems in competitive programming is mainly breaking down the unknown problem to a set of known problems. So the more problems you know the better your chances of success are. Just keep reading editorials, tutorials, new algorithms , data structure and keep solving problems. Knowing what data structure to implement will come to you only by practice. Although looking at constraints give you a pretty good idea.
Bro you are doing really good thanks yaar Or tmhara playlists sab v series mai ha I am getting started with learning programming so any tips and way to learn and path I think i should go through you playlists one by one from top to bottom by learning and applying it
Please give me some advice. I really need it. I did a codechef long challenge and solved 5 out of 8 problems in many days and many hours. Then I came to codeforces and saw the last div 2 contest problems.. I can't even solve the A, B and C problems there. I saw the tutorials but still can't understand the explanation after trying to understand it for hours. I am really disappointed and I know I have to do it anyhow as this summer I need to get into a good company. Please tell me what should I do in such a situation.
@@gkcs Hmm, in my opinion Brainfuck (en.wikipedia.org/wiki/Brainfuck) is better at making life simpler :P EDIT: Just read that Malbolge is built on the difficulty of Brainfuck and Befunge.
Solving problems will always remain an art, regardless of the science behind it. A method gives the art some structure. It doesn't take away from the beauty of it though.
If you are talking about Range Minimum Queries, you could have a look at Segment Trees or Sqrt Decomposition. Segment Tree: ua-cam.com/video/CN0N1ddJ9hA/v-deo.html Sqrt Decomposition: ua-cam.com/video/gWbDocYhwDA/v-deo.html
I want to master arrays (type od a data structure) manipulation, I'm learning c++, for example how to write an algorithm to rearrange the elements of an array so that the zeros come first than the negative elements next than the positive elements last. Can you make videos about this?
AH i have just jumped in compititive programaming a week before, and for mem programming looks wild, XD, every ties all logic needs to get worked , RIp me
problems where given an array and we need to find something based on gcd of all possible subarrays or subsequences, I can't make efficient way to solve these problems, can you help me with some of the named techniques.... any video or any comment regarding gcd topics will be helpful..
Most such GCD problems require us to do some precomputation or answer in ranges. You could try the problem: www.codechef.com/problems/GCDQ I will be making something on GCD soon. :-)
please give me a way or some instructions from where and how could i start coding? and one more question in which language? i really want to start competitive programming. i studing cse in public university in bangladesh. thank you :) .
It's faster than most other languages, so most competitive programmers choose that language. It's also shorter to write than languages like Java. However, there are some top competitive programmers who use Java too, like uwi.
Problem solving is more like backtracking. You start with some notion and then try to validate deep further where the deepest idea which has met all the constraints and requirements by definition is the correct answer. Most computer problems/programming challenges/interview challenges are always tricky, hence the thinking has to be fast which comes with practice. But starting off by writing sample testcases/possible inputs to the problem and reverse engineering the problem could also help in some cases if the solution fails to meet a certain criteria. As far with computer programming challenges are concerned, its all about pattern mapping to problems which we have already solved before(thats how brain works) and then try to figure out a solution from that.
Gaurav, I love the way you communicate and are able to formulate your thought-process into words. In my opinion, that is the ability which makes you stand out from others. Yes, being good at competitive and System design is one thing, but you are a natural teacher.
Yeah he articulates very well
Hi Gaurav,
You have given a wonderful roadmap to develop problem solving strategy. This reminds me of the first principles approach to deconstruct the problem into smaller pieces and then work methodically. Once again thanks a lot.
I didn't get it that you were talking about prime numbers. I should go to sleep now :( good content. Subscribed.
Hahaha 😁
lol 😂
🤣🤣🤣🤣🤣🤣
Me too
aaaaahh, whenever i am just getting started with something, you come up with a video related to it! Amazing!. I am totally for this method of problem solving. Recently, i have been stuck on some problems by simply either writing code straight away or making changes to it and what not. I try by changing "
Thanks Divyansh! Long, and informative comment :-)
Xd,, same
This is a good observation. I do this all the time, and it feels like a huge waste of my time.
Learning a lot from your channel. I am a failed programmer, hope one day I will get a good job because of you. Thanks for the wonderful video.
Good luck for you, bro :)
Man, I am a failed programmer, too. I cannot solve any problem.
Hey, it has been a year since you wrote this comment. Any good news yet?
I'm interested too
@@xordux7 How could I get notifications for this thread?
Thank you Gurav!, Your general approach to Problem solving, make me more confident in solving problems.
I use it in college to pass finals and really works!
Awesome work Sebastian, congrats!
An algorithm to solve algorithms
So meta 😛
Inception
Love the enthusiasm my man! Also, great explanation! Subscribed and liked!
Much appreciated!
Thanks Gaurav.. finally i have started reading the text on questions and practicing to represent input formats..
We need more videos like this!
I am an aspiring coder and twice I have cracked Google code jam round 1. Two days back on 9th Feb ,i went to an interview in a product based company. I was asked to write a code on fibonacci series. Believe me , I started thinking of the for loops and damn I wsnt able to code it :( . I was just thinking of a reason and I guess ur video pretty much answers it. It's not how much u can code.but with what approach u get the solution . Thankful to u . Will be exploring the links in the description . And would be thankful if u can comment some examples where u have used the above approach or maybe post a video
Can you tell me plz From where you learned competitive programming
Interview tomorrow and am super nervous! this was very helpful btw
Observation on sample examples works for most of the time.....observing the pattern in it is main thing...
Sometimes the algorithm we choose defines the representation. But this is a good map to consider
systematic way to solve the problems.Liked it
Helped me alot thank you, I can see that you are going to be a teacher in the future
Good one, Gaurav Sir... I endorse this method greatly as I have practically applied it and I've been successful. Regards.
Glad to hear that 😁
Super useful brother...thanks a ton ❤️..much love
I wish we were in same college and we did interesting things like this🙆♂️😂...I mean there is so much to learn from you and it's such a fun....
I would also appreciate if you can make a video on...How are you learning all this😂..so resourceful.
Hahaha, maybe someday 😁
good lesson, and thanks. it’s basically a feedback loop
Have you applied this approach anywhere ? And what are your results regarding the same? PS: I will experiment with the exact framework for a week or so, thanks Gaurav for this :)
3:42 Minimized the video and googled "what the hell is a link-cut tree ?".
lol
Awesome Bro!
Pretty objective, thanks for share, cheers from Brazil o/
GKCS, you are amazing, Thanks for awesome videos
Thanks Ashish!
How to Solve it by G. Polya has an approach for math, applies to pretty much any computational problem too.
This a very good approach , thanks
A very very good video I can understand full video
Glad to hear that!
Hello Gaurav,
I always dream of becoming good engineer who knows everything like time complexity, space complexity etc but when I try to read or solve Data structure it seems to be very boring to me, I am having 2year exp in JavaScript (Angular) etc
This is really beautiful.
What the hell? I was searching about youtube algorithm and I clicked on it expecting something like that but its a maths problem 🤣🤣🤣At first I got confused but now I understood 🤦🏻♀️
You have a 1000-card deck with cards numbered from 0 to 999 that you'd like to sort. You have a small table to sort the cards on, which can hold up to 64 piles of cards. You can't stick cards in the middle of a pile, but you can split a pile into additional piles (as long as you don't go over the limit).
Can you describe out a good way to sort the entire deck of cards?
Thanks Gaurav.
How do you expect us to get what any of this means if you don't demonstrate with an example?
Nice thought process :)
Hi Gaurav i recently came to know about your channel and im glad i found it. I need a few suggestions before i start solving problems in coding platforms such as Hackerrank, codeforces etc pls share you experience in learning data structures and algorithms ,im lacking the skill to apply the right algorithm for a given problem How do I overcome this??
I find Codeforces the best amongst them.
@@gkcs Thank you
Maybe we can look at Approach and Strategy as different points...I could say I have multiple approaches, for each approach I have multiple strategies..what is your view on this?? Finally you mentioned that this works in long term contests and not in short term contests.. I assume you mean there is no time to go through the entire waterfall and just dive into some of these areas and attempt to get a solution. But is there a specific approach for quick solutions.
You make a good point. One must adapt their methods according to circumstances.
2. Representation. Have you elaborated it anywhere on your another video perhaps?
All the AI videos needed it. When dealing with a complex problem, representation is a key part of problem solving.
My recent system design videos are very focused on the representation aspect.
I wish I could like this video more than once :)
Anmol Mishra Yes offcourse you can like the video twice...😂
Are prime numbers the same as odd numbers.. I'm talking about the example you gave 1
yep! this approach wouldn't be that helpful in short contests, where you see the first solution on the table in minutes.
It would be very helpful if you make a video on optimising dp problems after finding the recursive solution. Things like eliminating parameters and changing the state of the problem.
You still go through this procedure, just in your head :). And since problems in short contests are relatively easier to crack we think i just coded the solution right away!
I think first 3 steps are always done in our mind :p :p
please provide tutorial on when and which data structure to implement depending up on the situation.
Sidhant Mishra It is easy to find which data structure to use while looking at the problem, the main catch is to code it and make it accepted.
Solving problems in competitive programming is mainly breaking down the unknown problem to a set of known problems. So the more problems you know the better your chances of success are. Just keep reading editorials, tutorials, new algorithms , data structure and keep solving problems. Knowing what data structure to implement will come to you only by practice.
Although looking at constraints give you a pretty good idea.
Can u please explain this by taking one problem and then apply these pointers so that it could be more clear what each pointer practically means.
Bro you are doing really good thanks yaar
Or tmhara playlists sab v series mai ha
I am getting started with learning programming so any tips and way to learn and path
I think i should go through you playlists one by one from top to bottom by learning and applying it
That's the way :)
I think I am very dumb to solve
computer science problem.. Can I still solve the problem with this approach?
This is very helpful for me
VERY NICE APPROACH IT REALLY HELPED ME😊
Please give me some advice. I really need it.
I did a codechef long challenge and solved 5 out of 8 problems in many days and many hours.
Then I came to codeforces and saw the last div 2 contest problems.. I can't even solve the A, B and C problems there. I saw the tutorials but still can't understand the explanation after trying to understand it for hours.
I am really disappointed and I know I have to do it anyhow as this summer I need to get into a good company. Please tell me what should I do in such a situation.
Sometimes we already know the definiton, represenstation, & the approach phase, so we jump to the algorithm phase.
You but not everyone
Which language should I implement algorithms I k now c , python, java
+Incredible India You should try Malbolge, it does make life simpler. :-p
On a serious note, any of the above are good enough to start with.
@@gkcs Hmm, in my opinion Brainfuck (en.wikipedia.org/wiki/Brainfuck) is better at making life simpler :P
EDIT: Just read that Malbolge is built on the difficulty of Brainfuck and Befunge.
@@KunalSwami Hahaha, exactly!
I actually think like how my brain will solve this problem, I my brain can't do it, I certainly can't write any algorithm for it.
Great video
Man I love You. awesome Bro
Maybe having a methodical approach remove the funride we go through while programming. Don't you think so?
Solving problems will always remain an art, regardless of the science behind it.
A method gives the art some structure. It doesn't take away from the beauty of it though.
hello, I'm a student at university and I've got a question... Does it normal not to be able to solve the algorithm problems?
Please make some videos on DP , btw love ur channel
Coming up next!
Thanks for the feedback :-)
u earned a sub today
sir please provide detail explanation of basic graph problems with stl implementation
U wont tell dp and its thought process , right??
I am going to mentioning this comment in the next video. :-P
Wait for my answer there!
Can you make a video of Wavelet Trees ? :D
Reading up on it. Seems very interesting...
Coool :D
He made the video.. ua-cam.com/video/CybAgVF-MMc/v-deo.html .... Gaurav is awesome!
Good...
Do u live out of india
Please make a video on stl maps, set
"in our language means" haha yes we are another world lol
1:39
This guy is ceo of whiteboard
Amazing!
Thanks Andrei!
what i do. works always
get problem -> break it to small -> solve one fucking thing at a time -> combine all -> problem solved.. \
Could you please tell the best book to learn Data structures and algorithms...
Google it.
Thanks!
Also make a video on query questions, how to solve a query question
If you are talking about Range Minimum Queries, you could have a look at Segment Trees or Sqrt Decomposition.
Segment Tree: ua-cam.com/video/CN0N1ddJ9hA/v-deo.html
Sqrt Decomposition: ua-cam.com/video/gWbDocYhwDA/v-deo.html
if possible,please make a video on June long challenge PRMQ problem.
Hi Rahul!
I am considering it...might skip it though, because it uses data structures we have previously talked about.
I want to master arrays (type od a data structure) manipulation, I'm learning c++, for example how to write an algorithm to rearrange the elements of an array so that the zeros come first than the negative elements next than the positive elements last. Can you make videos about this?
it's good for job interview ;)
AH i have just jumped in compititive programaming a week before, and for mem programming looks wild, XD, every ties all logic needs to get worked , RIp me
by default I think like that
Improve the audio quality please
But how do u think of the algorithm in the first place
That's the part of problem solving. You define and then represent. The algorithm is a set of steps you choose to solve the problem.
@@gkcs That's where I get stuck. Finding those steps
Is this from art of problem solving?
It's actually from an MIT professor of AI. You can have a look at the video description.
@@gkcs Thanks
I have the t-shirt :)
why am I just finding this.....
can you plz upload the videoes on codechef snackdown elimination round contest held on 3rd june...
problems where given an array and we need to find something based on gcd of all possible subarrays or subsequences, I can't make efficient way to solve these problems, can you help me with some of the named techniques.... any video or any comment regarding gcd topics will be helpful..
Most such GCD problems require us to do some precomputation or answer in ranges. You could try the problem:
www.codechef.com/problems/GCDQ
I will be making something on GCD soon. :-)
somewhat similar to XOR problems??
Yes, ranges tend to do that. But sometimes you need to work out a bit of math to simplify the query for the subarray
please give me a way or some instructions from where and how could i start coding? and one more question in which language? i really want to start competitive programming. i studing cse in public university in bangladesh. thank you :) .
Start with Python 3 bez its easy
I see mostly top ranking coder solve problem in c++ in code jam. Why they are prefer c++ other than?
It's faster than most other languages, so most competitive programmers choose that language. It's also shorter to write than languages like Java.
However, there are some top competitive programmers who use Java too, like uwi.
What is mean of gkcs
What is gkcs
what an expression at 3:04
Me: That's the girl I was talking about, but don't look.
My friends: 1:39
😂😂
why don't you show it head on rather than describing....
There's videos on editorials on this channel. Try them out 🙂