
How to build Strong Programming logic? | Problem Solving Skills improvement | Placement series 02
How to build Strong Programming logic? | Problem Solving Skills improvement | Placement series 02
How we can built logic as a beginner. When I started my journey I always used to think that coding is not for me. But later I realized that if I don’t give me a shot, How can I judge myself without trying. I used some personal strategy to improve my coding, I Hope it will be helpful for you guys also. DSA is a heart of placement.
connect to me on Instagram: https://rohit978.page.link/insta
Linkedin: https://rohit978.page.link/linkedin
Telegram: https://rohit978.page.link/telegram
Telegram: rohit_negi_family
Content
0 -> Give me only 21 days of your life
2.2 -> I promise that I will find a way for you to have a pleasant coding journey.
9.567 -> Sometimes when we think about a problem, our brain gets blank.
15.634 -> I was also the same throughout my B.Tech. journey. I felt that coding was not for me.
19.9 -> My brain didn't work as the questions came. Then we see others whose logic clicks faster, and we feel demotivated and jealous. Everything comes together.
26.6 -> This is so common.Today I will take you to the roots of these.
30.048 -> from where the problems start.What are the mistakes we have made throughout our journey? I will tell you everything in a detailed manner in this video.
35.846 -> Whatever I'm telling you, if you follow that for 21 days that will become a habit.
42.667 -> I'm not telling you that you will become a star, but you will get a path that teaches you how to build logic.
47.765 -> Today I will share a unique strategy that I have followed and no one on the youtube told you that strategy before. Let's get started.
53.297 -> INTRO
61.367 -> at first whenever a problem comes how to solve that. I will always recommend you solve topic-wise problems.
67.434 -> First solve the array, then the string, This is how you should proceed.
71.074 -> If you solve sometimes array, sometimes DP, sometimes heap, then the link between them will not be created.
76.466 -> first pick easy questions of array, atleast your mind should have known that I'm solving an array question
84.131 -> if you are solving random questions and your mind does not know from which topic the question is like graph,DP
90.234 -> So first you have to make your mind smoothly convinced that you are solving the question of array, so you will only think about array.
98.199 -> I will think about the variations of the array.
100.591 -> Why do we have to solve easy questions? because easy questions will build confidence.
104.3 -> You can even solve the sum of all the elements of an array. There is no shame about it. Basic questions will build our confidence.
112.6 -> Recently, we have been watching the IPL, and we have seen Kuldeep Yadav perform poorly in previous years for KKR. He lost his confidence.
120.7 -> When he came to Delhi, he took small steps. He performed well in a match, which gave him confidence. Then he performed better.
127.698 -> I'm also telling you to start with a small level and you will perform better in the upper levels.
131.777 -> He also did the same. He performed well in a match then two. He has got the motivation now and he is performing well in every match.
136.464 -> Now the most important part is how to implement it.Problem is everybody is giving knowledge, but no one is telling you how to do that.
143.4 -> If I explain it to you with an example of a question, it will be more beneficial to you.
147.439 -> The question is, you have given an array of an odd size of five elements, which are 1 2 1 2 5, and you have to tell which is the unique element of this array.
159.967 -> All the other elements are appearing two times, but there is one element which is appearing only once. I have to find that.
165.397 -> Many of you can solve this, but taking it from brute force to an optimised approach is difficult.
172.691 -> In the brute force method, I will not tell you to think the code but rather to connect it with real life.
180.51 -> You have five coins. One is a one rupee coin, one is a two rupee coin, one is a one rupee coin, one is a two rupee coin, and one is a five rupee coin.You have to tell which one is unique.
188.7 -> Pick up one rupee coin and check to see if there is another one rupee coin, then two rupee coins to match, and finally a five rupee coin, and you will find that it is unique.and you will tell the answer.
199.034 -> For that, you have to convert that into code. For that, you have to be familiar with the syntax of a language. You will find the answer very easily using the for loop.
210.4 -> If you take any coding question and connect it with a real-life example, you will solve the problem very easily.It was a basic question but try to solve all other question like this.
219.567 -> how to solve the same problem in a more optimised way.
222.044 -> Now I can do that. I can sort the coins. That means I will arrange the coins in ascending order.
227.67 -> Like 1 1 2 2 5, then I can easily see which is unique element when we get two different elements that are not unique. have you understood the logic
236.267 -> Then we have to find which algo we will use in sorting. optimised One is merge sort. If I use that, it will become n log (n) from n^n.
243.7 -> Can I optimise it further when I have seen it for the first time, I can think only up to n log (n), but there is one more solution to this.
251.25 -> Don't panic if you can't think of the logic, but make sure if you have seen this type of problem once, next time you can solve it easily.
260.126 -> The next solution to this is XOR. In the XOR operation, when we have two identical elements, like 0 and 0, the output is 0. When it is different, like 0 and 1, its output is 1.
270.534 -> We will use the same logic here. We will use XOR on the whole array.
274.034 -> One XOR two, then second with third, third with fourth, and fourth with fifth, then I will get the output five. You can solve it with your copy. You will also get the answer.
283.034 -> When one and one rupee coin perform XOR, they will make zero, two and two will also make zero, and zero and zero is obviously zero when zero and five will perform XOR it will give you five answers.
293.1 -> Try it in your copy. Then you will understand the logic. I have only explained it visually, but when you do it in your copy, it will become more clear.
301.67 -> Now you have understood that XOR operation can differentiate elements like this. This is how you can write your algorithm like how I have said the XOR operation.
310.6 -> So, first think brute force approach. I will not tell you to divide the problem into sub problems because at beginner level, our brain doesn't think like that.
317.655 -> I will tell you to connect the problem with a real-life example, then try to solve it.Any question will become easy.
323.067 -> This question may have more solutions. Try to find it on your own.
328.415 -> Let's say if you cannot solve the problem, then will you become demotivated? No. Just see the editorial. There is a detailed solution given.
336.158 -> If you still don't understand it from the editorial, no problem. Even though I can't understand the editorial from GFG or Leetcode, when a new algorithm comes, we cannot understand it from the editorial.
343.184 -> Just copy and paste the question on youtube. You will get five to ten lectures on that topic. Play it 3-4 times. Understand it slowly, then make your own notes.
354.133 -> Many students make mistakes and copy paste that code. You have to write the code. Even if you copy the code line by line, no problem, but you have to write on your own.
366.267 -> When you write the code, the connection between your mind and the code becomes strong. When you are copying, you are also thinking, but if you copy and paste it, then compile it and pass all the test cases, it is wrong.
377.271 -> Even if you think that you have understood the logic, till you haven't practised it with your hands, it's not done.
383.609 -> Even in schools, when the teacher solves it, we feel that we have understood, but if we haven't practised it ,in an exam after one or two lines, we cannot solve it.
392.273 -> If you don't practise it, you can't understand it. Even if you are copying it, copy it line by line with understanding. There is no problem.
398.54 -> Next, you have to make your own notes in a proper manner.
403.086 -> The strategy is to finish any lectures you're watching. If you are watching Array, first finish it.
410.141 -> After that, go to a coding platform like GFG, Interviewbit, or Leetcode, whichever you like.
416.373 -> Write code. Start with easy problems, then make notes and, after all, revise it every week. Then go to step one. You have to follow this cycle.
427.733 -> Revision is a must. Don't think if you solve this next time you will get it right.
432.95 -> if you do the revision that will develop the thinking .you will have that confidence that if you see the problem again you will solve it.
439.374 -> All things depend upon practice. If you stay consistent throughout your journey, only then the logic will become clear.
445.716 -> Logic building depends upon practice. There is no rocket science in it. No one can give you a magical formula.
455.148 -> Start practising questions, make notes, revise them. That is the whole strategy.
460.847 -> Whichever problem you are solving, try to connect it with a real-life example like I have given you the coin example that you have to code.
476.567 -> The last point is to reward yourself every fifteen days.
486.855 -> In this 21-day strategy, you don't have to code for 7-8 hours. You have to only code for 3-4 hours that can change your life.
497.526 -> Now some motivation
498.777 -> Some students keep saying that brother, I don't get time in college. If you give these excuses to yourself, then I can tell you can't get a good package.
507.767 -> A person who makes excuses can't get success. who doesn't have time. Even Ratan Tata, sir, has time after managing that kind of big business. you have to find time.
520.7 -> One good job can change the fortunes of the entire family. If you influence the surrounding people, you may become their inspiration.
532.367 -> You have also thought that you want to become like that bhiya (elder brother) or didi (elder sister). You will have an impact on your society.
547.159 -> The next big motivation is money. If you have money, you can do anything. You have that freedom. It is also a great motivation to start coding.
556.738 -> If you get a good job, you get so much respect from society.
568.733 -> become more serious about your coding if you are watching this, it also means you are serious.
573.533 -> Whatever I have told you in this video is only 10%. If you don't implement it, you will get back to zero.
583.333 -> If you take it to the next level, I can tell you that your life will change.
589.033 -> Good luck for your better future.
Source: https://www.youtube.com/watch?v=CpD1IY1y3dE