After watching multiple videos by you, I keep asking myself this question: "is this guy a well-established competitive programmer?" I tend to always ask myself this during the introduction of your videos.
An idea for how one could optimise problem 1 further: You don't need to consider all of the 0s in the grid as potential 0s to flip. The only zeros that matter are the ones which are adjacent to a 1 (i.e., that lie in the exterior boundary of your connected components of 1s). And you can find all of these as you are doing your search that finds the components: every time one of the neighbours you encounter is a 0, you record the coords of that 0 and that the 0 was adjacent to the current component. So at the end of your search you have the size of each component, and for each boundary 0 you have a list of components which that 0 is adjacent to. Then for each such 0 you compute 1 + sum of sizes of adjacent components, and output the max. If the number of boundary 0s is O(n^2) this will be slower (though still O(n^2)), but if it is say O(n) this approach should be much faster. Consider a grid which is almost all 0s, you really don't want to try flipping all of them.
The one and only cp best channel.....Keep growing up bro.....Soon this channel will be one of the best cp channel in the world.....This channel also now on fire🔥
How do you generalize? I mean, I could memorize the solutions or link the solutions to specific problem - but you seem to actually solve it from first seeing the problem.
Wow, I didn't understand any of this and I'm trying to get an entry level job/internship coming from a business background. I took a bootcamp for web development using javascript, css, and html and then some back-end work using mongoDB and this wasn't enough for anyone to give me a call back. If this is the level for FANG, where do I start for beginner level jobs? Do you have a job?
Start out with Data Structures, then move on to Algorithims, to understand the stuff for the interviews. To get in the door, you need to improve your resume, there is tons of resources on the internet on how to make a good resume for a coding job, I'd check out cracking the coding interview, reddit, and use google as well. It probably would be wise to build a project with front-end and back end, or a really good idea would be is find a certain company you're interested in, see what their stack is, and make a project with that same stack. Good luck!
Just a note, I went out of my way to choose some of the hardest FAANG questions from the lists I found. So not everything will be this hard. I've never actually applied for a job/internship, so I don't know what it's really like, but I would imagine it's on average way more reasonable than the questions in this video.
Hi, do u think the reason for early success in cp is due to having good math background? It's popular opinion that those who achieve success in contest usually already have good math skills?
Coming in with a strong math background would definitely help, since mathematical reasoning can be a huge factor in solving these kinda of problems. That being said, if you don't have such a background, you can still learn the necessary reasoning and be able to succeed.
Many top competitive programmers that I know of also competed in the Math Olympics (or other math contests) when they were younger. I don't think it's a coincidence that they also happen to dominate cp. Though, there is also many other factors other than just having math experience.
I'm a novice as far as coding algorithms go, but I have a strong background in mathematics and I found the Amazon problem to be trivially easy. The number of ways you can write an integer as a sum of consecutive integers is the same as the number of odd factors that it has because the average of an odd number of consecutive integers is an integer but not for an even number. If I could relate the other problems to mathematics more easily, my ability to develop new or use existing algorithms would be dramatically improved. Does anyone have any advice on how I can establish this relationship and connect the two fields in my brain? What's the relationship between computer science algorithms and mathematics, in general?
After watching multiple videos by you, I keep asking myself this question: "is this guy a well-established competitive programmer?" I tend to always ask myself this during the introduction of your videos.
thank you for these videos! as an entry level coder, who only knows his way around java, these videos are great to expand the knowledge !
Awesome walkthrough on your solutions.
Confirming the first question is still being asked. Just got it yesterday.
g0d level explaination , thank u for such great content ❤️❤️
An idea for how one could optimise problem 1 further:
You don't need to consider all of the 0s in the grid as potential 0s to flip. The only zeros that matter are the ones which are adjacent to a 1 (i.e., that lie in the exterior boundary of your connected components of 1s). And you can find all of these as you are doing your search that finds the components: every time one of the neighbours you encounter is a 0, you record the coords of that 0 and that the 0 was adjacent to the current component.
So at the end of your search you have the size of each component, and for each boundary 0 you have a list of components which that 0 is adjacent to. Then for each such 0 you compute 1 + sum of sizes of adjacent components, and output the max.
If the number of boundary 0s is O(n^2) this will be slower (though still O(n^2)), but if it is say O(n) this approach should be much faster. Consider a grid which is almost all 0s, you really don't want to try flipping all of them.
Congrats for growing up the channel, you're such a good motivation
Holy that lower bound set is huge. I can solve many problems with this idea. Thanks 😊
I really loved your step by step solution to the Amazon question! Thanks for sharing
I'm glad the solution made sense to somebody, lol. When asked those mathy algo questions, my answer is usually a blank stare
Thanks a lot Colin,
Kindly keep making these type of videos, your explanation is quite good.
I'll watch it again later. Good job Colin!
Awesome content! Found your channel not long ago and had to subscribe. Please keep up the great work!
This is very easy understand . Please continue making more explanation videos
The one and only cp best channel.....Keep growing up bro.....Soon this channel will be one of the best cp channel in the world.....This channel also now on fire🔥
yeah i love cp
Loved the video, thanks Colin!
The merge sorted arrays actually now asks for a O(log(m+n)) solution ,using binary search its kinda hard
Thank you for always sharing the good stuff.. 🙏🙏
Woah! This is awesome! Thanks for making this :)
Yay!!! I subscribed just so you would make this video. Thanks!!!
How do you generalize?
I mean, I could memorize the solutions or link the solutions to specific problem - but you seem to actually solve it from first seeing the problem.
Can you apply for jobs and interview for fun just to see their jaw drop as soon as start coding up the solution
Wow, I didn't understand any of this and I'm trying to get an entry level job/internship coming from a business background. I took a bootcamp for web development using javascript, css, and html and then some back-end work using mongoDB and this wasn't enough for anyone to give me a call back. If this is the level for FANG, where do I start for beginner level jobs? Do you have a job?
Start out with Data Structures, then move on to Algorithims, to understand the stuff for the interviews.
To get in the door, you need to improve your resume, there is tons of resources on the internet on how to make a good resume for a coding job, I'd check out cracking the coding interview, reddit, and use google as well.
It probably would be wise to build a project with front-end and back end, or a really good idea would be is find a certain company you're interested in, see what their stack is, and make a project with that same stack.
Good luck!
Just a note, I went out of my way to choose some of the hardest FAANG questions from the lists I found. So not everything will be this hard.
I've never actually applied for a job/internship, so I don't know what it's really like, but I would imagine it's on average way more reasonable than the questions in this video.
Hi, do u think the reason for early success in cp is due to having good math background? It's popular opinion that those who achieve success in contest usually already have good math skills?
Coming in with a strong math background would definitely help, since mathematical reasoning can be a huge factor in solving these kinda of problems. That being said, if you don't have such a background, you can still learn the necessary reasoning and be able to succeed.
Many top competitive programmers that I know of also competed in the Math Olympics (or other math contests) when they were younger. I don't think it's a coincidence that they also happen to dominate cp. Though, there is also many other factors other than just having math experience.
not necessarily related, but what do you do to grow out and maintain your hair
Cant we just Use Union find in Problem 1?
as someone who "knows how to program", I don't know how to program.
kkk same
I'm a novice as far as coding algorithms go, but I have a strong background in mathematics and I found the Amazon problem to be trivially easy. The number of ways you can write an integer as a sum of consecutive integers is the same as the number of odd factors that it has because the average of an odd number of consecutive integers is an integer but not for an even number. If I could relate the other problems to mathematics more easily, my ability to develop new or use existing algorithms would be dramatically improved. Does anyone have any advice on how I can establish this relationship and connect the two fields in my brain? What's the relationship between computer science algorithms and mathematics, in general?
👍👍👍
You are girl or boy
Really?
Hes god
Are you blind, deaf, or both?