Python for Coding Interviews - Everything you need to Know

  Рет қаралды 476,470

NeetCode

NeetCode

Күн бұрын

Пікірлер: 293
@NeetCode
@NeetCode 2 жыл бұрын
🚀 All of the code is available at: neetcode.io/courses/lessons/python-for-coding-interviews Timestamps: 1:13 - variables 2:40 - if-statements 4:00 - loops 6:06 - math 8:40 - arrays 12:38 - sorting 13:40 - list comprehension 14:20 - 2-d arrays 15:25 - strings 16:50 - queues 17:30 - hash sets 18:25 - hash maps 20:15 - tuples 20:55 - heaps 22:30 - functions 22:55 - nested functions 24:20 - classes
@anonforever123
@anonforever123 2 жыл бұрын
What is the theme you are using brother?
@masternobody1896
@masternobody1896 2 жыл бұрын
thanks
@andrewaranas8853
@andrewaranas8853 2 жыл бұрын
@NeetCode graph theory course pls.
@jeevaalok1467
@jeevaalok1467 Жыл бұрын
@NeetCode i need a suggestion from you , i know python & c++ very well . so which one i should choose for interview purpose ? i mean which one is better ? please reply it really helps a lot
@marioamatucci
@marioamatucci Жыл бұрын
for queue I'd have mentioned something like ``` from collections import deque q = deque([1,2,3],maxlen=3) print(q) q.append(-1) print(q) q.appendleft(-2) print(q) ``` better than random op like here that does not show the queue essence :)
@perezident14
@perezident14 2 жыл бұрын
This video came out less than 12 hours after I failed to pass a coding assessment question that I did using Python. I never wrote Python code, but JS wasn’t an option for the assessment. I somehow managed to make it to the next step of the interview and I am not taking this video for granted. Thank you so much! 🎉
@rj5697
@rj5697 Жыл бұрын
I started to learn Python before I did a web-dev bootcamp that was just JS. I have an interview assessment where JS isn’t available and I have to use Python, and making the switch back has been…difficult lol. So I’m with you as far as not taking this video for granted lol.
@GokulPonnappanPillay
@GokulPonnappanPillay 7 ай бұрын
Bro how's that even possible ? What kindof questions they asked? Would be helpful to know
@NphiniT
@NphiniT 4 ай бұрын
I have interview in 15 minutes 😬
@zaboomafia
@zaboomafia 2 ай бұрын
What was the coding problem you were provided?
@JaredT
@JaredT 6 ай бұрын
This video gives me life. If this video would ever cease to exist, I’d cry.
@SaiManasaPappu
@SaiManasaPappu 11 ай бұрын
This video is everything I've learned about Python in the last 3 months and more! Thanks for such on-point crisp content, and for putting it all in one single video unlike other KZbinrs who make multiple never-ending clips with repetitive content
@midhunkrishnan5988
@midhunkrishnan5988 Жыл бұрын
I started learning DSA with Python today and I wanted a Python refresher. as I had lost touch with it. Luckily, I came across this video and I can't believe this 26 min covered all topics. Thank you so much!
@peterwanjihia2372
@peterwanjihia2372 Жыл бұрын
how is it going ??
@shelbypereira
@shelbypereira 11 ай бұрын
small note: it may be mentioned in the video but really the points on "arrays" are really discussing "lists". Arrays are distinct in python and available as part of the numpy package but generally only used for situations where memory is a consideration. Also true numpy arrays cannot be resized. For a nit picking interviewer this may be important. Video is excellent , great way to cram for an interview!
@anujrana1509
@anujrana1509 Жыл бұрын
This is probably the best tutorial for someone who knows another programming language and wants to learn python. Thank you for the tutorial :)
@SAURABHKUMAR-uk5gg
@SAURABHKUMAR-uk5gg 2 ай бұрын
This is the best video I have seen on using Python for anything
@piyusharyaprakash4365
@piyusharyaprakash4365 Жыл бұрын
you convinced me to change from javascript to python for coding interviews
@macolulu
@macolulu Жыл бұрын
You are a true genius. The way you display the output is so easy to see. The comments on the code are so visual. By watching your videos I started to like practicing interview questions and algorithms in general and feel sorry that I was not learning algorithms in school in the clear way that you demonstrate to us. All in all, I am grateful that I found your channel.
@picnicbros
@picnicbros Жыл бұрын
Used to solve most LeetCode problems using Java but thanks to you I picked up Python and agreed that it's much easier to use for interview problems where ideas are more important. This video is really helpful for me to perfect my Python skills
@Gamekiladhi7
@Gamekiladhi7 6 ай бұрын
Heyy as indian can i solve dsa in python n gove job intevriew with python
@harumambaru
@harumambaru 2 жыл бұрын
Thanks, I am using python at work for more than 6 years and heaps and nested functions was new and very useful info for me. 1:23 Short addition to printing that can save you time if you do a lot of prints print(f'{n=}') is the same as print('n = ',n)
@AustinCS
@AustinCS Жыл бұрын
Not sure if it was mentioned or not, but for problems like path sum II it can be useful to understand deep copy vs shallow copy.
@Lewis64
@Lewis64 2 жыл бұрын
This is the best cheatsheet for python syntax ever. Got a coding interview tomorrow, thank god you posted. ❤
@ephremtadesse3195
@ephremtadesse3195 4 ай бұрын
I found this tutorial to be the most precise yet packed with fascinating details! For kicks, I totally get all the Java lingo!
@sabaamanollahi5901
@sabaamanollahi5901 2 жыл бұрын
Thanks NeetCode! can't wait for your system design videos :)
@meetgandhi4176
@meetgandhi4176 7 ай бұрын
At 7:09, The answer which is round off to -1 is definitely correct as -1.5 has been round to a bigger value to -1. It shows the value greater than or equal to 0.5 can be rounded off to correct value to its next greater integer value (1.5 can be rounded off to greater value 2 in positive no., and (-1.5) will be rounded off to greater value (-1) in negative no.) Yep, the explanation for it is awesome. Sometimes, its bit tricky for someone to find the particular negative value and might stuck over it. Thanks.!
@asylzhantatibayev1538
@asylzhantatibayev1538 Жыл бұрын
I think the world rests on people like you. Thank you so much!!
@NeetCode
@NeetCode Жыл бұрын
Np 🙂
@535emon
@535emon 2 жыл бұрын
This is where I can get everything I need for coding part of my interview. Thanks Neetcode. You have given us enought
@streambai1045
@streambai1045 9 ай бұрын
I started to learn Python about two months ago, and this is the best training video for Python.
@SamyuktaNeeraj
@SamyuktaNeeraj Жыл бұрын
This is such a brilliantly constructed video! Thank you so much. Could not have learned all this python I need for interviews without your help!
@Kakashi75
@Kakashi75 Жыл бұрын
The most recent version of python released updated syntax allowing the use of increment ++ and decrement -
@bombrman1994
@bombrman1994 Жыл бұрын
this was so good, I was like 50% confident with my python collection skills and now I am alot more confident. I can simply google what I know that exists even if i forgot the syntax. This is what I truly need content that can show me that something exists to know what to search. We don't know what we don't know
@nathanyao3525
@nathanyao3525 2 жыл бұрын
this was exactly what i was looking for, thank you! Perfect timing
@RegularGuyJake
@RegularGuyJake Ай бұрын
This video was so good! Took a ton of notes to prepare for my upcoming interview. Actually learned some very cool tricks! Didn't know that nonlocal trick, I've been just returning my data structures out of my functions and passing them around that way my whole life!
@ankit28goyal
@ankit28goyal 5 ай бұрын
This is just amazing! I always look to refresh my python syntaxes after I stop coding in this language and waste time again and again. This video is so crisp and to the point.
@nicholasscotto3712
@nicholasscotto3712 Ай бұрын
an array is a list? and a hashmap a dictionary? yes?
@carlossilva6579
@carlossilva6579 15 күн бұрын
Very helpful! I studied Python a few years ago, but I didn't remember many things in this video. Thanks!
@diale13
@diale13 11 ай бұрын
The best tutorial for someone who knows another programming language and wants to learn python
@terrypark3690
@terrypark3690 2 жыл бұрын
Great video I've been trying to get around to learning python and this is a great brief on what's different from other coding languages saved me so much time.
@adamrizk6735
@adamrizk6735 Жыл бұрын
Great video as usual, loved how concise and straight to the point it is. You've convinced me to switch from Java to Python for interviews and programming puzzles 😁
@sarthakgupta290
@sarthakgupta290 Жыл бұрын
For guys like me who are switching from Java to Python for LeetCoding, this is really helpful!
@harshivam
@harshivam Жыл бұрын
why you're shifting?
@sarthakgupta290
@sarthakgupta290 Жыл бұрын
@@harshivam Python syntax is much shorter and easier to write. I am NEVER EVER going back to Java for coding interviews
@hritikroshanmishra3630
@hritikroshanmishra3630 7 ай бұрын
@@sarthakgupta290 is it good go in coding interview with python??????
@sarthakgupta290
@sarthakgupta290 7 ай бұрын
@@hritikroshanmishra3630 Absolutely
@atifzia124
@atifzia124 Ай бұрын
But in some companies they don't even mention python as an option to write code.
@dustinhxc
@dustinhxc Жыл бұрын
Wonderfully typed! Love the comments in the code! Thank you for this video!
@vladimirkim411
@vladimirkim411 2 жыл бұрын
Thank you so much! Loved how concise and clear your examples are!
@Test-br2sm
@Test-br2sm 2 ай бұрын
There is a way to generate the max heaps in Python. The heapq's module has "_heapify_max" and "_heappop_max" methods. You can test it with this code: "import heapq test = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] max_heap = heap._heapify_max(test) while test: print(heapq._heappop_max(test))" I'm not sure why they created them as a protected member of the module, but this is absolutely working fine.
@PyckledNyk
@PyckledNyk 6 ай бұрын
Python is also a good intro to more complex languages since it uses a lot of coding conventions that can be found in other popular languages
@anselmobd
@anselmobd 11 ай бұрын
Great video! But, regarding the code shown at 6:30 of the video, I must clarify that the correct mathematical result of "-3 // 2" is "-2". This is because in the representation “Dividend = (divisor x quotient) + remainder”, the remainder must be non-negative. This is a widely accepted mathematical convention, and is useful in many applications. Thus, with the values in the example, the representation would be "-3 = (2 * -2) + 1". That said, be careful with "most languages" which are not consistent with mathematics. : )) Seriously, this may cause some error when coding some mathematical solution.
@InfiniteNesLives
@InfiniteNesLives Жыл бұрын
Thanks for the great and concise video! One suggestion I would have is to leave some of the printouts from the examples on the screen for longer so we have time to inspect and easily pause if need be. Some of the results are on the screen for so briefly before switching to new subject that have to be ready and quick with the pause button to press. Pressing run earlier would have helped greatly while you talked instead of talking about the expected result and leaving us in unnecessary anticipation.
@jaimelu2840
@jaimelu2840 Жыл бұрын
This is a great concise yet informative summary! Thank you!
@Mizaq
@Mizaq 5 ай бұрын
7:13 int isnt really "rounding" the value. For -0,7 you would still get 0 if you make int() around it, yet the round should be -1 since its closer. Therefore int() is just deleting the values right after the dot, that in this case will be same as using math.ceil() for negative values.
@seshubeshu5959
@seshubeshu5959 Жыл бұрын
@NeetCode I really appreciate the quick refresher on python. I used it back in grad school and never touched it again. Would it be possible to break down every topic into an individual video that can be maintained as a playlist ? I may not be the sharpest tool in the box, however, it feels like certain sections of the current video are little fast.
@Hamun002
@Hamun002 5 ай бұрын
Thank you for providing this, need to get back in the saddle and things like this really help
@entertainmentadda1183
@entertainmentadda1183 Жыл бұрын
This video cleared alot of my small problems in for loops and lambda function. Good work brother.
@camilailges36
@camilailges36 Жыл бұрын
BEST video of all!! I'm also deep learning python for code interviews and this has made my life so much easier!!! Thanks so much. Your videos are the bests!
@soumalyadas1123
@soumalyadas1123 8 ай бұрын
6:30 - that's why, we can better say it as *floor division* 7:48 - can also be done with abs(), just in case, importing math isn't possible
@md-ayaz
@md-ayaz 2 жыл бұрын
All good. I use python at work. When it comes to Object oriented design interviews Java/C++ works the best. Python falls short there.
@sharadrao4893
@sharadrao4893 2 жыл бұрын
WOW 🥺 I love you ❤️ I am new to programming now I am programmer. Thanks
@studywithjames
@studywithjames 5 ай бұрын
Can someone help me with 15:12 from my understanding, using "x = [0] * 3" creates [0, 0, 0], but all 0's are same object but its okay since we usually do "x[0] = 1", creating a NEW object. It is now [1, 0, 0]. But still, 0's are same object so, use the "=" sign to make NEW object. Now 2D array makes it harder. x = [[0] * 2] * 2 x[0][0] = 1 We could think that since using "=", it will only update [0][0]. But no. We are using "*" TWICE. (x = [[0] * 2] * 2). X is an object inside of an object. meaning, it will give [[1,0],[1,0]] To make a NEW object, we change the highest object. In this case, x[0] = [1, 0] thats why it sucks to use (x = [[0] * 2] * 2) in 2D array. You need to make a brand new one from scratch like x[0] = [1, 0].
@YIXINHU-dy9gl
@YIXINHU-dy9gl 11 күн бұрын
the most helpful video I've ever watched for python code interviews
@jeremynx
@jeremynx Ай бұрын
thank you. I refreshed everything in python in 26 mins
@yuurishibuya4797
@yuurishibuya4797 Жыл бұрын
16:20 Ord() for ascii value! Nice intuitive function name, easy to remember. /s
@junaidkhankhan4260
@junaidkhankhan4260 3 ай бұрын
Amazing I find it hard to shift from java to python due to these kind of differences
@venkateshmaliga659
@venkateshmaliga659 6 ай бұрын
Python doesn't have tree set /ordered set, Tree map /ordered map which are using self-BST so what are alternative to it in python to use those ? Sorted containers are not built in with python So That's leaves to bisect module ,but it uses binary search not red black trees so What do u think?
@KrishnaDasPC
@KrishnaDasPC 5 ай бұрын
12:33 Shortest way to reverse x = [1, 2, 3, 4] print(x[::-1]) will print [4, 3, 2, 1]
@mgicdood
@mgicdood 8 ай бұрын
I needed this. Ive been coding but as a game dev, and my mentor who want me to enter software development say i have to learn the Logic of Python. Thanks for this...even though im still making games on the side 😂😂
@TobyCrocker
@TobyCrocker 8 ай бұрын
Hi friend, love your channel, thank you so much for your efforts! I do have one suggestion, since you're teaching people to interview with Python, it might be helpful to follow PEP8 standards. Only interviewers with a background in Python will notice, however for experienced Python devs, not following the accepted style guidelines screams n00b which isn't ideal for interviewees trying to make a good impression. I know its a tiny detail which doesn't matter that much in the grand scheme because your channel is awesome and super helpful, however having more "Pythonic" style will definitely help junior devs put their best foot forward with more experienced Python folks.
@Ideolog-f7b
@Ideolog-f7b 16 күн бұрын
You just need to be honest with the interviewer that you use python only for coding interviews. They will understand. One only needs to learn just enough python to pass coding interviews.
@rajkumarv.b565
@rajkumarv.b565 Жыл бұрын
Thanks. Thanks a lot for this. I exactly looking for whether I can use python at big tech companies. You're really awesome.
@ZhenglinLi
@ZhenglinLi Жыл бұрын
From Java to Python here! Love the concise of Python and hate we must complete 2 DSA problems in 45 min interviews.
@andiuptown1711
@andiuptown1711 9 ай бұрын
Why hate?
@nischit727
@nischit727 8 ай бұрын
​@@andiuptown1711 probably because due to the time restriction
@CertifiedDeadMemes
@CertifiedDeadMemes 10 ай бұрын
Doing an interview for a role that will primarily use python tomorrow, if I get the job, I'll subscribe to NeetCode's only fans
@NeetCode
@NeetCode 10 ай бұрын
Good luck, you got this!!!
@andiuptown1711
@andiuptown1711 9 ай бұрын
Update
@CertifiedDeadMemes
@CertifiedDeadMemes 8 ай бұрын
they took forever to get back to me buy\t, yes I'm starting on Monday! @@andiuptown1711
@amospan14
@amospan14 2 жыл бұрын
Really, really appreciate you my man! This video is exactly what I needed. Your hard work does not go unnoticed. You deserve all the recognition and praise for putting together an incredibly thoughtful and well presented Python for coding interviews video.
@Eternal-j2j
@Eternal-j2j 11 ай бұрын
arr.sort(key=lambda x:len(x)) == arr.sort(key=len) its same
@SushmithaSathyanarayanan-u4l
@SushmithaSathyanarayanan-u4l 3 ай бұрын
How do u juggle between different languages? I might end up googling built in libraries if I juggle, which is not good for interviews
@prithvivenkatesh327
@prithvivenkatesh327 4 ай бұрын
Hi! 15:13 - can this part be explained in detail? By the way, thanks much for the amazing content you share!
@violetjellyfish2089
@violetjellyfish2089 5 ай бұрын
Отличное видео, большое спасибо! Очень удобно, что все чётко и посуществу, без длительных пауз и рассусоливаний
@Vukobratina
@Vukobratina 11 ай бұрын
this is great. Thanks for your time and effort bro. Personally for me, you talk really fast, so I suggest 0.75 speed in 'runtime;. lol
@akashdatta2002
@akashdatta2002 Жыл бұрын
I actually tried to learn python. But my course teachers are teaching us java for oop. So whenever i have both eclipse(cz i can't create jar files on vs code) and intellij ide for python installed in my laptp along with a cdeblocks, my computer hangs like a maniac. Even an ssd can't handle it.
@shubhadeepgoswami1633
@shubhadeepgoswami1633 Ай бұрын
Amazing video very crisp content . Thanks for making this !!
@krishnadass4365
@krishnadass4365 Жыл бұрын
Neetcode, I'm tripped on the 2-D list thing a bit. Especially this [[0]*4] * 4 -> why does changing one value, affect all values?
@_B_K_
@_B_K_ 8 ай бұрын
Technically speaking, self is not a keyword in Python. You can replace it with anything else you wish.
@NeetCode
@NeetCode 8 ай бұрын
good point!
@pinguincoder
@pinguincoder 2 жыл бұрын
Im Not preparing for coding Interviews as im already a Software Developer in Germany. But I wan't to increase my ability To solve algorithm based Problems and my Problem solving skills in general and your Videos are absolute Gold! I'll definately will take a look into Python as im currently only working with c# which ist Kind of noisy for those Problems.
@vihanbadasin2563
@vihanbadasin2563 2 жыл бұрын
*_Hey Neetcode dont know who deleted my previous comment posting again_* *_Hi bro have you also taught the actual tricks that are in those short answers in discuss section like bisect lambda and adv stuff like it here or in your paid course_*
@nikhil_a01
@nikhil_a01 Жыл бұрын
I bought NeetCode's courses. He doesn't teach any Python tricks at all. It's all about data structures and algorithms. I don't think I've even seen him use a list comprehension. The good thing about keeping the coding basic is that it's easier to translate to other languages. He usually provides code in Python, Java, Javascript, and C++.
@mounikathouda
@mounikathouda 23 күн бұрын
How did you get into google ? Please make a video on this.
@Fahim_Ahmed22b
@Fahim_Ahmed22b 2 жыл бұрын
This is super useful!!!! Thank you so much NeetCode!!!
@moulidharanshanmugam3031
@moulidharanshanmugam3031 5 ай бұрын
at 15:16 it is said that the values would change for all the sublist when created by the format [[0]*n]*n. If the reason is that it creates the same value, then why does the other values change when I do the same with [0]*n
@patrickateng4348
@patrickateng4348 Жыл бұрын
So, What exacly would I need to be a front end engineer? I'm sort of confused! I've done HTML and CSS and currently doing javascript. Should I drop Javascript and start python? If not, how far should I learn Javascript to be considered 'okay' by an interviewer to be able to use python in coding interviews?
@codephil
@codephil 11 ай бұрын
Wouldn't you want to do these in Python3 at this point? Do interviewers look down on using Python2?
@sigfigronath
@sigfigronath Жыл бұрын
Coming from Java this syntax is so bizarre to me ahaha, great video btw !
@mnchester
@mnchester Жыл бұрын
Great video! Still seems unreal that there's no native way to support a max-heap without that awkward workaround. I was expecting better from Python :)
@Sgoose105
@Sgoose105 Жыл бұрын
it'd better call [1, 2, 3] as list, as oppposed to an array. I think array refers to numpy array
@m04d10y1996
@m04d10y1996 Жыл бұрын
Thanks a lot for this video. Please make a video on how you learnt Java development and what resources you referred to and what was your strategy to learn and work in it.
@Migsfigs
@Migsfigs Жыл бұрын
Great video. Did you touch on linked lists? I might've missed it.
@10minutes_cs
@10minutes_cs Ай бұрын
collections can be of dynamic type , note how elements are integer , string ``` from collections import deque queue = deque() queue.append(1) queue.append("ab") queue.append(1) print(queue) mySet = set(queue) print(mySet) myMap = {} myMap["abc"] = 1 myMap[1] = "abc" print(myMap) ``` output ``` deque([1, 'ab', 1]) {1, 'ab'} {'abc': 1, 1: 'abc'} ```
@10minutes_cs
@10minutes_cs Ай бұрын
if you dont want end line ``` print("Hello", end="") print("World") ``` output : ``` HelloWorld ```
@10minutes_cs
@10minutes_cs Ай бұрын
u can add any string to end = "" , so print("Hello") is same as print("Hello", end=" ")
@akrammohamed8374
@akrammohamed8374 10 ай бұрын
The best video you've ever made is this one
@ding8880
@ding8880 2 жыл бұрын
Yo just want to let you know that I can't afford the paid version now. But someday in the future when I have a better job imma buy a few and gift others as a token of appreciation.
@sefasarac2839
@sefasarac2839 9 ай бұрын
Hello I want to ask a question. Is it necessary to use array modules (like numpy,array) in python or can we solve it with lists ? Because in reality there are some differences with real arrays and lists. But do they care about in DS & Algorithm interview ? As I understand from your video they dont.
@dhanuufcdk
@dhanuufcdk 2 жыл бұрын
Great video. Good for refreshing python concepts
@gopikirankommineni1137
@gopikirankommineni1137 Ай бұрын
and now that Google laid of its entire python team, what do you think about future of python usage at Google ?
@aussietramp
@aussietramp Жыл бұрын
New fan here. I gonna watch every single video and thumb up any of them!
@NeetCode
@NeetCode Жыл бұрын
Thank you 🙏
@1243576891
@1243576891 Жыл бұрын
Very helpful. Thanks for the organization!
@vanshikarastogi3139
@vanshikarastogi3139 3 ай бұрын
Hi , I am looking for system design in python , Can you please make videos on that too ?
@ahmadhawasli1294
@ahmadhawasli1294 2 ай бұрын
BIG thank you! ❤
@waiziiii
@waiziiii 2 ай бұрын
A great video for people who are already comfortable coding in other programming languages and want to learn python! Thanks man!
@Thekingslayer-ig5se
@Thekingslayer-ig5se Жыл бұрын
Is this good for data analysts also ?
@__sarik
@__sarik 2 жыл бұрын
Please also make a video regarding bisect function of py, it is also very useful. And also I have a question regarding heapq, what we should do if we want to have customized sorting?
@mukeshnayal624
@mukeshnayal624 Жыл бұрын
nice content ! will you make it for advance questions.
@chrishabgood8900
@chrishabgood8900 Жыл бұрын
advantage of python over ruby?
@boltonkim7090
@boltonkim7090 2 жыл бұрын
There are quite a few problems that can use sorted trees that guarantee log(n) for basic operations (add, remove and contains). It seems Python does not have anything built-in? I'd love to switch from Java to Python but this limitation is kind of a deal breaker. I know sortedcontainers and blist exist but they aren't available on most interview platforms. How do you deal with this?
@slh4176
@slh4176 Жыл бұрын
Same here
@botousai
@botousai Жыл бұрын
Make up a method and tell your interviewer "I know this structure doesn't exist in python, but I am going to pretend that we have it here". They don't care about your white board being perfect python code. They care about if you can solve the problem, how you think/communicate, etc.
@xzex2609
@xzex2609 Жыл бұрын
in one of your Videos you mention " see my video on object oriented programing in python" , I search but i cant find it. can you please direct me ?
@oshogarg5215
@oshogarg5215 8 ай бұрын
Can you please make more videos similar to this for Python , thanks
@Damian-cd2tj
@Damian-cd2tj Жыл бұрын
Great content, but I’m not sure why you keep calling arrays lists. Maybe because the square brackets syntax is used for arrays generally, but a python list is just a list. There’s even a separate array class that is more performant if needed.
@NG-bd6di
@NG-bd6di 2 жыл бұрын
Regarding the 2d arrays tip @15:16: Could you provide an example of how the "wrong" method would become an issue? I understand that it's basically 4 "clone" rows of zeros, rather than unique rows. But messing around with both methods, I can't get figure out when this difference would become a problem. Thanks!
@NeetCode
@NeetCode 2 жыл бұрын
If you were using it to store information, if you update one row it will update all of the rows in the same position. This would be troublesome for DP problems or graph problems.
@BrunoBAlt-n4h
@BrunoBAlt-n4h 8 ай бұрын
you can use .copy() tho
Big-O Notation - For Coding Interviews
20:38
NeetCode
Рет қаралды 491 М.
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 181 М.
Synyptas 4 | Жігіттер сынып қалды| 3 Bolim
19:27
kak budto
Рет қаралды 1,3 МЛН
I quit Amazon after two months
10:09
NeetCode
Рет қаралды 631 М.
Top 6 Coding Interview Concepts (Data Structures & Algorithms)
10:51
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,8 МЛН
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 549 М.
10 Crazy Python Operators That I Rarely Use
11:37
Indently
Рет қаралды 36 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 190 М.
How I Got Good at Coding Interviews
6:29
NeetCode
Рет қаралды 1,7 МЛН
Mock Google Coding Interview with a Meta Intern
47:04
NeetCode
Рет қаралды 1,1 МЛН