LeetCode Exercise in Java Tutorial - Two Sum FAST Solution

preview_player
Показать описание
Full tutorial for a FAST solution for the LeetCode Two Sum exercise in Java!

00:00 The Problem
03:09 Brute Force Solution
08:12 Brute Force Results
10:17 Throwing a HashMap at it
20:01 HashMap Results

Are you starting to grind LeetCode in Java, but getting stuck on the how to figure out some of the trickier fast solutions?

In this video we'll walk through the fastest solution for the LeetCode Two Sum problem, the very first problem in LeetCode , written in Java!

Learn or improve your Java by watching it being coded live!

Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners.

Let me know what else you'd like to see!

Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.

📕 THE best book to learn Java, Effective Java by Joshua Bloch

📕 One of my favorite programming books, Clean Code by Robert Martin

🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial

🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)

📹Phone I use for recording:

🎙️Microphone I use (classy, I know):

Donate with PayPal (Thank you so much!)

☕Complete Java course:

Рекомендации по теме
Комментарии
Автор

Doing more these kinds of things is very helpful, especially how u approach them. Teachers normally tell us the optimal solution but how to get to that or how to come up with that solution is not normally taught to us.

BlazingStar
Автор

Do more of these kind of videos because your thought process make me think in a different way than before.

manosmakris
Автор

Yes, more videos like this would be amazing because you don't only solve the challenges, but explain the thinking behind it.

omarkabada
Автор

Thanks a lot John. Please start a Leetcode series, your way of explanation is flawless

memesv.
Автор

honestly a weekly leetcode video like this would be so good. Please do more!

zoflax
Автор

I thought of your initial solution right away but would have NEVER thought of the better way. These types of videos are EXTREMELY helpful in reprogramming the way I look at a problem. Thank you!!

wadebrumbaugh
Автор

Love these algorithm video's personally, keep'em coming! Of course all your tutorials are also awesome- so I guess just keep up the good work!

Rivrt
Автор

Please, keep doing this leetcode content. There is not good leetcode videos in Java, so this is gold!

GuessWhos
Автор

Please do this kind of videos.
It helps alot to understand the problem

RizwanAli-bynl
Автор

I definitely want more videos like this! You're an excellent teacher. I'm trying to get a job as a Java developer and I'm freshening up my knowledge. I will always come back to your videos. They are fun, interesting topics, easy explained and very helpful! 😃

christianolsson
Автор

More of these types of videos would be fantastic! Your explanations throughout all of your videos are incredible, and I just started tackling coding challenges and I've been struggling with how to even begin. Appreciate your channel so much!

joryroberts
Автор

We want more leetcode questions! you're an expert in teaching. Thanks a lot.

jnrsrwx
Автор

A playlist with videos like this would be phenomenal! Thank you for sharing these with us!

soniahandle
Автор

really this is soo awesome because i just started doing leetcode and i wanted someone who can guide me and here you are like a angel :D

tangobee
Автор

I have to agree with the majority of the other comments - your explanations of algorithms for solving LeetCode solutions (well, in general good software algorithms) are some of the clearest I've seen. This is probably going to be a new subcategory of videos that you might not have planned to do, but I can see there's so much interest you have no choice but to do them! (Please?)

hassansiddiqui
Автор

I'm new to this channal. Before I saw this video I don't knew what is really hashmap is but after seeing Nothing to say.
This video is really helpful.
Thank's for creating this awesome video.

neeldiyora
Автор

In order to create a stash of solutions to common problems, I'd love to see more of such videos, taught by someone who really knows what he's doing and who can teach in a clear and straightforward manner. Thanks for sharing this knowledge.

micleh
Автор

As a mostly self taught dev, I really appreciate your content. It has helped me grasp concepts I've been struggling with for a very long time. Thank you!!

Michaelpschreib
Автор

I've to advocate that we do need more such stuff, @John.

musaddiqmanzoor
Автор

Thanks for the encouragement at the end. My solution is close but not quite optimal. It's O(n) space complexity but O(2n) time complexity. I felt bad about not thinking about the hashmap solution until you gave your encouraging words at the end! Thanks man 🥺

Bladebreakr