Transnational Python Solution


  • 0
    W

    class so():
    def threesum(self,x):
    final = []
    new =[]
    for i in range(len(x)):
    for j in range(i+1,len(x)):
    for n in range(j+1,len(x)):
    if x[i]+x[j]+x[n]==0:
    new = [x[i],x[j],x[n]]
    final.append(new)
    for m,k in enumerate(final):
    print('No.',m+1,'Solution is ',k)


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.