??Day 6:-Two Sum

??Day 6:-Two Sum

I’m back! Took a short break, but now it’s time to get back on track. The next two weeks are all about consistency, and I’ll be solving & posting a DSA challenge every single day—no more excuses! ??

?? Problem Statement: Two Sum

Ever struggled with finding the perfect pair? Well, here’s a coding twist on that!

? Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target. ? You cannot use the same element twice. ? There is exactly one solution.

Example Scenarios:

? Input: nums = [2,7,11,15], target = 9 Output: [0,1]

? Input: nums = [3,2,4], target = 6 Output: [1,2]

? Input: nums = [3,3], target = 6 Output: [0,1]

? Like, Share, Comment, Feedback & Subscribe for More! Feel free to share your thoughts and follow along with the challenge. Let’s learn and improve together!

?? #100DaysLeetCode #LeetCodeChallenge #Python #PythonCoding #DSA #ProblemSolving #CodingJourney #Disha100DaysChallenge

要查看或添加评论,请登录

Disha Khanpara的更多文章

  • ??Day 7:- Add to Array-Form of Integer

    ??Day 7:- Add to Array-Form of Integer

    ?? Problem Statement: Array-Form Addition Ever wondered how to represent numbers in an array and perform arithmetic…

  • ??Day 5:-Water Bottles

    ??Day 5:-Water Bottles

    ?? Problem Statement: Water Bottles You have numBottles full water bottles. After drinking a bottle, it becomes empty.

    2 条评论
  • ?? Day 4: Tribonacci Number

    ?? Day 4: Tribonacci Number

    ?? Problem Statement: The Tribonacci sequence is defined as: ?? T(0) = 0, T(1) = 1, T(2) = 1 ?? T(n) = T(n - 1) + T(n -…

  • ?? Day 3: Fibonacci Number

    ?? Day 3: Fibonacci Number

    ?? Problem Statement: The Fibonacci numbers, commonly denoted F(n), form a sequence, called the Fibonacci sequence…

    3 条评论
  • ?? Day 2: Power of Two

    ?? Day 2: Power of Two

    ?? Problem Statement: Given an integer n, return true if it is a power of two, otherwise return false. A number is a…

  • 100 Days of LeetCode: "Day 1 - Palindrome Number"

    100 Days of LeetCode: "Day 1 - Palindrome Number"

    Hello everyone! ?? Today, I’m beginning my 100 Days LeetCode Challenge and wanted to share it with you. For the next…

  • DO EPIC SHIT Book by Ankur Warikoo

    DO EPIC SHIT Book by Ankur Warikoo

    "Do Epic Shit" by Ankur Warikoo is a remarkable book brimming with invaluable life lessons. It commences with profound…

    4 条评论

社区洞察