[Java] Leetcode 6. ZigZag Conversion [Array #7]

  Рет қаралды 13,999

Eric Programming

Eric Programming

Күн бұрын

In this video, I'm going to show you how to solve Leetcode 6. ZigZag Conversion which is related to Array.
In fact, I also have a whole section of solving leetcode questions and categorize them: kzbin.info...
Here’s a quick rundown of what you’re about to learn:
⭐️ Course Contents ⭐️
⌨️ (0:00) Question
⌨️ (1:25) Solution Explain
⌨️ (3:54) Code
In the end, you’ll have a really good understanding on how to solve Leetcode 6. ZigZag Conversion and questions that are similar to this Array.
Now, if you want to get good at Array, please checkout my Array playlist.
• Leetcode: Arrays
💻 Code: github.com/Eric-programming/C...

Пікірлер: 22
@yalansun4382
@yalansun4382 2 жыл бұрын
Very clear! Love the way you add comment/note of the code. thank you so much!
@CostaKazistov
@CostaKazistov Жыл бұрын
Much prefer your solution than the one in top search results (Neetcode - he went with math approach). I couldn't come up with the math formula. Stringbuilder solution is easier to understand and code. Great explanation, btw! 👍
@ArqamKarim
@ArqamKarim 10 ай бұрын
Yes, I've been looking for a better solution for a while now and finally found this video.
@raj_kundalia
@raj_kundalia Жыл бұрын
This is an amazing approach. Thank you!
@vicente3j
@vicente3j Жыл бұрын
Great explanation!! I went ahead and referenced a lot of your code in my solution since I was very stuck. I will say it helps a lot to make your variable names something relevant, because I wasn't really sure what the 'n' or 'index' referred to in your solution. Thanks man :)
@lambar0
@lambar0 Жыл бұрын
nice, simple and comprehensive
@saurabhdayal11
@saurabhdayal11 2 жыл бұрын
thanks you, your solution is very easy to understand
@papaz.z853
@papaz.z853 2 жыл бұрын
Very clear, thanks
@shelcyshajithekkedathu9180
@shelcyshajithekkedathu9180 Жыл бұрын
Best Explanation!
@MrRedloop
@MrRedloop 2 жыл бұрын
very clear! thank you!
@EricProgramming
@EricProgramming 2 жыл бұрын
Thank you very much for your compliments I really appreciate it
@flatsodaclub
@flatsodaclub Жыл бұрын
Hey, just curious, why in the 2nd for loop in the while statement do we set "j" to be "numRows - 2"? I am trying to wrap my head around that part, but the rest makes a lot of sense, thanks :)
@khalilsleimi7832
@khalilsleimi7832 Жыл бұрын
numRows is the number of rows, but we need our indices to be 0-based, thus the first -1, and the second -1 are because we're meaning to reference the item previous to the very last one. eg: (numRows -1) - 1 = lastRow -1 = theRowBeforeTheLast
@sakkamouid3343
@sakkamouid3343 2 жыл бұрын
I see in the video that you are talking about cycles and put as a goal identifying that cycle . But what if the string is not that string ? What if the string has no repeated characters , so that there is no cycles anymore?
@papaz.z853
@papaz.z853 2 жыл бұрын
you can understand cycle as pattern, there is always a pattern for zigzag, which is going down from the top and then going up from the bottom
@jackyshi6876
@jackyshi6876 2 жыл бұрын
what is the reason for index++ in append
@EricProgramming
@EricProgramming 2 жыл бұрын
Thanks Danny!
@ashwithchandra2622
@ashwithchandra2622 2 жыл бұрын
to start from where we left of like if we directly use i in place of index we again start from p so to oppose that we use index....
@hmmgmm2841
@hmmgmm2841 2 жыл бұрын
really fab . Hey behind you is there is a baby .
@RohanKumar-zm6cx
@RohanKumar-zm6cx 2 жыл бұрын
its not optimal soln as space complexity is not good
@nikhilpoonia8191
@nikhilpoonia8191 2 жыл бұрын
time complexity= 0(n square)???????? and whats the space complexity
@VincentTubed
@VincentTubed 2 жыл бұрын
funny to read these comments, not very well explained for my simple brain. Then again, is there any practical application for this?
5 Steps to Problem Solve Coding Interview Questions
14:10
Eric Programming
Рет қаралды 3,5 М.
[Java] Leetcode 59. Spiral Matrix II [Array #8]
6:15
Eric Programming
Рет қаралды 2,6 М.
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 55 МЛН
لقد سرقت حلوى القطن بشكل خفي لأصنع مصاصة🤫😎
00:33
Cool Tool SHORTS Arabic
Рет қаралды 29 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:40
CRAZY GREAPA
Рет қаралды 33 МЛН
Worst leetcode hard problem - Text Justification : 68
13:06
Destination FAANG
Рет қаралды 1,3 М.
DSA Phir se with Sumeet | Leetcode 6 | Zigzag Conversion
17:54
[Java] Leetcode 37. Sudoku Solver [Backtracking #8]
17:44
Eric Programming
Рет қаралды 10 М.
Winning Google Kickstart Round C 2020
30:57
William Lin
Рет қаралды 3,9 МЛН
[Java] Tries (Prefix Tree) | Solve Leetcode - Implement Trie in Code
15:21
LeetCode 238. Product of Array Except Self (Solution Explained)
14:49
Zigzag Conversion - Leetcode 6 - Java
9:58
Mastering Programming
Рет қаралды 9 М.
Google Coding Interview With A Competitive Programmer
54:17
Clément Mihailescu
Рет қаралды 2,5 МЛН
Reorganize String
12:44
Kevin Naughton Jr.
Рет қаралды 77 М.
I solved 541 Leetcode problems. But you need only 150.
7:42
Sahil & Sarra
Рет қаралды 2,3 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 55 МЛН