15. 3 Sum - LeetCode - Python - Tamil

preview_player
Показать описание
#CodeMeal #python #leetcode #coding #3sum #threesum #sum #3 #15 #3values #threenumbers #3numbers #tamil

Рекомендации по теме
Комментарии
Автор

Bro ultimate bro... Na ellar madhirium indha video pathutu mass nu sollala bro... DSA na tamila ni dhan bro athum antha methods ( two pointer, sliding window)laam veridhanama explain pandra bro
enna dhan thedi pathalum english la irukkum bro...ana tamil la clear explain oda ni dhan vrrrro... 🔥🔥🔥

EC-DHARMARAJANAR
Автор

I Love your work🥰 and effort but try to explain slower because you missed lots of thing it made me confuse

NishanthRM-js
Автор

bro only 1 test case is passed other 2 test case is not passed bro, please check my code
class Solution:
def threeSum(self, nums: List[int]) -> List[List[int]]:
nums.sort()
result=[]
if len(nums)<3:
return []
for i in range(0, len(nums)-2):
if nums[i]==nums[i-1] and i>0:
continue
l=i+1
r=len(nums)-1
value=nums[i]
while l<r:
sum=nums[i]+nums[l]+nums[r]
if sum==0:

l+=1
r-=1
while nums[l]==nums[l-1] and l<r:
l+=1
while nums[r]==nums[r+1] and l<r:
r-=1
elif sum<0:
l+=1
while nums[l]==nums[l-1] and l<r:
l+=1
elif sum>0:
r-=1
while nums[r]==nums[r+1] and l<r:
r-=1
return result

JaiKanth-og
Автор

not able to find the error

class Solution(object):
def threeSum(self, nums):
nums.sort()
result = []
if len(nums)<3:
return []
for i in range(0, len(nums)-2):
if[nums]==nums[i-1] and i>0:
continue
a=nums[i]
l=i+1
r=len(nums)-1
while l<r:
s=nums[i]+nums[l]+nums[r]
if s==0:
result.append([nums[i], nums[l], nums[r]])
l+=1
r-=1
while nums[l]==nums[l-1] and l<r:
l+=1
while nums[r]==nums[r+1] and l<r:
r-=1

elif s<0:
l+=1
while nums[l]==nums[l-1] and l<r:
l+=1
elif s>0:
r-=1
while nums[r]==nums[r+1] and l<r:
r-=1
return result

ramborange
Автор

anna unga explain robma perusa poguthu

ARUN-ygbv
visit shbcf.ru