MOVE ZEROES | LEETCODE 283 | PYTHON SOLUTION
Vložit
- čas přidán 5. 07. 2024
- Channel Discord Community: / discord
Problem Link: leetcode.com/problems/move-ze...
Today we're solving an easy tier question for some of those people who are maybe just beginning their Leetcode journey. This is a popular question asked at many of the big companies and is a good one to know as it's often used as a warm-up question.
TIMESTAMPS
00:00 Intro
00:10 Question Prompt
00:30 Basic Example
01:06 Solution Intuition
5:04 Coding
7:50 Time/Space Complexity
8:25 Outro - Věda a technologie
What an amazing channel, my brother! Love it a lot
Thank you for this! Would it be possible to make one for 249. Group Shifted strings?
Could have sworn I already did that one but I guess not. Will add it to the queue
Your thoughts on starting this swapping logic from start vs end?
Feels like its much easier and more accurate doing from the end,
loop til the counter reaches the start - swap while you find a 0
Solve it however you'd like really, I'm sure there's more than 1 way to do it. Either way you will parse the array once. Just make sure you have the same complexity for your algorithm and it should be fine