Two Sum II - Input Array Is Sorted (LeetCode 167) | Neetcode 11 / 150 | Bharath Chandra (Telugu)

Поділитися
Вставка
  • Опубліковано 10 вер 2024

КОМЕНТАРІ • 22

  • @bharathh_chandraa
    @bharathh_chandraa  Місяць тому +3

    Corrected Pseudocode for 1 based indexing
    i = 0, j = n - 1
    while i < j
    if nums[i] + nums[j] == target
    return {i+1, j+1}
    else if nums[i] + nums[j] > target
    j-=1
    else
    i+=1
    return {}

    • @enjoyeducation498
      @enjoyeducation498 Місяць тому +1

      Bro ee test case deggara error vastadi [3,2,4]
      6
      Output:
      [0,2]
      Expected:
      [1,2]

  • @marvelmania7195
    @marvelmania7195 Місяць тому +2

    Lucky to have you in telugu DSA community

  • @shaikhanuman8012
    @shaikhanuman8012 Місяць тому

    Well explained on two sum problem statement, tq Bharat

  • @maheswara_pradeep8235
    @maheswara_pradeep8235 Місяць тому +2

    Bro. You always keep reminding me to solve the question and try it before seeing solution. Thank you so much ❤

  • @shaikhanuman8012
    @shaikhanuman8012 Місяць тому

    Bharat, love babbar 450 questions kuda solve cheyava, this would be great help for future generations.

  • @shaiksadiq5493
    @shaiksadiq5493 Місяць тому +1

    Love u Anna ❤️❤️

  • @bhavanapentam7519
    @bhavanapentam7519 Місяць тому

    I hope you post the video every single day , it helps who are near to there placements

  • @shaikhanuman8012
    @shaikhanuman8012 19 днів тому

    Hi Bharat, Could make video on "Minimize the Heights II" problem.

  • @Tech_blasto
    @Tech_blasto Місяць тому

    we are lucky

  • @meghanareddy4209
    @meghanareddy4209 Місяць тому

    bro...........binary search video cheyandhi

  • @Manjith-1887
    @Manjith-1887 Місяць тому

    Sliding Window Detailed Video Please

    • @bharathh_chandraa
      @bharathh_chandraa  Місяць тому

      2 Pointer Video lo model 2 kindha sliding window already cover chesesam Manjith. Aa model saripovaali problems ki, inka avasaram padtundi anipisthe next level manadi Sliding window ne so video release chestha

    • @Manjith-1887
      @Manjith-1887 Місяць тому

      @@bharathh_chandraa ok anna 👍

  • @manojprakashreddy2099
    @manojprakashreddy2099 Місяць тому

    Super

  • @shanmukharao3378
    @shanmukharao3378 Місяць тому

    Hi Bharath, How r u? no videos last two day? hope you well.

    • @bharathh_chandraa
      @bharathh_chandraa  Місяць тому +1

      All good brother. How are you?
      Got busy with something else, you can expect consistent uploads this week.

  • @yamunaangadi538
    @yamunaangadi538 Місяць тому

    class Solution:
    def twoSum(self, numbers: List[int], target: int) -> List[int]:
    i=0
    j=n-1
    while itarget:
    j-=1
    else:
    i-=1
    ile "/box/script.py", line 19
    return [i+1,j+1]
    ^^^^^^^^^^^^^^^^
    SyntaxError: 'return' outside function
    anna ela error vasthundhi

    • @bharathh_chandraa
      @bharathh_chandraa  Місяць тому

      Indentation anni places lo same undaali Yamuna. So while loop tharavatga if condition ki enni spaces vadhilaavo, if condition tharavatga return ki kooda anne spaces vadhalaali.
      Chatgpt ni adugu code sari chesi ela chesindo kooda cheptadi

    • @yamunaangadi538
      @yamunaangadi538 Місяць тому

      Ok anna thank u

    • @yamunaangadi538
      @yamunaangadi538 Місяць тому

      @@bharathh_chandraa vachindhi anna, adhi nenu def tharvatha identation vadaledhu