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 {}
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
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
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
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 {}
Bro ee test case deggara error vastadi [3,2,4]
6
Output:
[0,2]
Expected:
[1,2]
Lucky to have you in telugu DSA community
Well explained on two sum problem statement, tq Bharat
Bro. You always keep reminding me to solve the question and try it before seeing solution. Thank you so much ❤
Bharat, love babbar 450 questions kuda solve cheyava, this would be great help for future generations.
Hi Bharat, Could make video on "Minimize the Heights II" problem.
Love u Anna ❤️❤️
Love you too Sadiq! Keep solving
I hope you post the video every single day , it helps who are near to there placements
bro...........binary search video cheyandhi
we are lucky
Super
Sliding Window Detailed Video Please
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
@@bharathh_chandraa ok anna 👍
Hi Bharath, How r u? no videos last two day? hope you well.
All good brother. How are you?
Got busy with something else, you can expect consistent uploads this week.
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
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
Ok anna thank u
@@bharathh_chandraa vachindhi anna, adhi nenu def tharvatha identation vadaledhu