Google Interview Question: Two Sum (Java Solution & HashSet Tutorial)

Veröffentlicht am: 10 Juni 2020
auf dem Kanal: Daily Coding Problem
338
6

Google Interview Question: Two Sum (Java Solution & HashSet Tutorial)

Not employed by dailycodingproblem.com, just a fan.

You can (and should) sign up to receive an email with a coding problem everyday here: https://www.dailycodingproblem.com

You can subscribe to my channel here:    / @dailycodingproblem8346  

Daily Coding Problem: Problem #1 [Easy]
Good morning! Here's your coding interview problem for today.

This problem was recently asked by Google.

Given a list of numbers and a number k, return whether any two numbers from the list add up to k.

For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17.

Bonus: Can you do this in one pass?

Solution is optimized (one pass, O(N)) and involves the use of a HashSet (brief Java HashSet/HashMap tutorial)


Auf dieser Seite können Sie das Online-Video Google Interview Question: Two Sum (Java Solution & HashSet Tutorial) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Daily Coding Problem 10 Juni 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 338 Mal angesehen und es wurde von 6 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!