Two Sum - LeetCode 1 - Python Problem #1

Поділитися
Вставка
  • Опубліковано 25 чер 2024
  • 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-sy6rr 8 місяців тому +1

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

  • @manvijha3572
    @manvijha3572 8 місяців тому

    nicely explained 👍