We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defis_nondegenerate(a,b,c):returnall((a+b>c,b+c>a,a+c>b))defmaximumPerimeterTriangle(sticks):# Write your code heredata=[iforiinitertools.combinations(sticks,3)ifis_nondegenerate(i[0],i[1],i[2])]return[-1]ifnotdataelsesorted(sorted(data,key=lambdax:(sum(x),max(x),min(x)))[-1])
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Maximum Perimeter Triangle
You are viewing a single comment's thread. Return to all comments →