Two Sum - LeetCode 1 - Python Problem #1

Ғылым және технология

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
You can return the answer in any order.
We solve this problem using the brute force method (O(n^2)) and using hash map (O(n)).
Code: github.com/abhishekmshr956/Le...
LinkedIn: / abhishekmishraiitkgp
Twitter: / abhishek_iitkgp
0:00 Problem statement
1:47 O(n^2) brute force algorithm
4:36 O(n) hash map algorithm
10:00 brute force code
12:00 hash map code

Пікірлер: 2

  • @Rishi-sy6rr
    @Rishi-sy6rr10 ай бұрын

    please continue this series bro. Don't stop!. Btw great way of explanation.

  • @manvijha3572
    @manvijha357210 ай бұрын

    nicely explained 👍

Келесі