Solving Coding Interview Questions in Python on LeetCode (easy & medium problems)

preview_player
Показать описание
In this video we walk through a series of eight coding interview questions on leetcode. These are algorithms problems that cover topics including data structures, time & space complexity, sorting, binary search, object oriented programming, breadth first search, tree traversals, and more. The difficulty of problems range from easy to medium and get gradually harder as you go through the video.

Practice your Python Pandas data science skills with problems on StrataScratch!

Join the Python Army to get access to perks!

If you enjoy this video, make sure to SUBSCRIBE to not miss future videos.

Feel free to recommend the next problems that I should solve on YouTube!

Links to problems:

-------------------------
Timeline!
0:00 - Introduction
2:02 - LeetCode 1678 - Goal Parser Interpretation
6:04 - LeetCode 1436 - Destination City
14:07 - LeetCode 1365 - How Many Numbers Are Smaller Than the Current Number
33:13 - LeetCode 704 - Binary Search
46:13 - LeetCode 409 - Longest Palindrome
55:01 - LeetCode 1561 - Maximum Number of Coins You Can Get
1:10:09 - LeetCode 1472 - Design Browser History
1:22:32 - LeetCode 1110 - Delete Nodes And Return Forest
1:38:23 - Conclusion & Announcement!

-------------------------
Follow me on social media!

-------------------------

*I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links.
Рекомендации по теме
Комментарии
Автор


Also, we're getting so close to 100K!! So crazy. I really appreciate everyone's support and am super thankful to have a platform where the content can reach so many. Love ya'll!

KeithGalli
Автор

loved how you have labeled each segment of the video with the corresponding problem title, keep up the great work !!

Roastmaster
Автор

Great video!
Please note the middle can overflow. Thus, we prefer to use mid=start+(end-start) / 2

ilanaizelman
Автор

Thank you Keith for great Videos. A couple of suggestions: If you can dissect the problems, that would be great. E.g. String command = string method in Python. In order to solve this problem, you need to know class, string methods, replace() and functions. Here are the links for class, ..., functions.

hkemal
Автор

We love the way you did this. I prefer this approach over youtubers that clearly comes prepared and solve it with no hesitancy and in a bit of complex way

nileshshukla
Автор

Thankyou so much Keith! I just learned how to approach a problem. You made it looked so easy. Please post more content like this.

sauravthakur
Автор

It was really fun to walk through these with your video after trying each one myself. Some of my solutions were the same and others quite different. Overall a great video, thanks!

kevinweiss
Автор

Hey Keith more videos on leetcode please, this video is super awesome, love the way how you explain each and every step, please do more videos on leetcode thank you

shreehari
Автор

you're brilliant bro. The way you think really helps me understand how to solve these questions

cbingu
Автор

Hey Keith love your content👍, Can you do maybe a series of videos on algorithms in python

pratick
Автор

Loved this 🔥 please do more of such leetcode questions. Let's hit that 100k and 1k😁

atharvapatil
Автор

Hey Keith, well done video!
For the palindrome problem, your solution wouldn't work properly if you have 2 different characters with odd number of appearances, you would add both of them to the count while only one could be used as the palindrome "center"

matan
Автор

Love your videos. Each time you upload a new one, its just like you read my mind and give me exactly what I need to become a data scientist. Please do a SQL tutorial or even better a "real world" example of how using SQL together with Python. Greetings from Sweden

andyn
Автор

Hi, Keith! Thanks a lot for the video, it's awesome!

I have an assumption of why performance is not that good in the last problem. You use a list to implement a queue, but as far as I know Python implements list as dynamic array and removing an element from the beginning has O(n) complexity (due to shifting), so lists are suitable to be used as stacks, but very slow when used as queues.

Instead, we could use collections.deque which has amortized O(1) complexity of removing element from either the beginning or the end (so can be used efficiently both as a stack and a queue)

pgctpyc
Автор

This is very helpful. more of these please!!

ryandavis
Автор

Thanks keith. I've been looking for content like this.

timthegreatone
Автор

Thanks for the great video! How common are questions like this in data science interviews compared to the pandas type questions in your stratascratch video?

paddygthatsme
Автор

I love my own solution to the second question on Destination City. I simply returned the cityB that doesn't occur anywhere else in the whole list.


class Solution:
def destCity(self, paths: List[List[str]]) -> str:
for path in paths:
lister = [x for x in paths if x != path]
if not (any(path[1] in listeri for listeri in lister)):
return path[1]

Chuukwudi
Автор

Love this!!! Pls more content in this direction.

raphaelokoye
Автор

Excellent video! Greatly helped me. Thank you very much!

nataliatenoriomaia