[Java] Leetcode 1089. Duplicate Zeros [Array #5]

  Рет қаралды 8,748

Eric Programming

Eric Programming

Күн бұрын

Пікірлер: 29
@martyk8679
@martyk8679 2 жыл бұрын
This is the best solution I’ve seen for this question. Very well explained. Thank you!
@EricProgramming
@EricProgramming 2 жыл бұрын
Glad it was helpful!
@valkon_
@valkon_ 2 жыл бұрын
Thank you for the solution, it's really important to utilize the data structures. Sadly, this question demands to be solved in place and I honestly hate it. No one will come up with counting zeroes trick on an interview first time seeing the problem, they do not want problem solvers they want master of memorization.
@nwokolobueze7291
@nwokolobueze7291 2 жыл бұрын
This makes so much sense to me. Good job Eric.
@frankf5398
@frankf5398 2 жыл бұрын
Best understandable and easiest solution. Big thanks
@EricProgramming
@EricProgramming 2 жыл бұрын
You're welcome!
@akoboyd1099
@akoboyd1099 2 жыл бұрын
This was the best solution. Surprised as you were only one I saw use this implementation.
@spemovie
@spemovie 2 жыл бұрын
But why do we need this solution if the task could be solved in O(1) memory
@edavar6265
@edavar6265 Жыл бұрын
I was trying to do something similiar with variables but using a queue is really smart! Thanks a lot. Do you think I can solve it by storing the to-be-shifted elements into an array?
@arif3012
@arif3012 2 жыл бұрын
Great explanation using Queue ⌨5:27
@EricProgramming
@EricProgramming 2 жыл бұрын
Thanks! 😃
@osamaalsalman6865
@osamaalsalman6865 2 жыл бұрын
That's a smart way to solve it! Thanks!
@vishalialahappan9069
@vishalialahappan9069 2 ай бұрын
Elegant resolve!
@mingyueliu7779
@mingyueliu7779 6 ай бұрын
That's true that it's kinda hard to bring up 2pointer at interview, I like your solution way better, thanks !
@weiwang4798
@weiwang4798 2 жыл бұрын
Wonderful explanation! Thanks, Eric!
@EricProgramming
@EricProgramming 2 жыл бұрын
Very welcome!
@aaronelmquist8607
@aaronelmquist8607 5 ай бұрын
Great solution.
@shrirangjoshi6568
@shrirangjoshi6568 6 ай бұрын
Good solution
@damianwojtowicz5212
@damianwojtowicz5212 2 жыл бұрын
OO man, this is briliant!!!
@kidztse
@kidztse Жыл бұрын
Smart !!!!
@snowglider400
@snowglider400 2 жыл бұрын
You shouldn't need to use another data structure for this. just use the same array and shift the last elements out of place.
@lucasgontijo2187
@lucasgontijo2187 Жыл бұрын
What did u mean? The thing is that the array should be right shifted entirely, not just the last position
@shubhamkumar-gw4vb
@shubhamkumar-gw4vb 2 жыл бұрын
nicely explained , could've emphasized a bit more on the coding part though
@EricProgramming
@EricProgramming 2 жыл бұрын
In the future I will
@aabhishek4911
@aabhishek4911 2 жыл бұрын
The code is pretty easy after the explanation
@UnfinishedYara
@UnfinishedYara Жыл бұрын
Dude how is this marked easy??
@krityaan
@krityaan 6 ай бұрын
Ignore the constraints xD
@dk--21
@dk--21 9 ай бұрын
Good solution but this violates the constraints of the problem to solve in-place.
@Sranju23
@Sranju23 8 ай бұрын
how? He didnt create new array and updated existing
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 279 М.
The 3 Laws of Writing Readable Code
5:28
Kantan Coding
Рет қаралды 533 М.
At the end of the video, deadpool did this #harleyquinn #deadpool3 #wolverin #shorts
00:15
Anastasyia Prichinina. Actress. Cosplayer.
Рет қаралды 17 МЛН
Секрет фокусника! #shorts
00:15
Роман Magic
Рет қаралды 81 МЛН
1089. Duplicate Zeros - LeetCode Solution
7:52
Game of Coders
Рет қаралды 24 М.
[Java] Leetcode 539. Minimum Time Difference [Array #6]
9:03
Eric Programming
Рет қаралды 853
Cursor Is Beating VS Code (...by forking it)
18:00
Theo - t3․gg
Рет қаралды 18 М.
Advice from the Top 1% of Software Engineers
10:21
Kevin Naughton Jr.
Рет қаралды 3,3 МЛН
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 207 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 498 М.
How I Got Good at Coding Interviews
6:29
NeetCode
Рет қаралды 1,6 МЛН
Remove Duplicates from Sorted Array
5:41
Kevin Naughton Jr.
Рет қаралды 74 М.
Merge Sorted Array - LeetCode 88 - Java
11:40
LeetCode University
Рет қаралды 9 М.
At the end of the video, deadpool did this #harleyquinn #deadpool3 #wolverin #shorts
00:15
Anastasyia Prichinina. Actress. Cosplayer.
Рет қаралды 17 МЛН